From 61338820f9ef150b0df6a2a7a9a410214a7a92c2 Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Fri, 31 Jul 2026 18:22:07 +0000 Subject: [PATCH 01/25] docs(openspec): plan operator web UI and hot reload --- .../.openspec.yaml | 2 + .../design.md | 127 +++++++++++++++ .../proposal.md | 31 ++++ .../specs/operator-web-ui/spec.md | 146 ++++++++++++++++++ .../specs/operator-workflow-reload/spec.md | 29 ++++ .../specs/versioned-run-topology/spec.md | 33 ++++ .../tasks.md | 42 +++++ openspec/config.yaml | 32 ++++ 8 files changed, 442 insertions(+) create mode 100644 openspec/changes/add-operator-web-ui-and-hot-reload/.openspec.yaml create mode 100644 openspec/changes/add-operator-web-ui-and-hot-reload/design.md create mode 100644 openspec/changes/add-operator-web-ui-and-hot-reload/proposal.md create mode 100644 openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md create mode 100644 openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-workflow-reload/spec.md create mode 100644 openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md create mode 100644 openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md create mode 100644 openspec/config.yaml diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/.openspec.yaml b/openspec/changes/add-operator-web-ui-and-hot-reload/.openspec.yaml new file mode 100644 index 0000000..ab39675 --- /dev/null +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-07-30 diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/design.md b/openspec/changes/add-operator-web-ui-and-hot-reload/design.md new file mode 100644 index 0000000..1b96c3b --- /dev/null +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/design.md @@ -0,0 +1,127 @@ +## Context + +The operator already watches source paths and calls `WorkflowRegistry.rescan`, which atomically replaces the current `CatalogView`. That view is intentionally current-only and is not published through the update stream. The run worker already emits the prepared workflow's node IDs, graph, node types, and display names, but `_run_from_prepared` retains only per-node name and type in `RunState`; edges and ordering are discarded. `RunSnapshot` consequently cannot reconstruct a historical DAG. + +The gRPC protocol currently separates catalog listing from a stream of run-only updates. Browser JavaScript cannot consume the existing native gRPC server directly; it needs a browser transport adapter such as gRPC-Web or an HTTP/SSE gateway. + +## Goals / Non-Goals + +**Goals:** +- Establish one immutable, execution-derived topology for every run. +- Publish complete, atomically replaceable current-catalog revisions to interactive clients. +- Make current-workflow and historical-run views independent but navigable from the same UI. +- Preserve the existing local-first, loopback-default operator security model. + +**Non-Goals:** +- Editing workflow source or composing DAGs in the browser. Mutating a running workflow when its source changes. +- Durable run history or workflow-version storage across operator restarts. +- Production authentication, multi-tenancy, or public Internet serving. +- Publishing workflow `BaseInput` schemas, generating input forms, or providing schema-aware JSON editing. + +## Decisions + +### Retain a topology snapshot with each run + +Introduce a frozen workflow-topology value containing only node ID order, adjacency graph, node types, and display names. Construct it from the worker's `prepared` event, not the current catalog descriptor: the worker event represents what that run actually loaded and executed. Store it on the in-memory run record and include it in the structural run snapshot and transport representation. + +`RunState.nodes` remains execution state keyed by node ID. The topology snapshot is the rendering and identity layer. A run view joins the two; it never reads the current `WorkflowInfo` to supply missing nodes or edges. + +``` +current catalog run record +─────────────── ────────── +WorkflowDescriptor revision N RunState + TopologySnapshot + │ captured from prepared workflow + ▼ │ +workflow view ▼ + run view = topology + execution state +``` + +This also handles a source change between catalog discovery and worker preparation: the run view reports the topology the worker emitted, not a potentially stale catalog descriptor. + +### Retain bounded node failure messages + +The run worker already reports a bounded `error` string with `node_failed`. Retain that value on node execution state and carry it in structural run snapshots and live node-status updates. The run inspector displays the message with status and timing. Do not retain exception objects or add traceback capture in v1. + +### Treat reload as a new immutable catalog revision + +Discovery builds a candidate catalog off-lock. The operator validates it, replaces the current catalog in one operation, assigns a monotonically increasing catalog revision, and publishes the resulting full catalog snapshot plus diagnostics. Clients use the revision to discard older updates and replace their current-workflow state wholesale. + +A failed or invalid candidate preserves the last successful catalog and publishes diagnostics rather than a partial replacement. This changes the present `WorkflowRegistry.rescan` behavior, whose own documentation says it does not retain a last-good descriptor. + +Catalog changes are independent of run updates: an active run keeps its topology snapshot; the new catalog is used for subsequent selections and run starts. + +### Publish scan targets as catalog metadata + +Project each existing `ConfiguredRoot` into an immutable `ScanTargetInfo` containing its stable alias, normalized target path, and `file` or `directory` kind. Add the scan-target collection to initial catalog reads, live catalog replacements, and reset baselines. Workflows already carry `root_alias`, which is the only join key the browser needs. + +This is a read-only client projection of operator configuration. It does not change discovery, workflow identity, source watching, or execution. + +### Extend the live transport to include catalog revisions + +The current `StreamRunUpdates` envelope represents only run changes. Replace it with an operator-update stream/envelope that can carry either a run update, a complete catalog revision, or an existing reset notice. Migrate the TUI client to the new stream at the same time; do not retain a parallel legacy stream. + +A reconnect or reset reloads a consistent baseline: the latest catalog revision and the retained run summaries/snapshots. Catalog events carry a full replacement view rather than an incremental graph diff, avoiding client-side patch ordering and deletion edge cases. The web UI can animate before/after topologies locally using stable node IDs. + +### Use gRPC-Web for browser transport + +The web client SHALL use generated TypeScript stubs from `operator.proto` through an in-process gRPC-Web-capable adapter owned by the operator. One `ava operator` process hosts the existing native gRPC listener for Python/TUI clients and an optional browser-facing listener for compiled assets and gRPC-Web unary/server-streaming requests. Both listeners use the same authoritative `Operator` instance; there is no second operator, duplicated state, required sidecar process, or inter-process synchronization. + +This keeps `operator.proto` as the sole public operation and event schema while leaving the operator independently usable without the web listener. The browser listener is loopback-only by default and same-origin with its assets, avoiding default CORS exposure. Non-loopback use remains explicitly delegated to a trusted, authenticated external boundary. If no reliable in-process adapter supports the required streaming semantics, the transport decision MUST be revisited rather than silently introducing an externally managed proxy. + +### Use a small React and TypeScript frontend stack + +Build the browser client with React, TypeScript, and Vite. Use `@xyflow/react` for the read-only workflow and run canvases, CodeMirror 6 for the optional JSON input editor, and `@tanstack/react-virtual` for large run, log, event, and trace navigators. Enable React Flow's viewport culling for large DAGs. + +Keep application state in typed React reducers/hooks organized around the operator's replaceable catalog, run, and detail projections. Do not add Redux, a second client data model, or browser persistence. Network pagination and bounded detail hydration remain mandatory: component virtualization is not a substitute for avoiding eager transport and parsing. + +### Use ephemeral remote projections + +The operator is authoritative for workflow definitions, runs, details, and lifecycle transitions. The web client keeps only replaceable projections of operator responses and ordered updates; they are bounded rendering caches, not a client-owned source of truth. A reconnect or reset discards/rebuilds these projections from the authoritative baseline. + +``` +Operator state ── ordered updates ──► ephemeral browser projections + ├─ catalog / selected run cache + ├─ selection and inspector + ├─ viewport pan and zoom + └─ in-flight start/cancel request +``` + +Starting a run returns an identity but does not authorize the client to construct a local run record. Cancelling a run is likewise a request: both lifecycle displays reconcile only from operator updates. The browser persists neither run history nor artifact bodies; a catalog update cannot erase or morph a historical run projection. + +### Keep workflow input advanced and schema-blind + +The primary Run action submits no input. A secondary, visually subtle control reveals a raw JSON-object editor for users who already know the workflow's `BaseInput` contract. The editor is closed by default, publishes no browser state beyond its current draft, and sends parsed JSON unchanged through the existing start-run request. + +Discovery does not publish a Pydantic/JSON schema in v1. The editor provides syntax validation only; the operator remains authoritative for `BaseInput` validation and returns actionable errors. Workflow-level file/workspace controls and `BaseContext` editing are out of scope. + + +### Structure the explorer and canvases by view semantics + +The Explorer groups current workflows and retained runs under their configured scan target. Selecting a workflow opens a blueprint-styled current-definition canvas; selecting a run opens a distinct execution canvas from that run's topology snapshot. The canvases are read-only and preserve pan/zoom state only ephemerally. + +Workflow cards place agent input and output field lists inside their own bounds. DAG edges represent dependency, not individual field bindings: each source-target pair renders at most one arrow. Opening an agent node presents readable instructions first, with model, runtime, skills, and tools as supporting declaration metadata. + +Run cards retain the same structural edges but prioritize execution status, duration, and failure state. They do not reuse current agent field declarations, which could be incorrect for a historical run. + +### Retain bounded agent invocation inputs and outputs + +PredictRLM `run.started` evidence contains actual invocation inputs, but Avalanche currently projects only their field names. Preserve supported input values in that existing event, matching the terminal outputs already projected from `run.succeeded`. The run inspector reads both through existing agent-event and hydrated-trace detail paths and presents separate Inputs and Output views using current declaration metadata only as labels. + +This is agent-invocation evidence, not generic DAG-node value capture. Recursively project JSON-shaped values and declared model values into the ordinary `inputs` and `outputs` structures. At this projection boundary, encode an actual `predict_rlm.File` as a tagged JSON value containing its non-empty host path; lists and nested structures retain those tagged values in place. The browser's generic value renderer recognizes the tag and gives that value path-specific presentation. There is no parallel file-reference event or index. + +Unsupported or over-limit values are represented as unavailable and MUST NOT be silently converted with `str(...)` or cause an otherwise valid agent invocation to fail. The existing agent evidence observer, run-worker event queue, operator `AgentEvent` storage, detail pagination, and browser transport carry the projected JSON unchanged. Generic operator code does not inspect arbitrary `.path` attributes. The browser does not copy file contents, persist artifacts, validate path existence, or offer a download contract. + +### Decompose RunTrace into demand-loaded projections + +Preserve the user-visible semantics of PredictRLM's exportable `RunTrace` without transporting it as one monolithic JSON body. Store run-level trace fields as a lightweight header; expose lifecycle evidence through the existing paginated agent-event path; and retain each complete `IterationStep` as the detail body of its `iteration.recorded` event. + +Extend `AgentEventDescriptor` with the summary fields needed to build a navigator without reading its body: event kind and, for iteration events, iteration number, duration, error state, tool count, and predict count. `ListAgentEvents` pages these descriptors; the existing `ReadDetail` retrieves only a selected event/turn body. The complete turn body preserves reasoning, code, truncated and untruncated output, tool calls, predict-call groups/subcalls, LM finish metadata, and per-turn usage. + +The browser virtualizes descriptor rows and keeps a small bounded LRU of hydrated bodies. Following the live turn is the default; selecting another turn pauses following. Inputs and terminal outputs remain separate views. The web client does not call monolithic `ReadTrace`; migrate the TUI to the same descriptor/detail path so complete trace bodies are not duplicated solely for compatibility. + +## Risks / Trade-offs + +- Full catalog replacements make reload behavior simple and correct but transmit more data than diffs. Local workflow catalogs are expected to be small; a later scale constraint can justify an explicitly versioned diff protocol. +- Retained topology increases in-memory cost proportional to runs times DAG metadata. It intentionally excludes executable functions and full workflow objects, preserving process/serialization boundaries. +- Last-good catalog retention prevents a typing-error reload from making the UI empty, but it means the displayed catalog can be stale while diagnostics are active; the UI must make that state visible. +- A gRPC-Web adapter adds a runtime component and frontend build integration, but avoids a duplicate HTTP resource and event schema. diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/proposal.md b/openspec/changes/add-operator-web-ui-and-hot-reload/proposal.md new file mode 100644 index 0000000..4ed53a2 --- /dev/null +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/proposal.md @@ -0,0 +1,31 @@ +## Why + +The operator can rescan workflow source, but it does not expose catalog changes as live UI state and a run retains only node state, not the workflow topology it executed. A browser UI needs a current workflow view that reacts to reloads and a historically accurate run view that remains renderable after the workflow changes. + +## What Changes + +- Add an operator web UI with separate current-workflow and historical-run views, live state updates, and the operator control/observability surface already available to the TUI. +- Make workflow catalog reloads observable to clients so workflow creation, removal, metadata changes, and topology changes update the UI in real time. +- Persist an immutable workflow-topology snapshot with every run at run creation, including the topology and display metadata needed to render that run independently from the current catalog. +- Preserve existing runs across workflow reloads; reloads affect catalog/current-workflow views and future runs, never rewrite a run's recorded topology. +- Preserve bounded agent invocation inputs and outputs as structured evidence, including typed PredictRLM file values whose host paths receive file-specific presentation without copying or storing the files. +- Define browser-facing transport and asset-serving behavior while retaining the operator's local-first, loopback-default security posture. + +## Capabilities + +### New Capabilities +- `operator-web-ui`: Browser interface for observing and controlling a local operator, with distinct current-workflow and historical-run views. +- `operator-workflow-reload`: Atomically refresh the workflow catalog and publish client-visible catalog changes. +- `versioned-run-topology`: Retain and serve an immutable topology snapshot for each run so historical runs remain accurately renderable. + +### Modified Capabilities +- None. + +## Impact + +- `src/avalanche/agent/`: projection of declared PredictRLM file paths into existing agent evidence. +- `src/runtime/operator/`: workflow discovery/watch behavior, immutable catalog publication, run persistence models, update stream, gRPC protocol, and server hosting. +- `src/tui/`: shared domain models or protocol behavior may change; the Textual UI remains a separate presentation layer. +- `src/ava_cli/`: commands/options for launching or opening the web UI. +- New browser client source, frontend build/package integration, and tests. +- `pyproject.toml`, lockfile, packaging, and docs may need updates for the chosen browser transport and static assets. diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md new file mode 100644 index 0000000..d0d8c2f --- /dev/null +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md @@ -0,0 +1,146 @@ +## Purpose + +Provide a browser interface for a local operator that gives users live workflow observability and run control while preserving the distinction between current workflow definitions and historical executions. + +## ADDED Requirements + +### Requirement: Present current workflow state + +The web UI SHALL present a workflow view from the current operator catalog, including workflow metadata and its current graph topology. The view SHALL update when the operator publishes a catalog change. + +#### Scenario: Workflow topology changes while open +- **WHEN** the selected workflow's current catalog definition changes +- **THEN** the web UI updates that workflow view to the new topology and metadata without requiring a full page reload + +#### Scenario: Workflow becomes newly available +- **WHEN** the operator publishes a newly discovered workflow +- **THEN** the web UI makes that workflow available for selection in its current-workflow view + +### Requirement: Navigate scanned workflows and runs + +The web UI SHALL organize the Explorer by each configured scan target. Each target SHALL contain its discovered workflows, and each workflow SHALL contain its retained runs. Selecting a workflow SHALL open its current workflow view; selecting a run SHALL open that run's historical execution view. + +#### Scenario: Multiple scan targets contain workflows +- **WHEN** the operator is configured with multiple file or directory scan targets +- **THEN** the Explorer presents each target as a distinct root and groups workflows beneath their originating target + +#### Scenario: Explorer renders scan-target identity +- **WHEN** the operator publishes its configured scan targets +- **THEN** each Explorer root uses the target's normalized path and identifies whether it is a file or directory + +#### Scenario: User selects a run +- **WHEN** a user selects a retained run beneath a workflow +- **THEN** the web UI opens the run view without replacing it with the current workflow definition + +### Requirement: Inspect the current workflow on a read-only canvas + +The current workflow view SHALL present its DAG on a pannable, zoomable, read-only canvas. Agent-node cards SHALL show their declared input and output fields inside the card. Each graph dependency SHALL render as at most one arrow between its source and target cards, regardless of the number of fields supplied across that dependency. + +#### Scenario: Agent node has several fields from one parent +- **WHEN** several declared fields of an agent node are supplied by the same upstream node +- **THEN** the canvas renders one arrow between the two node cards and retains the field lists inside the target card + +#### Scenario: User inspects an agent declaration +- **WHEN** a user opens an agent node from the current workflow view +- **THEN** the UI presents its instructions in a readable format together with its model, runtime, skill, and tool metadata + +### Requirement: Present historical run state + +The web UI SHALL present a run view from the selected run's retained topology and execution data. It SHALL not render a run using the current workflow topology when the two differ. + +#### Scenario: Historical topology differs from current workflow +- **WHEN** a user opens a run whose recorded topology differs from the current workflow catalog +- **THEN** the run view displays the recorded topology and its node statuses, logs, and available details + +#### Scenario: Run node failed +- **WHEN** a run node fails with a retained error message +- **THEN** the run view displays its failed status, elapsed time, and bounded error message + +### Requirement: Inspect agent invocation inputs and outputs + +The run view SHALL present the retained input and terminal output fields for an agent invocation separately from its trace timeline. It SHALL associate values with their declared signature field names, types, and descriptions when declaration metadata is available. + +#### Scenario: Agent invocation has retained inputs +- **WHEN** a user opens a run node whose agent invocation contains retained input values +- **THEN** the run view presents those values by declared input field + +#### Scenario: Agent invocation succeeds with outputs +- **WHEN** an agent invocation publishes `run.succeeded` evidence with terminal outputs +- **THEN** the run view presents those values by declared output field + +#### Scenario: Agent field contains a PredictRLM file +- **WHEN** a retained agent input or output contains a `predict_rlm.File` with a non-empty host path +- **THEN** its ordinary field value is a structured, typed file value and the run view presents its path using file-specific formatting + +#### Scenario: PredictRLM file later changes or disappears +- **WHEN** a displayed host path becomes stale after the run +- **THEN** the web UI retains the reported value without copying, storing, downloading, or treating the browser as authoritative for the file + +#### Scenario: Agent value is unavailable +- **WHEN** an input or output cannot be safely represented within the bounded agent-detail contract +- **THEN** the run view identifies that field as unavailable rather than treating an arbitrary string conversion as its value + + +### Requirement: Inspect complete agent run traces on demand + +The run view SHALL make the retained exportable `RunTrace` information inspectable, including run-level status, models, iteration counts, duration, usage and telemetry metadata; every iteration's reasoning, code, outputs, finish metadata and usage; tool calls; predict subcalls; and lifecycle evidence. Inputs and terminal agent outputs SHALL remain separate views. + +#### Scenario: User selects a trace turn +- **WHEN** a user selects a trace turn +- **THEN** the reader presents that iteration's retained reasoning, code, truncated and available full output, tool call arguments/results/errors, grouped predict-call inputs/outputs/errors, finish metadata, duration, and usage + +#### Scenario: User selects an earlier live turn +- **WHEN** a user selects a completed earlier turn while an agent trace is live +- **THEN** the reader presents that turn and stops automatically following the latest turn + +#### Scenario: Agent trace reports an error +- **WHEN** a trace turn records an error +- **THEN** the navigator visibly identifies that turn as failed + +#### Scenario: Trace contains many large turns +- **WHEN** a user opens a large trace +- **THEN** the web UI pages and virtualizes lightweight turn summaries, fetches only selected detail bodies, and keeps a bounded detail cache rather than hydrating the complete trace + +### Requirement: Provide live operator observability + +The web UI SHALL receive ordered operator updates and reconcile its state when its update history is no longer available. It SHALL surface current run status and node state as updates arrive. + +#### Scenario: Update replay is unavailable +- **WHEN** the operator requires a client to reset its update stream +- **THEN** the web UI reloads an authoritative catalog and run baseline before resuming live updates + +### Requirement: Treat the operator as authoritative + +The web UI SHALL derive workflow, run, and detail state from operator responses and ordered updates. It MAY retain ephemeral selection, viewport, inspector, cache, and in-flight action state, but SHALL NOT persist a browser-side run history, artifact store, or authoritative lifecycle state. + +#### Scenario: Run creation is accepted +- **WHEN** a user starts a run and receives its run identity +- **THEN** the web UI treats the run as created only when it receives the operator's authoritative run state or reset baseline + +#### Scenario: Cancellation is requested +- **WHEN** a user requests cancellation of an active run +- **THEN** the web UI may show the request in flight and reconciles the run status from the operator rather than locally declaring it cancelled + +### Requirement: Provide operator run control + +The web UI SHALL allow a user to start a selected workflow run and cancel an active run using the same operator behavior exposed to other operator clients. Run input SHALL be an optional schema-blind JSON editor that is closed by default and does not require workflow discovery to publish a `BaseInput` schema. + +#### Scenario: User starts a run without opening input +- **WHEN** a user invokes the primary Run action while the JSON editor is closed +- **THEN** the web UI requests a run without a workflow input payload + +#### Scenario: User supplies known workflow input +- **WHEN** a user deliberately opens the input editor, enters a JSON object, and invokes Run +- **THEN** the web UI sends that object unchanged as workflow input and relies on authoritative operator validation + +#### Scenario: Operator rejects workflow input +- **WHEN** submitted JSON does not satisfy the workflow's `BaseInput` +- **THEN** the web UI displays the operator validation error without creating local run state + +### Requirement: Remain local-first by default + +The web UI listener SHALL default to loopback-only access. Enabling non-loopback access SHALL require an explicitly trusted and authenticated external boundary. + +#### Scenario: Default launch +- **WHEN** a user starts the operator web UI without an explicit listener host +- **THEN** the UI is reachable only through a loopback address diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-workflow-reload/spec.md b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-workflow-reload/spec.md new file mode 100644 index 0000000..a45d13a --- /dev/null +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-workflow-reload/spec.md @@ -0,0 +1,29 @@ +## Purpose + +Keep the operator's current workflow catalog synchronized with local source changes and make catalog revisions visible to connected user interfaces. + +## ADDED Requirements + +### Requirement: Atomically publish the current workflow catalog + +The operator SHALL replace the current workflow catalog only with one complete, valid discovery result. A catalog revision SHALL describe the current workflows, their topology, and their metadata without mixing information from different discovery results. + +#### Scenario: Source change creates a workflow +- **WHEN** a watched workflow source change yields a newly discoverable workflow +- **THEN** the current catalog includes that workflow and publishes a catalog change to connected clients + +#### Scenario: Source change changes workflow topology +- **WHEN** a watched workflow source change changes a workflow's nodes, edges, ordering, or display metadata +- **THEN** the current catalog exposes the new workflow definition and connected clients receive an update sufficient to refresh the workflow view + +#### Scenario: Discovery fails during reload +- **WHEN** a watched source change cannot produce a valid replacement catalog +- **THEN** the operator retains the last valid catalog and exposes the discovery diagnostic without publishing a partial catalog + +### Requirement: Isolate runs from later catalog revisions + +A catalog reload SHALL affect workflow selection and runs started after the reload. It SHALL NOT mutate the recorded definition or execution state of an existing run. + +#### Scenario: Reload while a run is active +- **WHEN** a workflow is reloaded while one of its runs is active +- **THEN** the active run continues against its recorded workflow definition and later workflow views show the reloaded definition diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md new file mode 100644 index 0000000..2d7fd47 --- /dev/null +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md @@ -0,0 +1,33 @@ +## Purpose + +Retain the exact workflow definition used by each run so operator clients can render historical execution independently from the workflow currently in the catalog. + +## ADDED Requirements + +### Requirement: Capture an immutable executed topology + +When the operator creates a run, it SHALL retain an immutable workflow topology snapshot derived from the workflow that was prepared for that run. The snapshot SHALL include node identity and ordering, graph edges, node types, and display metadata required to render the run's workflow graph. + +#### Scenario: Run begins from the current workflow +- **WHEN** a run is created for a workflow +- **THEN** the run has a topology snapshot matching the workflow definition actually prepared for that run + +### Requirement: Serve historical run topology + +Run detail retrieval SHALL return the run's retained topology snapshot together with its node execution state. It SHALL NOT substitute the topology of the currently discovered workflow. + +#### Scenario: Workflow changes after a completed run +- **WHEN** a completed run is viewed after its workflow has changed nodes or edges +- **THEN** the run view renders the nodes and edges from the run's retained snapshot and associates execution state only with those historical nodes + +#### Scenario: Workflow is removed after a run +- **WHEN** a workflow is no longer present in the current catalog but historical runs remain retained +- **THEN** each retained run remains retrievable and renderable using its topology snapshot + +### Requirement: Keep topology identity stable through updates + +All run updates and detail records SHALL be associated with the immutable run identity and its captured topology, rather than the latest catalog revision. + +#### Scenario: Active run receives node updates after a reload +- **WHEN** an active run publishes a node status, log, trace, or agent event after its workflow reloads + diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md b/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md new file mode 100644 index 0000000..9d141b7 --- /dev/null +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md @@ -0,0 +1,42 @@ +## 1. Versioned run topology + +- [ ] 1.1 Add an immutable executed-topology model and retain it from the run worker's prepared workflow metadata when creating a run. +- [ ] 1.2 Include the retained topology in in-memory structural snapshots and the operator protocol without materializing workflow objects across process boundaries. +- [ ] 1.3 Update transport conversion and clients to hydrate a run from its topology snapshot plus execution state. +- [ ] 1.4 Add regression coverage proving a completed and active run remain renderable after nodes or edges change and after the workflow is removed. +- [ ] 1.5 Preserve bounded structured agent invocation inputs and terminal outputs in existing evidence, encode nested PredictRLM `File` values as tagged paths, and verify input, output, list, unsupported, over-limit, and worker-to-operator behavior. +- [ ] 1.6 Retain bounded worker-provided node failure messages in node state, snapshots, live updates, protocol conversion, and run inspection with focused regression coverage. +- [ ] 1.7 Decompose exportable `RunTrace` into a lightweight header, paginated rich event/turn descriptors, and complete on-demand `IterationStep` bodies; migrate TUI hydration away from monolithic `ReadTrace` and verify semantic coverage and bounded reads. + +## 2. Atomic catalog reload and live updates + +- [ ] 2.1 Change discovery refresh to validate a candidate catalog, retain the last valid catalog on failure, and expose reload diagnostics. +- [ ] 2.2 Add typed scan-target catalog metadata with alias, normalized target path, and file/directory kind to initial reads, live replacements, reset baselines, protocol conversion, and clients. +- [ ] 2.3 Add a monotonic catalog revision and a full catalog-update event emitted after each successful replacement. +- [ ] 2.4 Replace the run-only update stream/envelope with an operator-update stream that carries run updates, catalog revisions, and reset notices; regenerate protobuf bindings. +- [ ] 2.5 Migrate the Python operator client and TUI provider to the new stream and authoritative reset baseline behavior. +- [ ] 2.6 Add focused operator and client tests for scan-target grouping and created, changed, removed, failed, replayed, and reset catalog states. + +## 3. gRPC-Web delivery + +- [ ] 3.1 Add an optional loopback-default browser listener within the operator process that serves compiled web assets and adapts gRPC-Web unary and server-streaming calls to the shared authoritative `Operator` instance without a required sidecar. +- [ ] 3.2 Add the React, TypeScript, and Vite frontend build; generated TypeScript stubs from `operator.proto`; `@xyflow/react`, CodeMirror 6, and `@tanstack/react-virtual`; package data; and development/production asset-loading paths. +- [ ] 3.3 Add `ava` command and operator configuration support for launching and reporting the local web UI endpoint without weakening non-loopback safeguards. +- [ ] 3.4 Add integration coverage for browser-compatible unary calls, live stream delivery, loopback binding, and static asset serving. + +## 4. Web UI + +- [ ] 4.1 Implement ephemeral catalog and run projections from authoritative operator updates, with stream reconnection, reset reconciliation, and non-authoritative start/cancel request state. +- [ ] 4.2 Implement the scan-target Explorer with workflow/run hierarchy and workflow-versus-run navigation. +- [ ] 4.3 Implement the current-workflow blueprint canvas with pan/zoom, one dependency arrow per source-target pair, agent field lists inside cards, and declaration inspection. +- [ ] 4.4 Implement the historical-run canvas with its topology snapshot, execution-focused node cards, status, duration, failure, logs, and a visible distinction from current workflow state. +- [ ] 4.5 Implement virtualized, paginated `RunTrace` inspection with header metadata, chronological turn summaries, selected complete turn details, live following, errors, and a bounded LRU detail cache. +- [ ] 4.6 Implement separate agent Inputs and Output views using retained invocation evidence and declaration field metadata. +- [ ] 4.7 Render tagged PredictRLM file values within ordinary agent Inputs and Output views using path-specific presentation without copying, storing, or validating files. +- [ ] 4.8 Implement run start with a closed-by-default schema-blind JSON-object editor, authoritative validation errors, and active-run cancellation using generated gRPC-Web clients. +- [ ] 4.9 Add browser-level tests covering Explorer navigation, current workflow rendering, a live reload, a historical topology mismatch, complete demand-loaded trace inspection, bounded hydration/cache behavior, agent inputs and outputs, file path values, stream reset recovery, default no-input run start, optional JSON input, validation errors, and cancellation. + +## 5. Verification and documentation + +- [ ] 5.1 Run focused operator, protocol, TUI-client, adapter, and browser test suites; add an end-to-end local operator reload scenario. +- [ ] 5.2 Update local development and operator documentation with web UI launch, loopback exposure, reload semantics, and the distinction between workflow and run views. diff --git a/openspec/config.yaml b/openspec/config.yaml new file mode 100644 index 0000000..c4d34ac --- /dev/null +++ b/openspec/config.yaml @@ -0,0 +1,32 @@ +schema: spec-driven + +# Project context (optional) +# This is shown to AI when creating artifacts. +# Add your tech stack, conventions, style guides, domain knowledge, etc. +# Example: +# context: | +# Tech stack: TypeScript, React, Node.js +# We use conventional commits +# Domain: e-commerce platform + +# Per-artifact rules (optional) +# Add custom rules for specific artifacts. +# Example: +# rules: +# proposal: +# - Keep proposals under 500 words +# - Always include a "Non-goals" section +# tasks: +# - Break tasks into chunks of max 2 hours + +# Per-operation guidance (optional) +# Add advisory guidance for how apply and archive work should be conducted. +# This is separate from artifact rules above. +# Example: +# operations: +# apply: +# guidance: +# - Keep test summaries concise +# archive: +# guidance: +# - Summarize the archive outcome before finishing From 0de3be912a807ac2b29b873efecabb9327d93105 Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Fri, 31 Jul 2026 18:50:10 +0000 Subject: [PATCH 02/25] feat(operator): retain historical run topology and agent details --- src/avalanche/agent/agent_step.py | 71 ++++++++- src/runtime/operator/client.py | 55 ++++++- src/runtime/operator/convert.py | 64 +++++++-- src/runtime/operator/models.py | 44 +++++- src/runtime/operator/operator.py | 78 +++++++++- src/runtime/operator/proto/operator.proto | 17 +++ src/runtime/operator/proto/operator_pb2.py | 136 ++++++++++-------- src/runtime/operator/proto/operator_pb2.pyi | 73 ++++++++-- test/agent/agent_step_test.py | 35 ++++- test/operator_tests/test_operator.py | 64 +++++++-- test/operator_tests/test_protocol_contract.py | 24 ++++ 11 files changed, 554 insertions(+), 107 deletions(-) diff --git a/src/avalanche/agent/agent_step.py b/src/avalanche/agent/agent_step.py index 033eb5b..39f77b9 100644 --- a/src/avalanche/agent/agent_step.py +++ b/src/avalanche/agent/agent_step.py @@ -12,7 +12,9 @@ from enum import Enum from functools import update_wrapper from pathlib import Path -from typing import Any, Callable, Mapping, Sequence, Union, get_args, get_origin +from typing import Any, Callable, Mapping, Sequence, TypeAlias, Union, get_args, get_origin + +from pydantic import BaseModel from .._agent_evidence import AgentInvocationId, emit_agent_evidence from ..dag import Node, NodeType @@ -92,6 +94,62 @@ def _emit_sink_evidence( raise +JsonValue: TypeAlias = ( + str | int | float | bool | None | list["JsonValue"] | dict[str, "JsonValue"] +) +_MAX_EVIDENCE_VALUE_BYTES = 4 * 1024 * 1024 +_MAX_EVIDENCE_COLLECTION_ITEMS = 10_000 +_MAX_EVIDENCE_DEPTH = 32 + + +def _unavailable_value(reason: str) -> dict[str, JsonValue]: + return {"kind": "unavailable", "reason": reason} + + +def _project_agent_value(value: object, *, depth: int = 0) -> JsonValue: + if depth > _MAX_EVIDENCE_DEPTH: + return _unavailable_value("maximum nesting depth exceeded") + if value is None or isinstance(value, (str, bool, int)): + return value + if isinstance(value, float): + return value if math.isfinite(value) else _unavailable_value("non-finite number") + + try: + import predict_rlm + except ImportError: + predict_rlm = None + if predict_rlm is not None and isinstance(value, predict_rlm.File): + path = value.path + if isinstance(path, str) and path: + return {"kind": "predict_rlm_file", "path": path} + return _unavailable_value("PredictRLM file has no host path") + + if isinstance(value, BaseModel): + value = value.model_dump(mode="python") + if isinstance(value, Mapping): + if len(value) > _MAX_EVIDENCE_COLLECTION_ITEMS: + return _unavailable_value("mapping exceeds item limit") + projected: dict[str, JsonValue] = {} + for key, item in value.items(): + if not isinstance(key, str): + return _unavailable_value("mapping keys must be strings") + projected[key] = _project_agent_value(item, depth=depth + 1) + return projected + if isinstance(value, (list, tuple)): + if len(value) > _MAX_EVIDENCE_COLLECTION_ITEMS: + return _unavailable_value("sequence exceeds item limit") + return [_project_agent_value(item, depth=depth + 1) for item in value] + return _unavailable_value(f"unsupported value type: {type(value).__name__}") + + +def _bounded_agent_value(value: object) -> JsonValue: + projected = _project_agent_value(value) + encoded = json.dumps(projected, separators=(",", ":")).encode() + if len(encoded) > _MAX_EVIDENCE_VALUE_BYTES: + return _unavailable_value("value exceeds byte limit") + return projected + + def _project_evidence_event( event: Any, *, @@ -105,13 +163,16 @@ def _project_evidence_event( if event_kind == "run.started": inputs = data.get("inputs") - projected["input_fields"] = sorted(inputs) if isinstance(inputs, Mapping) else [] + projected_inputs = _bounded_agent_value(inputs) if isinstance(inputs, Mapping) else {} + projected = { + "input_fields": sorted(inputs) if isinstance(inputs, Mapping) else [], + "inputs": projected_inputs, + } elif event_kind == "iteration.recorded": step = data.get("step") step = step if isinstance(step, Mapping) else {} projected = { "iteration": step.get("iteration"), - "reasoning": step.get("reasoning"), "duration_ms": step.get("duration_ms"), "error": step.get("error"), "tool_count": len(step.get("tool_calls") or []), @@ -120,6 +181,7 @@ def _project_evidence_event( for group in (step.get("predict_calls") or []) if isinstance(group, Mapping) ), + "step": _bounded_agent_value(step), } elif event_kind == "predict.started": projected = { @@ -149,7 +211,8 @@ def _project_evidence_event( } elif event_kind == "run.succeeded": projected = { - key: data.get(key) for key in ("status", "outputs") if data.get(key) is not None + "status": data.get("status"), + "outputs": _bounded_agent_value(data.get("outputs", {})), } elif event_kind in {"run.failed", "run.cancelled"}: projected = { diff --git a/src/runtime/operator/client.py b/src/runtime/operator/client.py index 2fc887c..611f87b 100644 --- a/src/runtime/operator/client.py +++ b/src/runtime/operator/client.py @@ -747,6 +747,12 @@ def _read_agent_event_pages( event_sequence=descriptor.event_sequence, event_json=event_json, size_bytes=descriptor.size_bytes, + event_kind=descriptor.event_kind, + iteration=descriptor.iteration, + duration_ms=descriptor.duration_ms, + error=descriptor.error, + tool_count=descriptor.tool_count, + predict_count=descriptor.predict_count, ) ) cursor = descriptor.event_sequence @@ -1717,6 +1723,12 @@ def _apply_update_envelope( descriptor.body_token, descriptor.size_bytes, ).decode(), + event_kind=descriptor.event_kind, + iteration=descriptor.iteration, + duration_ms=descriptor.duration_ms, + error=descriptor.error, + tool_count=descriptor.tool_count, + predict_count=descriptor.predict_count, size_bytes=descriptor.size_bytes, ) with self._state_lock: @@ -1797,6 +1809,7 @@ def _apply_update_envelope_locked( node.status = change.status node.started_at = change.started_at node.ended_at = change.ended_at + node.error = change.error node.revision = change.revision run.nodes = dict(current.nodes) run.nodes[change.node_id] = node @@ -2053,6 +2066,7 @@ def _run_from_created(operator_instance_id: str, created: RunCreated) -> RunStat triggered_by=summary.triggered_by, workflow_id=summary.workflow_id, workflow_display_name=summary.workflow_display_name, + topology=created.topology, operator_instance_id=operator_instance_id, created_sequence=summary.created_sequence, revision=summary.revision, @@ -2066,6 +2080,7 @@ def _run_from_created(operator_instance_id: str, created: RunCreated) -> RunStat status=item.status, started_at=item.started_at, ended_at=item.ended_at, + error=item.error, trace=item.trace, revision=item.revision, event_page_token=item.event_page_token, @@ -2079,7 +2094,11 @@ def _run_from_snapshot(snapshot: RunSnapshot) -> RunState: """Materialize the authoritative structural baseline used by the reducer.""" run = _run_from_created( snapshot.operator_instance_id, - RunCreated(summary=snapshot.summary, nodes=snapshot.nodes), + RunCreated( + summary=snapshot.summary, + nodes=snapshot.nodes, + topology=snapshot.topology, + ), ) run.latest_log_sequence = snapshot.latest_log_sequence run.details_hydrated = False @@ -2124,17 +2143,43 @@ def _materialize_agent_trace_json( status: str, trace_body: dict[str, Any] | None, ) -> str: + reconstructed = deepcopy(trace_body) if trace_body is not None else None + if reconstructed is not None: + steps = [] + evidence_events = [] + for event in events: + if not isinstance(event, dict): + continue + event_kind = event.get("event_kind") + data = event.get("data") + if event_kind == "iteration.recorded" and isinstance(data, dict): + step = data.get("step") + if isinstance(step, dict): + steps.append(step) + evidence_events.append( + { + "sequence": event.get("sequence"), + "kind": event_kind, + "timestamp_ns": event.get("timestamp_ns"), + "data": data if isinstance(data, dict) else {}, + } + ) + reconstructed["steps"] = steps + evidence = reconstructed.get("evidence") + if isinstance(evidence, dict): + evidence["events"] = evidence_events + envelope: dict[str, Any] = { "schema_version": 1, "status": status, "run_id": None, "events": events, - "trace": trace_body, + "trace": reconstructed, "error": None, } - if trace_body is not None: - envelope["status"] = str(trace_body.get("status") or status) - evidence = trace_body.get("evidence") + if reconstructed is not None: + envelope["status"] = str(reconstructed.get("status") or status) + evidence = reconstructed.get("evidence") if isinstance(evidence, dict): envelope["run_id"] = evidence.get("run_id") return json.dumps(envelope, default=str) diff --git a/src/runtime/operator/convert.py b/src/runtime/operator/convert.py index 66b2e0b..b6f7386 100644 --- a/src/runtime/operator/convert.py +++ b/src/runtime/operator/convert.py @@ -25,6 +25,7 @@ TraceFinalized, WorkflowDiscoveryDiagnostic, WorkflowInfo, + WorkflowTopology, ) from .proto import operator_pb2 as pb @@ -105,6 +106,25 @@ def discovery_diagnostic_from_proto( ) +def workflow_topology_to_proto(topology: WorkflowTopology) -> pb.WorkflowTopologyMsg: + return pb.WorkflowTopologyMsg( + node_ids=topology.node_ids, + graph={parent: pb.NodeEdges(children=children) for parent, children in topology.graph}, + node_types=dict(topology.node_types), + display_names=dict(topology.display_names), + ) + + +def workflow_topology_from_proto(msg: pb.WorkflowTopologyMsg) -> WorkflowTopology: + node_ids = tuple(msg.node_ids) + return WorkflowTopology( + node_ids=node_ids, + graph=tuple((node_id, tuple(msg.graph[node_id].children)) for node_id in node_ids), + node_types=tuple((node_id, msg.node_types[node_id]) for node_id in node_ids), + display_names=tuple((node_id, msg.display_names[node_id]) for node_id in node_ids), + ) + + def trace_descriptor_to_proto(descriptor: TraceDescriptor) -> pb.TraceDescriptorMsg: return pb.TraceDescriptorMsg( status=descriptor.status, @@ -142,6 +162,8 @@ def node_snapshot_to_proto(node: NodeSnapshot) -> pb.NodeSnapshotMsg: if node.trace is not None: message.trace.CopyFrom(trace_descriptor_to_proto(node.trace)) message.event_page_token = node.event_page_token + if node.error is not None: + message.error = node.error return message @@ -153,6 +175,7 @@ def node_snapshot_from_proto(msg: pb.NodeSnapshotMsg) -> NodeSnapshot: status=NodeStatus(msg.status), started_at=msg.started_at if msg.started_at else None, ended_at=msg.ended_at if msg.ended_at else None, + error=msg.error if msg.HasField("error") else None, trace=trace_descriptor_from_proto(msg.trace) if msg.HasField("trace") else None, revision=msg.revision, event_page_token=msg.event_page_token, @@ -197,6 +220,7 @@ def run_snapshot_to_proto(snapshot: RunSnapshot) -> pb.RunSnapshotMsg: nodes=[node_snapshot_to_proto(node) for node in snapshot.nodes], latest_log_sequence=snapshot.latest_log_sequence, log_page_token=snapshot.log_page_token, + topology=workflow_topology_to_proto(snapshot.topology), ) @@ -208,6 +232,7 @@ def run_snapshot_from_proto(msg: pb.RunSnapshotMsg) -> RunSnapshot: nodes=tuple(node_snapshot_from_proto(node) for node in msg.nodes), latest_log_sequence=msg.latest_log_sequence, log_page_token=msg.log_page_token, + topology=workflow_topology_from_proto(msg.topology), ) @@ -242,12 +267,21 @@ def log_record_descriptor_from_proto( def agent_event_descriptor_to_proto( event: AgentEventDescriptor, ) -> pb.AgentEventDescriptorMsg: - return pb.AgentEventDescriptorMsg( + message = pb.AgentEventDescriptorMsg( invocation_id=event.invocation_id, event_sequence=event.event_sequence, size_bytes=event.size_bytes, body_token=event.body_token, + event_kind=event.event_kind, + error=event.error, + tool_count=event.tool_count, + predict_count=event.predict_count, ) + if event.iteration is not None: + message.iteration = event.iteration + if event.duration_ms is not None: + message.duration_ms = event.duration_ms + return message def agent_event_descriptor_from_proto( @@ -258,6 +292,12 @@ def agent_event_descriptor_from_proto( event_sequence=msg.event_sequence, size_bytes=msg.size_bytes, body_token=msg.body_token, + event_kind=msg.event_kind, + iteration=msg.iteration if msg.HasField("iteration") else None, + duration_ms=msg.duration_ms if msg.HasField("duration_ms") else None, + error=msg.error, + tool_count=msg.tool_count, + predict_count=msg.predict_count, ) @@ -269,6 +309,7 @@ def run_update_to_proto(update: RunUpdate) -> pb.RunUpdate: pb.RunCreated( summary=run_summary_to_proto(change.summary), nodes=[node_snapshot_to_proto(node) for node in change.nodes], + topology=workflow_topology_to_proto(change.topology), ) ) elif isinstance(change, RunStatusChanged): @@ -282,16 +323,17 @@ def run_update_to_proto(update: RunUpdate) -> pb.RunUpdate: ) ) elif isinstance(change, NodeStatusChanged): - message.node_status_changed.CopyFrom( - pb.NodeStatusChanged( - run_id=change.run_id, - node_id=change.node_id, - status=change.status.value, - started_at=change.started_at or 0.0, - ended_at=change.ended_at or 0.0, - revision=change.revision, - ) + changed = pb.NodeStatusChanged( + run_id=change.run_id, + node_id=change.node_id, + status=change.status.value, + started_at=change.started_at or 0.0, + ended_at=change.ended_at or 0.0, + revision=change.revision, ) + if change.error is not None: + changed.error = change.error + message.node_status_changed.CopyFrom(changed) elif isinstance(change, LogAppended): message.log_appended.CopyFrom( pb.LogAppended( @@ -326,6 +368,7 @@ def run_update_from_proto(msg: pb.RunUpdate) -> RunUpdate: change = RunCreated( summary=run_summary_from_proto(msg.run_created.summary), nodes=tuple(node_snapshot_from_proto(node) for node in msg.run_created.nodes), + topology=workflow_topology_from_proto(msg.run_created.topology), ) elif change_name == "run_status_changed": item = msg.run_status_changed @@ -344,6 +387,7 @@ def run_update_from_proto(msg: pb.RunUpdate) -> RunUpdate: status=NodeStatus(item.status), started_at=item.started_at if item.started_at else None, ended_at=item.ended_at if item.ended_at else None, + error=item.error if item.HasField("error") else None, revision=item.revision, ) elif change_name == "log_appended": diff --git a/src/runtime/operator/models.py b/src/runtime/operator/models.py index 7eae2c1..4400f08 100644 --- a/src/runtime/operator/models.py +++ b/src/runtime/operator/models.py @@ -41,6 +41,16 @@ class LogEntry: message: str +@dataclass(frozen=True) +class WorkflowTopology: + """Immutable rendering metadata captured from one prepared workflow.""" + + node_ids: tuple[str, ...] = () + graph: tuple[tuple[str, tuple[str, ...]], ...] = () + node_types: tuple[tuple[str, str], ...] = () + display_names: tuple[tuple[str, str], ...] = () + + @dataclass class NodeState: node_id: str @@ -49,6 +59,7 @@ class NodeState: status: NodeStatus = NodeStatus.PENDING started_at: float | None = None ended_at: float | None = None + error: str | None = None agent_trace_json: str | None = None trace: TraceDescriptor | None = None revision: int = 0 @@ -74,6 +85,7 @@ class RunState: triggered_by: str = "manual" # "manual" | "scheduled" workflow_id: str = "" workflow_display_name: str = "" + topology: WorkflowTopology = field(default_factory=WorkflowTopology) operator_instance_id: str = "" created_sequence: int = 0 revision: int = 0 @@ -123,6 +135,7 @@ class NodeSnapshot: status: NodeStatus = NodeStatus.PENDING started_at: float | None = None ended_at: float | None = None + error: str | None = None trace: TraceDescriptor | None = None revision: int = 0 event_page_token: str = "" @@ -154,6 +167,7 @@ class RunSnapshot: nodes: tuple[NodeSnapshot, ...] = () latest_log_sequence: int = 0 log_page_token: str = "" + topology: WorkflowTopology = field(default_factory=WorkflowTopology) @dataclass(frozen=True) @@ -173,6 +187,12 @@ class AgentEvent: event_sequence: int event_json: str size_bytes: int = 0 + event_kind: str = "" + iteration: int | None = None + duration_ms: int | None = None + error: bool = False + tool_count: int = 0 + predict_count: int = 0 @dataclass(frozen=True) @@ -216,12 +236,18 @@ class LogRecordDescriptor: @dataclass(frozen=True) class AgentEventDescriptor: - """Bounded identity and availability metadata for an agent event body.""" + """Bounded identity, summary, and availability metadata for an agent event body.""" invocation_id: str event_sequence: int size_bytes: int body_token: str + event_kind: str = "" + iteration: int | None = None + duration_ms: int | None = None + error: bool = False + tool_count: int = 0 + predict_count: int = 0 @dataclass(frozen=True) @@ -264,10 +290,25 @@ class FinalizedTrace: data: bytes +@dataclass(frozen=True) +class TraceHeader: + """RunTrace metadata retained separately from iteration and evidence bodies.""" + + status: str + model: str + sub_model: str | None + iterations: int + max_iterations: int + duration_ms: int + usage_json: str + telemetry_json: str | None = None + + @dataclass(frozen=True) class RunCreated: summary: RunSummary nodes: tuple[NodeSnapshot, ...] = () + topology: WorkflowTopology = field(default_factory=WorkflowTopology) @dataclass(frozen=True) @@ -286,6 +327,7 @@ class NodeStatusChanged: status: NodeStatus started_at: float | None = None ended_at: float | None = None + error: str | None = None revision: int = 0 diff --git a/src/runtime/operator/operator.py b/src/runtime/operator/operator.py index 04eaf6c..115689e 100644 --- a/src/runtime/operator/operator.py +++ b/src/runtime/operator/operator.py @@ -58,6 +58,7 @@ TraceDescriptor, TraceFinalized, WorkflowInfo, + WorkflowTopology, ) from .registry import AmbiguousWorkflow, WorkflowRegistry from .result_store import ( @@ -690,6 +691,7 @@ def _run_snapshot_locked( status=node.status, started_at=node.started_at, ended_at=node.ended_at, + error=node.error, trace=self._trace_descriptors.get((run.run_id, node.node_id)), revision=self._node_revisions.get( (run.run_id, node.node_id), @@ -718,6 +720,7 @@ def _run_snapshot_locked( run_id=run.run_id, through_sequence=latest_log_sequence, ), + topology=run.topology, ) def _current_log_page_token_locked(self, run_id: str) -> dict[str, Any]: @@ -811,6 +814,12 @@ def _agent_event_descriptor_locked( node_id=node_id, sequence=item.event_sequence, ), + event_kind=item.event_kind, + iteration=item.iteration, + duration_ms=item.duration_ms, + error=item.error, + tool_count=item.tool_count, + predict_count=item.predict_count, ) def _capture_run_detail_locked(self, run: RunState) -> _RunDetailCapture: @@ -1369,15 +1378,29 @@ def _run_from_prepared( prepared: dict[str, Any], ) -> RunState: display_name = prepared.get("display_name") or catalog_display_name + node_ids = tuple(prepared["node_ids"]) + topology = WorkflowTopology( + node_ids=node_ids, + graph=tuple( + (node_id, tuple(prepared["graph"].get(node_id, ()))) for node_id in node_ids + ), + node_types=tuple( + (node_id, prepared["node_types"][node_id]) for node_id in node_ids + ), + display_names=tuple( + (node_id, prepared["display_names"][node_id]) for node_id in node_ids + ), + ) run = RunState( run_id=run_id, flow_name=display_name, workflow_id=workflow_id, workflow_display_name=display_name, + topology=topology, status=RunStatus.PENDING, triggered_by=triggered_by, ) - for node_id in prepared["node_ids"]: + for node_id in node_ids: run.nodes[node_id] = NodeState( node_id=node_id, name=prepared["display_names"][node_id], @@ -1539,6 +1562,7 @@ def _apply_event( node.started_at = event["timestamp"] else: node.ended_at = event["timestamp"] + node.error = event["error"] if status == NodeStatus.FAILED else None changed_node_ids = (node.node_id,) status_node_ids = changed_node_ids mutated = True @@ -1722,11 +1746,21 @@ def _record_agent_evidence_event_locked( raise _CoordinatorProtocolError( f"agent event exceeds {self._max_agent_event_bytes} byte limit" ) + iteration = data.get("iteration") + duration_ms = data.get("duration_ms") + tool_count = data.get("tool_count") + predict_count = data.get("predict_count") projected_agent_event = AgentEvent( invocation_id=invocation_id, event_sequence=len(projected_events) + 1, event_json=event_json, size_bytes=event_size, + event_kind=event_kind, + iteration=iteration if isinstance(iteration, int) else None, + duration_ms=duration_ms if isinstance(duration_ms, int) else None, + error=bool(data.get("error")), + tool_count=tool_count if isinstance(tool_count, int) else 0, + predict_count=predict_count if isinstance(predict_count, int) else 0, ) detail = [] if data.get("iteration") is not None: @@ -1754,14 +1788,24 @@ def _record_agent_evidence_event_locked( if not isinstance(trace, dict): return None _validate_agent_detail_depth(trace) + trace_header = { + name: value + for name, value in trace.items() + if name not in {"steps", "evidence"} + } + evidence = trace.get("evidence") + if isinstance(evidence, dict): + trace_header["evidence"] = { + name: value for name, value in evidence.items() if name != "events" + } finalized_trace = json.dumps( - trace, + trace_header, default=str, separators=(",", ":"), ).encode() if len(finalized_trace) > self._max_trace_body_bytes: raise _CoordinatorProtocolError( - f"agent trace exceeds {self._max_trace_body_bytes} byte limit" + f"agent trace header exceeds {self._max_trace_body_bytes} byte limit" ) versions = self._trace_bodies.get(key, {}) if ( @@ -1772,7 +1816,6 @@ def _record_agent_evidence_event_locked( return None status = str(trace.get("status") or "unavailable")[:80] error = None - evidence = trace.get("evidence") descriptor = TraceDescriptor( status=status, revision=previous_descriptor.revision, @@ -2062,7 +2105,9 @@ def _publish_run_locked( summary=summary, as_of_sequence=publication_sequence, ) - changes.append(RunCreated(summary=summary, nodes=snapshot.nodes)) + changes.append( + RunCreated(summary=summary, nodes=snapshot.nodes, topology=snapshot.topology) + ) else: if summary_changed: changes.append( @@ -2084,6 +2129,7 @@ def _publish_run_locked( started_at=node.started_at, ended_at=node.ended_at, revision=publication_sequence, + error=node.error, ) ) if log_entry is not None: @@ -2418,6 +2464,28 @@ def _materialize_run_detail(capture: _RunDetailCapture) -> RunState: decoded = None if isinstance(decoded, dict): trace = decoded + steps = [] + evidence_events = [] + for projected in projected_events: + data = projected.get("data") + if ( + projected.get("event_kind") == "iteration.recorded" + and isinstance(data, dict) + and isinstance(data.get("step"), dict) + ): + steps.append(data["step"]) + evidence_events.append( + { + "sequence": projected.get("sequence"), + "kind": projected.get("event_kind"), + "timestamp_ns": projected.get("timestamp_ns"), + "data": data if isinstance(data, dict) else {}, + } + ) + trace["steps"] = steps + evidence = trace.get("evidence") + if isinstance(evidence, dict): + evidence["events"] = evidence_events envelope = { "schema_version": 1, "invocation_id": capture.trace_invocation_ids.get(node_id) or None, diff --git a/src/runtime/operator/proto/operator.proto b/src/runtime/operator/proto/operator.proto index 02602f1..a259ebb 100644 --- a/src/runtime/operator/proto/operator.proto +++ b/src/runtime/operator/proto/operator.proto @@ -109,6 +109,13 @@ message NodeEdges { repeated string children = 1; } +message WorkflowTopologyMsg { + repeated string node_ids = 1; + map graph = 2; + map node_types = 3; + map display_names = 4; +} + message FlowInfoMsg { string name = 1; string file_path = 2; @@ -188,6 +195,7 @@ message NodeSnapshotMsg { TraceDescriptorMsg trace = 7; uint64 revision = 8; string event_page_token = 9; + optional string error = 10; } message RunSnapshotMsg { @@ -197,6 +205,7 @@ message RunSnapshotMsg { repeated NodeSnapshotMsg nodes = 4; uint64 latest_log_sequence = 5; string log_page_token = 6; + WorkflowTopologyMsg topology = 7; } message RunSummaryPage { @@ -227,6 +236,12 @@ message AgentEventDescriptorMsg { uint64 size_bytes = 2; string body_token = 3; string invocation_id = 4; + string event_kind = 5; + optional uint32 iteration = 6; + optional uint64 duration_ms = 7; + bool error = 8; + uint32 tool_count = 9; + uint32 predict_count = 10; } message AgentEventPage { @@ -254,6 +269,7 @@ message DetailChunk { message RunCreated { RunSummaryMsg summary = 1; repeated NodeSnapshotMsg nodes = 2; + WorkflowTopologyMsg topology = 3; } message RunStatusChanged { @@ -271,6 +287,7 @@ message NodeStatusChanged { double started_at = 4; double ended_at = 5; uint64 revision = 6; + optional string error = 7; } message LogAppended { diff --git a/src/runtime/operator/proto/operator_pb2.py b/src/runtime/operator/proto/operator_pb2.py index fb0c1b7..5274eb6 100644 --- a/src/runtime/operator/proto/operator_pb2.py +++ b/src/runtime/operator/proto/operator_pb2.py @@ -24,13 +24,19 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eoperator.proto\x12\x12\x61valanche.operator\"\x07\n\x05\x45mpty\"\xb2\x01\n\x0fStartRunRequest\x12\x11\n\tflow_name\x18\x01 \x01(\t\x12\x12\n\ninput_json\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_json\x18\x03 \x01(\t\x12\x37\n\x0binput_files\x18\x04 \x03(\x0b\x32\".avalanche.operator.FileAttachment\x12\x0e\n\x06run_id\x18\x06 \x01(\t\x12\x19\n\x11workflow_selector\x18\x07 \x01(\t\"i\n\x0e\x46ileAttachment\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x04 \x01(\t\x12\x0e\n\x06sha256\x18\x05 \x01(\t\"\"\n\x10StartRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\"\n\x10\x43\x61ncelRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"[\n\x17ListRunSummariesRequest\x12\x19\n\x11workflow_selector\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x12\n\npage_token\x18\x03 \x01(\t\"]\n\x15GetRunSnapshotRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x1c\n\x14operator_instance_id\x18\x02 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x03 \x01(\x04\"P\n\x0fListLogsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"]\n\x16ListAgentEventsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x1c\n\x14\x61\x66ter_event_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"c\n\x10ReadTraceRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x1c\n\x14operator_instance_id\x18\x04 \x01(\t\"\'\n\x11ReadDetailRequest\x12\x12\n\nbody_token\x18\x01 \x01(\t\"O\n\x17StreamRunUpdatesRequest\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\"\x1d\n\tNodeEdges\x12\x10\n\x08\x63hildren\x18\x01 \x03(\t\"\xcd\x06\n\x0b\x46lowInfoMsg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x10\n\x08node_ids\x18\x03 \x03(\t\x12\x39\n\x05graph\x18\x04 \x03(\x0b\x32*.avalanche.operator.FlowInfoMsg.GraphEntry\x12\x42\n\nnode_types\x18\x05 \x03(\x0b\x32..avalanche.operator.FlowInfoMsg.NodeTypesEntry\x12H\n\rdisplay_names\x18\x06 \x03(\x0b\x32\x31.avalanche.operator.FlowInfoMsg.DisplayNamesEntry\x12\x0c\n\x04\x63ron\x18\x07 \x01(\t\x12\x13\n\x0bnext_run_at\x18\x08 \x01(\x01\x12\x13\n\x0blast_run_at\x18\t \x01(\x01\x12\x13\n\x0bworkflow_id\x18\n \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x12\x12\n\nroot_alias\x18\x0c \x01(\t\x12\x15\n\rrelative_file\x18\r \x01(\t\x12\x16\n\x0e\x62uilder_symbol\x18\x0e \x01(\t\x12\x16\n\x0e\x61gent_node_ids\x18\x0f \x03(\t\x12S\n\x13\x61gent_metadata_json\x18\x10 \x03(\x0b\x32\x36.avalanche.operator.FlowInfoMsg.AgentMetadataJsonEntry\x12\x14\n\x0cwebhook_path\x18\x11 \x01(\t\x12\x13\n\x0bwebhook_url\x18\x12 \x01(\t\x12\x16\n\x0ewebhook_active\x18\x13 \x01(\x08\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"{\n\x08\x46lowList\x12.\n\x05\x66lows\x18\x01 \x03(\x0b\x32\x1f.avalanche.operator.FlowInfoMsg\x12?\n\x0b\x64iagnostics\x18\x02 \x03(\x0b\x32*.avalanche.operator.DiscoveryDiagnosticMsg\"E\n\x16\x44iscoveryDiagnosticMsg\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\"\x92\x01\n\x14ResultFileAttachment\x12\x15\n\rattachment_id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x17\n\nmedia_type\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06sha256\x18\x05 \x01(\tB\x07\n\x05_nameB\r\n\x0b_media_type\"[\n\x0cRunResultMsg\x12\x12\n\nvalue_json\x18\x01 \x01(\t\x12\x37\n\x05\x66iles\x18\x02 \x03(\x0b\x32(.avalanche.operator.ResultFileAttachment\"\xde\x01\n\rRunSummaryMsg\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x11\n\tflow_name\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x14\n\x0ctriggered_by\x18\x06 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12\x1d\n\x15workflow_display_name\x18\x08 \x01(\t\x12\x18\n\x10\x63reated_sequence\x18\t \x01(\x04\x12\x10\n\x08revision\x18\n \x01(\x04\"\xa3\x01\n\x12TraceDescriptorMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\x04\x12\x11\n\tavailable\x18\x03 \x01(\x08\x12\x10\n\x08\x63omplete\x18\x04 \x01(\x08\x12\x13\n\x0b\x65vent_count\x18\x05 \x01(\x04\x12\x12\n\nsize_bytes\x18\x06 \x01(\x04\x12\x1d\n\x15latest_event_sequence\x18\x07 \x01(\x04\"\xdc\x01\n\x0fNodeSnapshotMsg\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tnode_type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12\x12\n\nstarted_at\x18\x05 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x06 \x01(\x01\x12\x35\n\x05trace\x18\x07 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\x12\x10\n\x08revision\x18\x08 \x01(\x04\x12\x18\n\x10\x65vent_page_token\x18\t \x01(\t\"\xe3\x01\n\x0eRunSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x32\n\x07summary\x18\x03 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x04 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x1b\n\x13latest_log_sequence\x18\x05 \x01(\x04\x12\x16\n\x0elog_page_token\x18\x06 \x01(\t\"\x90\x01\n\x0eRunSummaryPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12/\n\x04runs\x18\x03 \x03(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x85\x01\n\x16LogRecordDescriptorMsg\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x02 \x01(\x01\x12\r\n\x05level\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12\x12\n\nsize_bytes\x18\x05 \x01(\x04\x12\x12\n\nbody_token\x18\x06 \x01(\t\"\x92\x01\n\x07LogPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x38\n\x04logs\x18\x03 \x03(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"p\n\x17\x41gentEventDescriptorMsg\x12\x16\n\x0e\x65vent_sequence\x18\x01 \x01(\x04\x12\x12\n\nsize_bytes\x18\x02 \x01(\x04\x12\x12\n\nbody_token\x18\x03 \x01(\t\x12\x15\n\rinvocation_id\x18\x04 \x01(\t\"\xbd\x01\n\x0e\x41gentEventPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12;\n\x06\x65vents\x18\x05 \x03(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\"N\n\nTraceChunk\x12\x10\n\x08revision\x18\x01 \x01(\x04\x12\x13\n\x0b\x63hunk_index\x18\x02 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x04 \x01(\x08\"=\n\x0b\x44\x65tailChunk\x12\x13\n\x0b\x63hunk_index\x18\x01 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x03 \x01(\x08\"t\n\nRunCreated\x12\x32\n\x07summary\x18\x01 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x02 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\"j\n\x10RunStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nstarted_at\x18\x03 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x04 \x01(\x01\x12\x10\n\x08revision\x18\x05 \x01(\x04\"|\n\x11NodeStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x10\n\x08revision\x18\x06 \x01(\x04\"V\n\x0bLogAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x37\n\x03log\x18\x02 \x01(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\"q\n\x12\x41gentEventAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12:\n\x05\x65vent\x18\x03 \x01(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\"h\n\x0eTraceFinalized\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x35\n\x05trace\x18\x03 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\"\xa8\x03\n\tRunUpdate\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x35\n\x0brun_created\x18\x02 \x01(\x0b\x32\x1e.avalanche.operator.RunCreatedH\x00\x12\x42\n\x12run_status_changed\x18\x03 \x01(\x0b\x32$.avalanche.operator.RunStatusChangedH\x00\x12\x44\n\x13node_status_changed\x18\x04 \x01(\x0b\x32%.avalanche.operator.NodeStatusChangedH\x00\x12\x37\n\x0clog_appended\x18\x05 \x01(\x0b\x32\x1f.avalanche.operator.LogAppendedH\x00\x12\x46\n\x14\x61gent_event_appended\x18\x06 \x01(\x0b\x32&.avalanche.operator.AgentEventAppendedH\x00\x12=\n\x0ftrace_finalized\x18\x07 \x01(\x0b\x32\".avalanche.operator.TraceFinalizedH\x00\x42\x08\n\x06\x63hange\"?\n\rResetRequired\x12\x15\n\rhistory_floor\x18\x01 \x01(\x04\x12\x17\n\x0flatest_sequence\x18\x02 \x01(\x04\"\xaa\x01\n\x11RunUpdateEnvelope\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12/\n\x06update\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.RunUpdateH\x00\x12;\n\x0ereset_required\x18\x03 \x01(\x0b\x32!.avalanche.operator.ResetRequiredH\x00\x42\t\n\x07payload2\xdf\x07\n\x0fOperatorService\x12\x44\n\tListFlows\x12\x19.avalanche.operator.Empty\x1a\x1c.avalanche.operator.FlowList\x12U\n\x08StartRun\x12#.avalanche.operator.StartRunRequest\x1a$.avalanche.operator.StartRunResponse\x12L\n\tCancelRun\x12$.avalanche.operator.CancelRunRequest\x1a\x19.avalanche.operator.Empty\x12S\n\x0cGetRunResult\x12!.avalanche.operator.GetRunRequest\x1a .avalanche.operator.RunResultMsg\x12\x63\n\x10ListRunSummaries\x12+.avalanche.operator.ListRunSummariesRequest\x1a\".avalanche.operator.RunSummaryPage\x12_\n\x0eGetRunSnapshot\x12).avalanche.operator.GetRunSnapshotRequest\x1a\".avalanche.operator.RunSnapshotMsg\x12L\n\x08ListLogs\x12#.avalanche.operator.ListLogsRequest\x1a\x1b.avalanche.operator.LogPage\x12\x61\n\x0fListAgentEvents\x12*.avalanche.operator.ListAgentEventsRequest\x1a\".avalanche.operator.AgentEventPage\x12S\n\tReadTrace\x12$.avalanche.operator.ReadTraceRequest\x1a\x1e.avalanche.operator.TraceChunk0\x01\x12V\n\nReadDetail\x12%.avalanche.operator.ReadDetailRequest\x1a\x1f.avalanche.operator.DetailChunk0\x01\x12h\n\x10StreamRunUpdates\x12+.avalanche.operator.StreamRunUpdatesRequest\x1a%.avalanche.operator.RunUpdateEnvelope0\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eoperator.proto\x12\x12\x61valanche.operator\"\x07\n\x05\x45mpty\"\xb2\x01\n\x0fStartRunRequest\x12\x11\n\tflow_name\x18\x01 \x01(\t\x12\x12\n\ninput_json\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_json\x18\x03 \x01(\t\x12\x37\n\x0binput_files\x18\x04 \x03(\x0b\x32\".avalanche.operator.FileAttachment\x12\x0e\n\x06run_id\x18\x06 \x01(\t\x12\x19\n\x11workflow_selector\x18\x07 \x01(\t\"i\n\x0e\x46ileAttachment\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x04 \x01(\t\x12\x0e\n\x06sha256\x18\x05 \x01(\t\"\"\n\x10StartRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\"\n\x10\x43\x61ncelRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"[\n\x17ListRunSummariesRequest\x12\x19\n\x11workflow_selector\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x12\n\npage_token\x18\x03 \x01(\t\"]\n\x15GetRunSnapshotRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x1c\n\x14operator_instance_id\x18\x02 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x03 \x01(\x04\"P\n\x0fListLogsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"]\n\x16ListAgentEventsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x1c\n\x14\x61\x66ter_event_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"c\n\x10ReadTraceRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x1c\n\x14operator_instance_id\x18\x04 \x01(\t\"\'\n\x11ReadDetailRequest\x12\x12\n\nbody_token\x18\x01 \x01(\t\"O\n\x17StreamRunUpdatesRequest\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\"\x1d\n\tNodeEdges\x12\x10\n\x08\x63hildren\x18\x01 \x03(\t\"\xbc\x03\n\x13WorkflowTopologyMsg\x12\x10\n\x08node_ids\x18\x01 \x03(\t\x12\x41\n\x05graph\x18\x02 \x03(\x0b\x32\x32.avalanche.operator.WorkflowTopologyMsg.GraphEntry\x12J\n\nnode_types\x18\x03 \x03(\x0b\x32\x36.avalanche.operator.WorkflowTopologyMsg.NodeTypesEntry\x12P\n\rdisplay_names\x18\x04 \x03(\x0b\x32\x39.avalanche.operator.WorkflowTopologyMsg.DisplayNamesEntry\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcd\x06\n\x0b\x46lowInfoMsg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x10\n\x08node_ids\x18\x03 \x03(\t\x12\x39\n\x05graph\x18\x04 \x03(\x0b\x32*.avalanche.operator.FlowInfoMsg.GraphEntry\x12\x42\n\nnode_types\x18\x05 \x03(\x0b\x32..avalanche.operator.FlowInfoMsg.NodeTypesEntry\x12H\n\rdisplay_names\x18\x06 \x03(\x0b\x32\x31.avalanche.operator.FlowInfoMsg.DisplayNamesEntry\x12\x0c\n\x04\x63ron\x18\x07 \x01(\t\x12\x13\n\x0bnext_run_at\x18\x08 \x01(\x01\x12\x13\n\x0blast_run_at\x18\t \x01(\x01\x12\x13\n\x0bworkflow_id\x18\n \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x12\x12\n\nroot_alias\x18\x0c \x01(\t\x12\x15\n\rrelative_file\x18\r \x01(\t\x12\x16\n\x0e\x62uilder_symbol\x18\x0e \x01(\t\x12\x16\n\x0e\x61gent_node_ids\x18\x0f \x03(\t\x12S\n\x13\x61gent_metadata_json\x18\x10 \x03(\x0b\x32\x36.avalanche.operator.FlowInfoMsg.AgentMetadataJsonEntry\x12\x14\n\x0cwebhook_path\x18\x11 \x01(\t\x12\x13\n\x0bwebhook_url\x18\x12 \x01(\t\x12\x16\n\x0ewebhook_active\x18\x13 \x01(\x08\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"{\n\x08\x46lowList\x12.\n\x05\x66lows\x18\x01 \x03(\x0b\x32\x1f.avalanche.operator.FlowInfoMsg\x12?\n\x0b\x64iagnostics\x18\x02 \x03(\x0b\x32*.avalanche.operator.DiscoveryDiagnosticMsg\"E\n\x16\x44iscoveryDiagnosticMsg\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\"\x92\x01\n\x14ResultFileAttachment\x12\x15\n\rattachment_id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x17\n\nmedia_type\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06sha256\x18\x05 \x01(\tB\x07\n\x05_nameB\r\n\x0b_media_type\"[\n\x0cRunResultMsg\x12\x12\n\nvalue_json\x18\x01 \x01(\t\x12\x37\n\x05\x66iles\x18\x02 \x03(\x0b\x32(.avalanche.operator.ResultFileAttachment\"\xde\x01\n\rRunSummaryMsg\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x11\n\tflow_name\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x14\n\x0ctriggered_by\x18\x06 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12\x1d\n\x15workflow_display_name\x18\x08 \x01(\t\x12\x18\n\x10\x63reated_sequence\x18\t \x01(\x04\x12\x10\n\x08revision\x18\n \x01(\x04\"\xa3\x01\n\x12TraceDescriptorMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\x04\x12\x11\n\tavailable\x18\x03 \x01(\x08\x12\x10\n\x08\x63omplete\x18\x04 \x01(\x08\x12\x13\n\x0b\x65vent_count\x18\x05 \x01(\x04\x12\x12\n\nsize_bytes\x18\x06 \x01(\x04\x12\x1d\n\x15latest_event_sequence\x18\x07 \x01(\x04\"\xfa\x01\n\x0fNodeSnapshotMsg\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tnode_type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12\x12\n\nstarted_at\x18\x05 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x06 \x01(\x01\x12\x35\n\x05trace\x18\x07 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\x12\x10\n\x08revision\x18\x08 \x01(\x04\x12\x18\n\x10\x65vent_page_token\x18\t \x01(\t\x12\x12\n\x05\x65rror\x18\n \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x9e\x02\n\x0eRunSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x32\n\x07summary\x18\x03 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x04 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x1b\n\x13latest_log_sequence\x18\x05 \x01(\x04\x12\x16\n\x0elog_page_token\x18\x06 \x01(\t\x12\x39\n\x08topology\x18\x07 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"\x90\x01\n\x0eRunSummaryPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12/\n\x04runs\x18\x03 \x03(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x85\x01\n\x16LogRecordDescriptorMsg\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x02 \x01(\x01\x12\r\n\x05level\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12\x12\n\nsize_bytes\x18\x05 \x01(\x04\x12\x12\n\nbody_token\x18\x06 \x01(\t\"\x92\x01\n\x07LogPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x38\n\x04logs\x18\x03 \x03(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x8e\x02\n\x17\x41gentEventDescriptorMsg\x12\x16\n\x0e\x65vent_sequence\x18\x01 \x01(\x04\x12\x12\n\nsize_bytes\x18\x02 \x01(\x04\x12\x12\n\nbody_token\x18\x03 \x01(\t\x12\x15\n\rinvocation_id\x18\x04 \x01(\t\x12\x12\n\nevent_kind\x18\x05 \x01(\t\x12\x16\n\titeration\x18\x06 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64uration_ms\x18\x07 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x65rror\x18\x08 \x01(\x08\x12\x12\n\ntool_count\x18\t \x01(\r\x12\x15\n\rpredict_count\x18\n \x01(\rB\x0c\n\n_iterationB\x0e\n\x0c_duration_ms\"\xbd\x01\n\x0e\x41gentEventPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12;\n\x06\x65vents\x18\x05 \x03(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\"N\n\nTraceChunk\x12\x10\n\x08revision\x18\x01 \x01(\x04\x12\x13\n\x0b\x63hunk_index\x18\x02 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x04 \x01(\x08\"=\n\x0b\x44\x65tailChunk\x12\x13\n\x0b\x63hunk_index\x18\x01 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x03 \x01(\x08\"\xaf\x01\n\nRunCreated\x12\x32\n\x07summary\x18\x01 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x02 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x39\n\x08topology\x18\x03 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"j\n\x10RunStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nstarted_at\x18\x03 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x04 \x01(\x01\x12\x10\n\x08revision\x18\x05 \x01(\x04\"\x9a\x01\n\x11NodeStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x10\n\x08revision\x18\x06 \x01(\x04\x12\x12\n\x05\x65rror\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"V\n\x0bLogAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x37\n\x03log\x18\x02 \x01(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\"q\n\x12\x41gentEventAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12:\n\x05\x65vent\x18\x03 \x01(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\"h\n\x0eTraceFinalized\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x35\n\x05trace\x18\x03 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\"\xa8\x03\n\tRunUpdate\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x35\n\x0brun_created\x18\x02 \x01(\x0b\x32\x1e.avalanche.operator.RunCreatedH\x00\x12\x42\n\x12run_status_changed\x18\x03 \x01(\x0b\x32$.avalanche.operator.RunStatusChangedH\x00\x12\x44\n\x13node_status_changed\x18\x04 \x01(\x0b\x32%.avalanche.operator.NodeStatusChangedH\x00\x12\x37\n\x0clog_appended\x18\x05 \x01(\x0b\x32\x1f.avalanche.operator.LogAppendedH\x00\x12\x46\n\x14\x61gent_event_appended\x18\x06 \x01(\x0b\x32&.avalanche.operator.AgentEventAppendedH\x00\x12=\n\x0ftrace_finalized\x18\x07 \x01(\x0b\x32\".avalanche.operator.TraceFinalizedH\x00\x42\x08\n\x06\x63hange\"?\n\rResetRequired\x12\x15\n\rhistory_floor\x18\x01 \x01(\x04\x12\x17\n\x0flatest_sequence\x18\x02 \x01(\x04\"\xaa\x01\n\x11RunUpdateEnvelope\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12/\n\x06update\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.RunUpdateH\x00\x12;\n\x0ereset_required\x18\x03 \x01(\x0b\x32!.avalanche.operator.ResetRequiredH\x00\x42\t\n\x07payload2\xdf\x07\n\x0fOperatorService\x12\x44\n\tListFlows\x12\x19.avalanche.operator.Empty\x1a\x1c.avalanche.operator.FlowList\x12U\n\x08StartRun\x12#.avalanche.operator.StartRunRequest\x1a$.avalanche.operator.StartRunResponse\x12L\n\tCancelRun\x12$.avalanche.operator.CancelRunRequest\x1a\x19.avalanche.operator.Empty\x12S\n\x0cGetRunResult\x12!.avalanche.operator.GetRunRequest\x1a .avalanche.operator.RunResultMsg\x12\x63\n\x10ListRunSummaries\x12+.avalanche.operator.ListRunSummariesRequest\x1a\".avalanche.operator.RunSummaryPage\x12_\n\x0eGetRunSnapshot\x12).avalanche.operator.GetRunSnapshotRequest\x1a\".avalanche.operator.RunSnapshotMsg\x12L\n\x08ListLogs\x12#.avalanche.operator.ListLogsRequest\x1a\x1b.avalanche.operator.LogPage\x12\x61\n\x0fListAgentEvents\x12*.avalanche.operator.ListAgentEventsRequest\x1a\".avalanche.operator.AgentEventPage\x12S\n\tReadTrace\x12$.avalanche.operator.ReadTraceRequest\x1a\x1e.avalanche.operator.TraceChunk0\x01\x12V\n\nReadDetail\x12%.avalanche.operator.ReadDetailRequest\x1a\x1f.avalanche.operator.DetailChunk0\x01\x12h\n\x10StreamRunUpdates\x12+.avalanche.operator.StreamRunUpdatesRequest\x1a%.avalanche.operator.RunUpdateEnvelope0\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'operator_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: DESCRIPTOR._loaded_options = None + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._loaded_options = None + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_options = b'8\001' + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._loaded_options = None + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_options = b'8\001' + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._loaded_options = None + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_options = b'8\001' _globals['_FLOWINFOMSG_GRAPHENTRY']._loaded_options = None _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_options = b'8\001' _globals['_FLOWINFOMSG_NODETYPESENTRY']._loaded_options = None @@ -67,64 +73,72 @@ _globals['_STREAMRUNUPDATESREQUEST']._serialized_end=1026 _globals['_NODEEDGES']._serialized_start=1028 _globals['_NODEEDGES']._serialized_end=1057 - _globals['_FLOWINFOMSG']._serialized_start=1060 - _globals['_FLOWINFOMSG']._serialized_end=1905 - _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_start=1669 - _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_end=1744 - _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_start=1746 - _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_end=1794 - _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_start=1796 - _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_end=1847 - _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_start=1849 - _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_end=1905 - _globals['_FLOWLIST']._serialized_start=1907 - _globals['_FLOWLIST']._serialized_end=2030 - _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_start=2032 - _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_end=2101 - _globals['_RESULTFILEATTACHMENT']._serialized_start=2104 - _globals['_RESULTFILEATTACHMENT']._serialized_end=2250 - _globals['_RUNRESULTMSG']._serialized_start=2252 - _globals['_RUNRESULTMSG']._serialized_end=2343 - _globals['_RUNSUMMARYMSG']._serialized_start=2346 - _globals['_RUNSUMMARYMSG']._serialized_end=2568 - _globals['_TRACEDESCRIPTORMSG']._serialized_start=2571 - _globals['_TRACEDESCRIPTORMSG']._serialized_end=2734 - _globals['_NODESNAPSHOTMSG']._serialized_start=2737 - _globals['_NODESNAPSHOTMSG']._serialized_end=2957 - _globals['_RUNSNAPSHOTMSG']._serialized_start=2960 - _globals['_RUNSNAPSHOTMSG']._serialized_end=3187 - _globals['_RUNSUMMARYPAGE']._serialized_start=3190 - _globals['_RUNSUMMARYPAGE']._serialized_end=3334 - _globals['_LOGRECORDDESCRIPTORMSG']._serialized_start=3337 - _globals['_LOGRECORDDESCRIPTORMSG']._serialized_end=3470 - _globals['_LOGPAGE']._serialized_start=3473 - _globals['_LOGPAGE']._serialized_end=3619 - _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_start=3621 - _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_end=3733 - _globals['_AGENTEVENTPAGE']._serialized_start=3736 - _globals['_AGENTEVENTPAGE']._serialized_end=3925 - _globals['_TRACECHUNK']._serialized_start=3927 - _globals['_TRACECHUNK']._serialized_end=4005 - _globals['_DETAILCHUNK']._serialized_start=4007 - _globals['_DETAILCHUNK']._serialized_end=4068 - _globals['_RUNCREATED']._serialized_start=4070 - _globals['_RUNCREATED']._serialized_end=4186 - _globals['_RUNSTATUSCHANGED']._serialized_start=4188 - _globals['_RUNSTATUSCHANGED']._serialized_end=4294 - _globals['_NODESTATUSCHANGED']._serialized_start=4296 - _globals['_NODESTATUSCHANGED']._serialized_end=4420 - _globals['_LOGAPPENDED']._serialized_start=4422 - _globals['_LOGAPPENDED']._serialized_end=4508 - _globals['_AGENTEVENTAPPENDED']._serialized_start=4510 - _globals['_AGENTEVENTAPPENDED']._serialized_end=4623 - _globals['_TRACEFINALIZED']._serialized_start=4625 - _globals['_TRACEFINALIZED']._serialized_end=4729 - _globals['_RUNUPDATE']._serialized_start=4732 - _globals['_RUNUPDATE']._serialized_end=5156 - _globals['_RESETREQUIRED']._serialized_start=5158 - _globals['_RESETREQUIRED']._serialized_end=5221 - _globals['_RUNUPDATEENVELOPE']._serialized_start=5224 - _globals['_RUNUPDATEENVELOPE']._serialized_end=5394 - _globals['_OPERATORSERVICE']._serialized_start=5397 - _globals['_OPERATORSERVICE']._serialized_end=6388 + _globals['_WORKFLOWTOPOLOGYMSG']._serialized_start=1060 + _globals['_WORKFLOWTOPOLOGYMSG']._serialized_end=1504 + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_start=1326 + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_end=1401 + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_start=1403 + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_end=1451 + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_start=1453 + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_end=1504 + _globals['_FLOWINFOMSG']._serialized_start=1507 + _globals['_FLOWINFOMSG']._serialized_end=2352 + _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_start=1326 + _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_end=1401 + _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_start=1403 + _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_end=1451 + _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_start=1453 + _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_end=1504 + _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_start=2296 + _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_end=2352 + _globals['_FLOWLIST']._serialized_start=2354 + _globals['_FLOWLIST']._serialized_end=2477 + _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_start=2479 + _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_end=2548 + _globals['_RESULTFILEATTACHMENT']._serialized_start=2551 + _globals['_RESULTFILEATTACHMENT']._serialized_end=2697 + _globals['_RUNRESULTMSG']._serialized_start=2699 + _globals['_RUNRESULTMSG']._serialized_end=2790 + _globals['_RUNSUMMARYMSG']._serialized_start=2793 + _globals['_RUNSUMMARYMSG']._serialized_end=3015 + _globals['_TRACEDESCRIPTORMSG']._serialized_start=3018 + _globals['_TRACEDESCRIPTORMSG']._serialized_end=3181 + _globals['_NODESNAPSHOTMSG']._serialized_start=3184 + _globals['_NODESNAPSHOTMSG']._serialized_end=3434 + _globals['_RUNSNAPSHOTMSG']._serialized_start=3437 + _globals['_RUNSNAPSHOTMSG']._serialized_end=3723 + _globals['_RUNSUMMARYPAGE']._serialized_start=3726 + _globals['_RUNSUMMARYPAGE']._serialized_end=3870 + _globals['_LOGRECORDDESCRIPTORMSG']._serialized_start=3873 + _globals['_LOGRECORDDESCRIPTORMSG']._serialized_end=4006 + _globals['_LOGPAGE']._serialized_start=4009 + _globals['_LOGPAGE']._serialized_end=4155 + _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_start=4158 + _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_end=4428 + _globals['_AGENTEVENTPAGE']._serialized_start=4431 + _globals['_AGENTEVENTPAGE']._serialized_end=4620 + _globals['_TRACECHUNK']._serialized_start=4622 + _globals['_TRACECHUNK']._serialized_end=4700 + _globals['_DETAILCHUNK']._serialized_start=4702 + _globals['_DETAILCHUNK']._serialized_end=4763 + _globals['_RUNCREATED']._serialized_start=4766 + _globals['_RUNCREATED']._serialized_end=4941 + _globals['_RUNSTATUSCHANGED']._serialized_start=4943 + _globals['_RUNSTATUSCHANGED']._serialized_end=5049 + _globals['_NODESTATUSCHANGED']._serialized_start=5052 + _globals['_NODESTATUSCHANGED']._serialized_end=5206 + _globals['_LOGAPPENDED']._serialized_start=5208 + _globals['_LOGAPPENDED']._serialized_end=5294 + _globals['_AGENTEVENTAPPENDED']._serialized_start=5296 + _globals['_AGENTEVENTAPPENDED']._serialized_end=5409 + _globals['_TRACEFINALIZED']._serialized_start=5411 + _globals['_TRACEFINALIZED']._serialized_end=5515 + _globals['_RUNUPDATE']._serialized_start=5518 + _globals['_RUNUPDATE']._serialized_end=5942 + _globals['_RESETREQUIRED']._serialized_start=5944 + _globals['_RESETREQUIRED']._serialized_end=6007 + _globals['_RUNUPDATEENVELOPE']._serialized_start=6010 + _globals['_RUNUPDATEENVELOPE']._serialized_end=6180 + _globals['_OPERATORSERVICE']._serialized_start=6183 + _globals['_OPERATORSERVICE']._serialized_end=7174 # @@protoc_insertion_point(module_scope) diff --git a/src/runtime/operator/proto/operator_pb2.pyi b/src/runtime/operator/proto/operator_pb2.pyi index 52a0c84..b5c7f25 100644 --- a/src/runtime/operator/proto/operator_pb2.pyi +++ b/src/runtime/operator/proto/operator_pb2.pyi @@ -130,6 +130,39 @@ class NodeEdges(_message.Message): children: _containers.RepeatedScalarFieldContainer[str] def __init__(self, children: _Optional[_Iterable[str]] = ...) -> None: ... +class WorkflowTopologyMsg(_message.Message): + __slots__ = ("node_ids", "graph", "node_types", "display_names") + class GraphEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: NodeEdges + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[NodeEdges, _Mapping]] = ...) -> None: ... + class NodeTypesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: str + def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + class DisplayNamesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: str + def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + NODE_IDS_FIELD_NUMBER: _ClassVar[int] + GRAPH_FIELD_NUMBER: _ClassVar[int] + NODE_TYPES_FIELD_NUMBER: _ClassVar[int] + DISPLAY_NAMES_FIELD_NUMBER: _ClassVar[int] + node_ids: _containers.RepeatedScalarFieldContainer[str] + graph: _containers.MessageMap[str, NodeEdges] + node_types: _containers.ScalarMap[str, str] + display_names: _containers.ScalarMap[str, str] + def __init__(self, node_ids: _Optional[_Iterable[str]] = ..., graph: _Optional[_Mapping[str, NodeEdges]] = ..., node_types: _Optional[_Mapping[str, str]] = ..., display_names: _Optional[_Mapping[str, str]] = ...) -> None: ... + class FlowInfoMsg(_message.Message): __slots__ = ("name", "file_path", "node_ids", "graph", "node_types", "display_names", "cron", "next_run_at", "last_run_at", "workflow_id", "display_name", "root_alias", "relative_file", "builder_symbol", "agent_node_ids", "agent_metadata_json", "webhook_path", "webhook_url", "webhook_active") class GraphEntry(_message.Message): @@ -283,7 +316,7 @@ class TraceDescriptorMsg(_message.Message): def __init__(self, status: _Optional[str] = ..., revision: _Optional[int] = ..., available: bool = ..., complete: bool = ..., event_count: _Optional[int] = ..., size_bytes: _Optional[int] = ..., latest_event_sequence: _Optional[int] = ...) -> None: ... class NodeSnapshotMsg(_message.Message): - __slots__ = ("node_id", "name", "node_type", "status", "started_at", "ended_at", "trace", "revision", "event_page_token") + __slots__ = ("node_id", "name", "node_type", "status", "started_at", "ended_at", "trace", "revision", "event_page_token", "error") NODE_ID_FIELD_NUMBER: _ClassVar[int] NAME_FIELD_NUMBER: _ClassVar[int] NODE_TYPE_FIELD_NUMBER: _ClassVar[int] @@ -293,6 +326,7 @@ class NodeSnapshotMsg(_message.Message): TRACE_FIELD_NUMBER: _ClassVar[int] REVISION_FIELD_NUMBER: _ClassVar[int] EVENT_PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int] + ERROR_FIELD_NUMBER: _ClassVar[int] node_id: str name: str node_type: str @@ -302,23 +336,26 @@ class NodeSnapshotMsg(_message.Message): trace: TraceDescriptorMsg revision: int event_page_token: str - def __init__(self, node_id: _Optional[str] = ..., name: _Optional[str] = ..., node_type: _Optional[str] = ..., status: _Optional[str] = ..., started_at: _Optional[float] = ..., ended_at: _Optional[float] = ..., trace: _Optional[_Union[TraceDescriptorMsg, _Mapping]] = ..., revision: _Optional[int] = ..., event_page_token: _Optional[str] = ...) -> None: ... + error: str + def __init__(self, node_id: _Optional[str] = ..., name: _Optional[str] = ..., node_type: _Optional[str] = ..., status: _Optional[str] = ..., started_at: _Optional[float] = ..., ended_at: _Optional[float] = ..., trace: _Optional[_Union[TraceDescriptorMsg, _Mapping]] = ..., revision: _Optional[int] = ..., event_page_token: _Optional[str] = ..., error: _Optional[str] = ...) -> None: ... class RunSnapshotMsg(_message.Message): - __slots__ = ("operator_instance_id", "as_of_sequence", "summary", "nodes", "latest_log_sequence", "log_page_token") + __slots__ = ("operator_instance_id", "as_of_sequence", "summary", "nodes", "latest_log_sequence", "log_page_token", "topology") OPERATOR_INSTANCE_ID_FIELD_NUMBER: _ClassVar[int] AS_OF_SEQUENCE_FIELD_NUMBER: _ClassVar[int] SUMMARY_FIELD_NUMBER: _ClassVar[int] NODES_FIELD_NUMBER: _ClassVar[int] LATEST_LOG_SEQUENCE_FIELD_NUMBER: _ClassVar[int] LOG_PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int] + TOPOLOGY_FIELD_NUMBER: _ClassVar[int] operator_instance_id: str as_of_sequence: int summary: RunSummaryMsg nodes: _containers.RepeatedCompositeFieldContainer[NodeSnapshotMsg] latest_log_sequence: int log_page_token: str - def __init__(self, operator_instance_id: _Optional[str] = ..., as_of_sequence: _Optional[int] = ..., summary: _Optional[_Union[RunSummaryMsg, _Mapping]] = ..., nodes: _Optional[_Iterable[_Union[NodeSnapshotMsg, _Mapping]]] = ..., latest_log_sequence: _Optional[int] = ..., log_page_token: _Optional[str] = ...) -> None: ... + topology: WorkflowTopologyMsg + def __init__(self, operator_instance_id: _Optional[str] = ..., as_of_sequence: _Optional[int] = ..., summary: _Optional[_Union[RunSummaryMsg, _Mapping]] = ..., nodes: _Optional[_Iterable[_Union[NodeSnapshotMsg, _Mapping]]] = ..., latest_log_sequence: _Optional[int] = ..., log_page_token: _Optional[str] = ..., topology: _Optional[_Union[WorkflowTopologyMsg, _Mapping]] = ...) -> None: ... class RunSummaryPage(_message.Message): __slots__ = ("operator_instance_id", "as_of_sequence", "runs", "next_page_token") @@ -361,16 +398,28 @@ class LogPage(_message.Message): def __init__(self, operator_instance_id: _Optional[str] = ..., as_of_sequence: _Optional[int] = ..., logs: _Optional[_Iterable[_Union[LogRecordDescriptorMsg, _Mapping]]] = ..., next_page_token: _Optional[str] = ...) -> None: ... class AgentEventDescriptorMsg(_message.Message): - __slots__ = ("event_sequence", "size_bytes", "body_token", "invocation_id") + __slots__ = ("event_sequence", "size_bytes", "body_token", "invocation_id", "event_kind", "iteration", "duration_ms", "error", "tool_count", "predict_count") EVENT_SEQUENCE_FIELD_NUMBER: _ClassVar[int] SIZE_BYTES_FIELD_NUMBER: _ClassVar[int] BODY_TOKEN_FIELD_NUMBER: _ClassVar[int] INVOCATION_ID_FIELD_NUMBER: _ClassVar[int] + EVENT_KIND_FIELD_NUMBER: _ClassVar[int] + ITERATION_FIELD_NUMBER: _ClassVar[int] + DURATION_MS_FIELD_NUMBER: _ClassVar[int] + ERROR_FIELD_NUMBER: _ClassVar[int] + TOOL_COUNT_FIELD_NUMBER: _ClassVar[int] + PREDICT_COUNT_FIELD_NUMBER: _ClassVar[int] event_sequence: int size_bytes: int body_token: str invocation_id: str - def __init__(self, event_sequence: _Optional[int] = ..., size_bytes: _Optional[int] = ..., body_token: _Optional[str] = ..., invocation_id: _Optional[str] = ...) -> None: ... + event_kind: str + iteration: int + duration_ms: int + error: bool + tool_count: int + predict_count: int + def __init__(self, event_sequence: _Optional[int] = ..., size_bytes: _Optional[int] = ..., body_token: _Optional[str] = ..., invocation_id: _Optional[str] = ..., event_kind: _Optional[str] = ..., iteration: _Optional[int] = ..., duration_ms: _Optional[int] = ..., error: bool = ..., tool_count: _Optional[int] = ..., predict_count: _Optional[int] = ...) -> None: ... class AgentEventPage(_message.Message): __slots__ = ("operator_instance_id", "as_of_sequence", "run_id", "node_id", "events", "next_page_token") @@ -411,12 +460,14 @@ class DetailChunk(_message.Message): def __init__(self, chunk_index: _Optional[int] = ..., data: _Optional[bytes] = ..., eof: bool = ...) -> None: ... class RunCreated(_message.Message): - __slots__ = ("summary", "nodes") + __slots__ = ("summary", "nodes", "topology") SUMMARY_FIELD_NUMBER: _ClassVar[int] NODES_FIELD_NUMBER: _ClassVar[int] + TOPOLOGY_FIELD_NUMBER: _ClassVar[int] summary: RunSummaryMsg nodes: _containers.RepeatedCompositeFieldContainer[NodeSnapshotMsg] - def __init__(self, summary: _Optional[_Union[RunSummaryMsg, _Mapping]] = ..., nodes: _Optional[_Iterable[_Union[NodeSnapshotMsg, _Mapping]]] = ...) -> None: ... + topology: WorkflowTopologyMsg + def __init__(self, summary: _Optional[_Union[RunSummaryMsg, _Mapping]] = ..., nodes: _Optional[_Iterable[_Union[NodeSnapshotMsg, _Mapping]]] = ..., topology: _Optional[_Union[WorkflowTopologyMsg, _Mapping]] = ...) -> None: ... class RunStatusChanged(_message.Message): __slots__ = ("run_id", "status", "started_at", "ended_at", "revision") @@ -433,20 +484,22 @@ class RunStatusChanged(_message.Message): def __init__(self, run_id: _Optional[str] = ..., status: _Optional[str] = ..., started_at: _Optional[float] = ..., ended_at: _Optional[float] = ..., revision: _Optional[int] = ...) -> None: ... class NodeStatusChanged(_message.Message): - __slots__ = ("run_id", "node_id", "status", "started_at", "ended_at", "revision") + __slots__ = ("run_id", "node_id", "status", "started_at", "ended_at", "revision", "error") RUN_ID_FIELD_NUMBER: _ClassVar[int] NODE_ID_FIELD_NUMBER: _ClassVar[int] STATUS_FIELD_NUMBER: _ClassVar[int] STARTED_AT_FIELD_NUMBER: _ClassVar[int] ENDED_AT_FIELD_NUMBER: _ClassVar[int] REVISION_FIELD_NUMBER: _ClassVar[int] + ERROR_FIELD_NUMBER: _ClassVar[int] run_id: str node_id: str status: str started_at: float ended_at: float revision: int - def __init__(self, run_id: _Optional[str] = ..., node_id: _Optional[str] = ..., status: _Optional[str] = ..., started_at: _Optional[float] = ..., ended_at: _Optional[float] = ..., revision: _Optional[int] = ...) -> None: ... + error: str + def __init__(self, run_id: _Optional[str] = ..., node_id: _Optional[str] = ..., status: _Optional[str] = ..., started_at: _Optional[float] = ..., ended_at: _Optional[float] = ..., revision: _Optional[int] = ..., error: _Optional[str] = ...) -> None: ... class LogAppended(_message.Message): __slots__ = ("run_id", "log") diff --git a/test/agent/agent_step_test.py b/test/agent/agent_step_test.py index 725d2b2..8c32e8b 100644 --- a/test/agent/agent_step_test.py +++ b/test/agent/agent_step_test.py @@ -874,12 +874,15 @@ def fake_build(signature, *, skills, tools, **runtime_kwargs): ] live = [event for event in observed if event["kind"] == "evidence"] assert [event["sequence"] for event in live] == list(range(1, 10)) - assert live[0]["data"] == {"input_fields": ["person"]} + assert live[0]["data"] == { + "input_fields": ["person"], + "inputs": {"person": {"id": 1, "name": "Ada"}}, + } assert live[3]["data"]["call_id"] == "predict-1" assert "input" not in live[3]["data"] assert "output" not in live[4]["data"] assert "args" not in live[5]["data"] - assert live[7]["data"]["reasoning"] == "Check the evidence before summarizing." + assert live[7]["data"]["step"]["reasoning"] == "Check the evidence before summarizing." assert live[8]["data"] == {"status": "completed", "outputs": {"summary": "done"}} assert "result" not in live[6]["data"] terminal = observed[-1] @@ -1124,3 +1127,31 @@ async def test_agent_exports_exception_trace_before_preserving_wrapped_error(mon assert observed[-1]["kind"] == "trace_finished" assert observed[-1]["trace"]["status"] == "error" + + +def test_agent_value_projection_preserves_nested_predict_rlm_files(): + from predict_rlm import File + + projected = agent_step_module._bounded_agent_value( + { + "source": File(path="/tmp/source.pdf"), + "outputs": [File(path="/tmp/report.xlsx")], + } + ) + + assert projected == { + "source": {"kind": "predict_rlm_file", "path": "/tmp/source.pdf"}, + "outputs": [{"kind": "predict_rlm_file", "path": "/tmp/report.xlsx"}], + } + + +def test_agent_value_projection_marks_unsupported_and_oversized_values_unavailable(): + unsupported = agent_step_module._bounded_agent_value({"value": object()}) + oversized = agent_step_module._bounded_agent_value( + "x" * (agent_step_module._MAX_EVIDENCE_VALUE_BYTES + 1) + ) + + assert unsupported == { + "value": {"kind": "unavailable", "reason": "unsupported value type: object"} + } + assert oversized == {"kind": "unavailable", "reason": "value exceeds byte limit"} diff --git a/test/operator_tests/test_operator.py b/test/operator_tests/test_operator.py index 6813ef4..e015809 100644 --- a/test/operator_tests/test_operator.py +++ b/test/operator_tests/test_operator.py @@ -647,9 +647,27 @@ def test_operator_merges_ordered_evidence_and_final_trace(self): "kind": "evidence", "invocation_id": "agent-invocation", "sequence": 1, - "event_kind": "code.generated", + "event_kind": "iteration.recorded", "timestamp_ns": 10, - "data": {"iteration": 1, "code": "print('ok')"}, + "data": { + "iteration": 1, + "duration_ms": 12, + "error": False, + "tool_count": 1, + "predict_count": 1, + "step": { + "iteration": 1, + "reasoning": "Inspect", + "code": "print('ok')", + "output": "ok", + "untruncated_output": "ok", + "error": False, + "duration_ms": 12, + "tool_calls": [{"name": "lookup", "result": "ok"}], + "predict_calls": [{"signature": "Answer", "calls": [{}]}], + "usage": {"main": {"input_tokens": 4}}, + }, + }, }, } assert operator._apply_event(run.run_id, handle, evidence) is False @@ -698,14 +716,14 @@ def test_operator_merges_ordered_evidence_and_final_trace(self): events = operator.list_agent_events(page_token=node.event_page_token) assert [item.event_sequence for item in events.events] == [1] + assert events.events[0].event_kind == "iteration.recorded" + assert events.events[0].iteration == 1 + assert events.events[0].tool_count == 1 + assert events.events[0].predict_count == 1 structured_event = json.loads(operator.read_detail(events.events[0].body_token)) - assert structured_event == { - "sequence": 1, - "invocation_id": "agent-invocation", - "event_kind": "code.generated", - "timestamp_ns": 10, - "data": {"iteration": 1, "code": "print('ok')"}, - } + assert structured_event["data"]["step"]["reasoning"] == "Inspect" + assert structured_event["data"]["step"]["tool_calls"][0]["name"] == "lookup" + assert structured_event["data"]["step"]["predict_calls"][0]["signature"] == "Answer" finalized = operator.read_trace( run.run_id, @@ -716,6 +734,8 @@ def test_operator_merges_ordered_evidence_and_final_trace(self): finalized_trace = json.loads(finalized.data) assert finalized_trace["status"] == "completed" assert finalized_trace["evidence"]["run_id"] == "agent-run" + assert "steps" not in finalized_trace + assert "events" not in finalized_trace["evidence"] logs = operator.list_logs(page_token=snapshot.log_page_token) assert len(logs.logs) == 2 @@ -727,6 +747,7 @@ def test_operator_merges_ordered_evidence_and_final_trace(self): assert envelope["status"] == "completed" assert envelope["run_id"] == "agent-run" assert [item["sequence"] for item in envelope["events"]] == [1] + assert envelope["trace"]["steps"][0]["reasoning"] == "Inspect" assert [entry.node_id for entry in materialized.logs] == [ "agent_1", "agent_1", @@ -857,3 +878,28 @@ def apply(event): ] == [("invocation-a", 1), ("invocation-b", 1)] finally: operator.close() + + +def test_prepared_run_retains_immutable_topology_after_source_metadata_changes(): + prepared = { + "display_name": "Original", + "node_ids": ["source_1", "step_1"], + "graph": {"source_1": ["step_1"], "step_1": []}, + "node_types": {"source_1": "source", "step_1": "step"}, + "display_names": {"source_1": "Source", "step_1": "Step"}, + } + + run = Operator._run_from_prepared( + "run-topology", + "flow.py::original", + "Original", + "manual", + prepared, + ) + prepared["node_ids"].append("new_1") + prepared["graph"]["source_1"] = ["new_1"] + prepared["display_names"]["step_1"] = "Changed" + + assert run.topology.node_ids == ("source_1", "step_1") + assert run.topology.graph == (("source_1", ("step_1",)), ("step_1", ())) + assert dict(run.topology.display_names) == {"source_1": "Source", "step_1": "Step"} diff --git a/test/operator_tests/test_protocol_contract.py b/test/operator_tests/test_protocol_contract.py index 94f3609..52c61cc 100644 --- a/test/operator_tests/test_protocol_contract.py +++ b/test/operator_tests/test_protocol_contract.py @@ -5,6 +5,8 @@ agent_event_descriptor_to_proto, log_record_descriptor_from_proto, log_record_descriptor_to_proto, + node_snapshot_from_proto, + node_snapshot_to_proto, run_snapshot_from_proto, run_snapshot_to_proto, ) @@ -18,6 +20,7 @@ RunStatus, RunSummary, TraceDescriptor, + WorkflowTopology, ) from runtime.operator.operator import Operator from runtime.operator.proto import operator_pb2 as pb @@ -35,6 +38,7 @@ def test_structural_snapshot_contract_excludes_detail_bodies(): "nodes", "latest_log_sequence", "log_page_token", + "topology", } assert "logs" not in snapshot_fields assert "agent_trace_json" not in node_fields @@ -93,6 +97,12 @@ def test_snapshot_detail_cursor_and_descriptor_roundtrip(): ), latest_log_sequence=22, log_page_token="logs-token", + topology=WorkflowTopology( + node_ids=("agent_1",), + graph=(("agent_1", ()),), + node_types=(("agent_1", "step"),), + display_names=(("agent_1", "Agent"),), + ), ) assert run_snapshot_from_proto(run_snapshot_to_proto(snapshot)) == snapshot @@ -112,7 +122,21 @@ def test_detail_records_expose_only_bounded_metadata(): event_sequence=7, size_bytes=5_000_000, body_token="opaque-event-token", + event_kind="iteration.recorded", + iteration=3, + duration_ms=1250, + error=True, + tool_count=2, + predict_count=4, + ) + failed = NodeSnapshot( + node_id="failed", + name="Failed", + node_type="step", + status=NodeStatus.FAILED, + error="invalid customer record", ) + assert node_snapshot_from_proto(node_snapshot_to_proto(failed)) == failed assert log_record_descriptor_from_proto(log_record_descriptor_to_proto(log)) == log assert agent_event_descriptor_from_proto(agent_event_descriptor_to_proto(event)) == event From d5ab1211006ca9234aae44296d7a256a56c6bf55 Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Fri, 31 Jul 2026 19:41:41 +0000 Subject: [PATCH 03/25] Publish revisioned operator catalog reloads --- src/runtime/operator/client.py | 103 +++++++++--- src/runtime/operator/convert.py | 87 ++++++++-- src/runtime/operator/models.py | 49 +++++- src/runtime/operator/operator.py | 84 +++++++--- src/runtime/operator/proto/operator.proto | 35 ++-- src/runtime/operator/proto/operator_pb2.py | 150 +++++++++--------- src/runtime/operator/proto/operator_pb2.pyi | 56 +++++-- .../operator/proto/operator_pb2_grpc.py | 46 +++--- src/runtime/operator/registry.py | 104 +++++++++--- src/runtime/operator/server.py | 25 ++- src/tui/app.py | 1 + src/tui/mock.py | 17 +- src/tui/models.py | 2 + src/tui/state.py | 5 + src/tui/ui_store.py | 19 ++- test/operator_tests/test_grpc.py | 99 ++++++------ .../test_grpc_client_auth_tls.py | 4 +- test/operator_tests/test_operator.py | 23 +-- .../test_operator_dev_reload.py | 6 +- test/operator_tests/test_protocol_contract.py | 20 +-- test/operator_tests/test_registry.py | 18 ++- test/operator_tests/test_run_updates.py | 116 +++++++------- test/operator_tests/test_state_detail.py | 20 +-- test/tui_test.py | 37 +++-- 24 files changed, 728 insertions(+), 398 deletions(-) diff --git a/src/runtime/operator/client.py b/src/runtime/operator/client.py index 611f87b..8ef04bb 100644 --- a/src/runtime/operator/client.py +++ b/src/runtime/operator/client.py @@ -22,30 +22,31 @@ from ._grpc import _BOUNDED_MESSAGE_OPTIONS from .convert import ( agent_event_descriptor_from_proto, - discovery_diagnostic_from_proto, + catalog_snapshot_from_proto, log_record_descriptor_from_proto, + operator_update_envelope_from_proto, run_snapshot_from_proto, run_summary_from_proto, - run_update_envelope_from_proto, - workflow_info_from_proto, ) from .models import ( AgentEvent, AgentEventAppended, AgentEventDetailAppended, + CatalogReplaced, + CatalogSnapshot, DetailUpdate, LogAppended, LogDetailAppended, LogEntry, NodeState, NodeStatusChanged, + OperatorUpdateEnvelope, ResetBaseline, RunCreated, RunSnapshot, RunState, RunStatusChanged, RunSummary, - RunUpdateEnvelope, SequencedLogEntry, StreamResetNotice, TraceDetail, @@ -243,6 +244,7 @@ def __init__( ) self._stub = pb_grpc.OperatorServiceStub(self._channel) self._run_callbacks: list[Callable[[RunState], None]] = [] + self._catalog_callbacks: list[Callable[[CatalogSnapshot], None]] = [] self._log_callbacks: list[Callable[[LogEntry], None]] = [] self._detail_callbacks: list[Callable[[DetailUpdate], None]] = [] self._stream_reset_callbacks: list[Callable[[StreamResetNotice], None]] = [] @@ -272,6 +274,7 @@ def __init__( self._reset_generation: int = 0 self._pending_reset: StreamResetNotice | None = None self._validated_reset_baseline: ResetBaseline | None = None + self._catalog = CatalogSnapshot() self._legacy_names_by_workflow_id: dict[str, str] = {} # Operator reachability is independent from live-update stream health. @@ -339,13 +342,14 @@ def _record_unary_error(self, error: grpc.RpcError) -> OperatorCallError: self.last_error = str(operation_error) return operation_error + def get_catalog(self) -> CatalogSnapshot: + catalog = catalog_snapshot_from_proto(self._call(self._stub.GetCatalog, pb.Empty())) + with self._state_lock: + self._install_catalog_locked(catalog) + return catalog + def list_workflows(self) -> list[WorkflowInfo]: - resp = self._call(self._stub.ListFlows, pb.Empty()) - self._cache_legacy_workflow_names(resp) - self.discovery_diagnostics = [ - discovery_diagnostic_from_proto(item) for item in resp.diagnostics - ] - return [workflow_info_from_proto(p) for p in resp.flows] + return list(self.get_catalog().workflows) def list_runs(self, workflow_selector: str) -> list[RunState]: """List lightweight run summaries without detail bodies.""" @@ -1231,6 +1235,9 @@ def cancel_run(self, run_id: str) -> None: def on_run_update(self, callback: Callable[[RunState], None]) -> None: self._run_callbacks.append(callback) + def on_catalog_update(self, callback: Callable[[CatalogSnapshot], None]) -> None: + self._catalog_callbacks.append(callback) + def on_log(self, callback: Callable[[LogEntry], None]) -> None: self._log_callbacks.append(callback) @@ -1278,22 +1285,32 @@ def load_reset_baseline(self, notice: StreamResetNotice) -> ResetBaseline: ) from last_error def _load_authoritative_reset_baseline(self, notice: StreamResetNotice) -> ResetBaseline: - workflows = tuple(self.list_workflows()) + catalog = self.get_catalog() marker, summaries = self._list_run_summaries() snapshots = [ self._get_consistent_run_snapshot(summary, marker) for summary in summaries ] - if tuple(self.list_workflows()) != workflows: + confirmed_catalog = self.get_catalog() + if replace(confirmed_catalog, as_of_sequence=0) != replace(catalog, as_of_sequence=0): raise _ResetBaselineMismatchError( "workflow catalog changed during baseline loading" ) + if ( + catalog.operator_instance_id != marker[0] + or confirmed_catalog.operator_instance_id != marker[0] + or catalog.as_of_sequence > marker[1] + or confirmed_catalog.as_of_sequence < marker[1] + ): + raise _ResetBaselineMismatchError( + "workflow catalog does not span the run baseline high-water mark" + ) - runs_by_workflow = self._group_snapshot_runs(workflows, snapshots) + runs_by_workflow = self._group_snapshot_runs(catalog.workflows, snapshots) return ResetBaseline( generation=notice.generation, operator_instance_id=marker[0], as_of_sequence=marker[1], - workflows=workflows, + catalog=catalog, runs_by_workflow=runs_by_workflow, ) @@ -1500,6 +1517,8 @@ def acknowledge_stream_reset( for workflow_runs in validated.runs_by_workflow.values() for run in workflow_runs } + with self._state_lock: + self._install_catalog_locked(validated.catalog) self._replace_structural_baseline( operator_instance_id, reconciled_sequence, @@ -1511,6 +1530,7 @@ def acknowledge_stream_reset( self.stream_retry_count = 0 self.stream_error = "" self._reset_acknowledged.set() + self._notify_catalog_callbacks(validated.catalog) def _ensure_stream(self) -> None: """Start the background streaming thread if not already running.""" @@ -1530,7 +1550,7 @@ def ping(self) -> bool: kwargs = {"timeout": min(2.0, self._unary_timeout)} if self._metadata is not None: kwargs["metadata"] = self._metadata - resp = self._stub.ListFlows(pb.Empty(), **kwargs) + resp = self._stub.GetCatalog(pb.Empty(), **kwargs) self._cache_legacy_workflow_names(resp) self._record_unary_success() return True @@ -1538,14 +1558,21 @@ def ping(self) -> bool: self._record_unary_error(e) return False - def _cache_legacy_workflow_names(self, response: pb.FlowList) -> None: + def _cache_legacy_workflow_names(self, catalog: CatalogSnapshot) -> None: self._legacy_names_by_workflow_id = { (item.workflow_id or item.name): (item.name or item.display_name) - for item in response.flows + for item in catalog.workflows } + def _install_catalog_locked(self, catalog: CatalogSnapshot) -> None: + if catalog.revision < self._catalog.revision: + return + self._catalog = deepcopy(catalog) + self._cache_legacy_workflow_names(catalog) + self.discovery_diagnostics = list(catalog.diagnostics) + def _stream_loop(self) -> None: - """Consume ordered run updates without conflating stream and unary health.""" + """Consume ordered operator updates without conflating stream and unary health.""" while not self._stream_stop.is_set(): try: with self._lifecycle_lock: @@ -1556,8 +1583,8 @@ def _stream_loop(self) -> None: self.stream_retry_count += 1 with self._state_lock: cursor = self._cursor - stream = self._stub.StreamRunUpdates( - pb.StreamRunUpdatesRequest( + stream = self._stub.StreamOperatorUpdates( + pb.StreamOperatorUpdatesRequest( operator_instance_id=cursor.operator_instance_id, after_sequence=cursor.sequence, ), @@ -1584,7 +1611,7 @@ def _stream_loop(self) -> None: for message in stream: if self._stream_stop.is_set(): break - envelope = run_update_envelope_from_proto(message) + envelope = operator_update_envelope_from_proto(message) if not envelope.operator_instance_id: raise RuntimeError( "update envelope omitted its operator instance identifier" @@ -1642,7 +1669,7 @@ def _stream_loop(self) -> None: continue if self._stream_stop.is_set(): break - raise RuntimeError("update stream ended") + raise RuntimeError("operator update stream ended") except grpc.RpcError as error: if self._stream_stop.is_set(): break @@ -1694,7 +1721,7 @@ def _require_stream_reset( break def _apply_update_envelope( - self, envelope: RunUpdateEnvelope + self, envelope: OperatorUpdateEnvelope ) -> tuple[RunState | None, DetailUpdate | None]: update = envelope.update with self._state_lock: @@ -1732,15 +1759,23 @@ def _apply_update_envelope( size_bytes=descriptor.size_bytes, ) with self._state_lock: - return self._apply_update_envelope_locked( + result = self._apply_update_envelope_locked( envelope, log_detail=log_detail, event_detail=event_detail, ) + catalog = ( + deepcopy(self._catalog) + if update is not None and isinstance(update.change, CatalogReplaced) + else None + ) + if catalog is not None: + self._notify_catalog_callbacks(catalog) + return result def _apply_update_envelope_locked( self, - envelope: RunUpdateEnvelope, + envelope: OperatorUpdateEnvelope, *, log_detail: LogEntry | None = None, event_detail: AgentEvent | None = None, @@ -1765,7 +1800,16 @@ def _apply_update_envelope_locked( change = update.change detail: DetailUpdate | None = None - if isinstance(change, RunCreated): + if isinstance(change, CatalogReplaced): + catalog = change.catalog + if ( + catalog.operator_instance_id != envelope.operator_instance_id + or catalog.as_of_sequence != update.sequence + ): + raise _RunUpdateResetError("catalog update marker mismatch") + self._install_catalog_locked(catalog) + run = None + elif isinstance(change, RunCreated): run = _run_from_created(envelope.operator_instance_id, change) old_revision = self._run_revisions.get(run.run_id, -1) if change.summary.revision <= old_revision: @@ -1983,6 +2027,13 @@ def _replace_structural_baseline( self.operator_instance_id = operator_instance_id self._cursor = _StreamCursor(operator_instance_id, as_of_sequence) + def _notify_catalog_callbacks(self, catalog: CatalogSnapshot) -> None: + for callback in self._catalog_callbacks: + try: + callback(deepcopy(catalog)) + except Exception: + pass + def _notify_run_callbacks(self, run: RunState) -> None: for callback in self._run_callbacks: try: diff --git a/src/runtime/operator/convert.py b/src/runtime/operator/convert.py index b6f7386..6993e71 100644 --- a/src/runtime/operator/convert.py +++ b/src/runtime/operator/convert.py @@ -7,20 +7,23 @@ from .models import ( AgentEventAppended, AgentEventDescriptor, + CatalogReplaced, + CatalogSnapshot, LogAppended, LogLevel, LogRecordDescriptor, NodeSnapshot, NodeStatus, NodeStatusChanged, + OperatorUpdate, + OperatorUpdateEnvelope, ResetRequired, RunCreated, RunSnapshot, RunStatus, RunStatusChanged, RunSummary, - RunUpdate, - RunUpdateEnvelope, + ScanTargetInfo, TraceDescriptor, TraceFinalized, WorkflowDiscoveryDiagnostic, @@ -106,6 +109,46 @@ def discovery_diagnostic_from_proto( ) +def scan_target_to_proto(target: ScanTargetInfo) -> pb.ScanTargetMsg: + return pb.ScanTargetMsg( + alias=target.alias, + target_path=target.target_path, + kind=target.kind, + ) + + +def scan_target_from_proto(msg: pb.ScanTargetMsg) -> ScanTargetInfo: + if msg.kind not in {"file", "directory"}: + raise ValueError(f"Unknown scan target kind: {msg.kind}") + return ScanTargetInfo( + alias=msg.alias, + target_path=msg.target_path, + kind=msg.kind, + ) + + +def catalog_snapshot_to_proto(catalog: CatalogSnapshot) -> pb.CatalogSnapshotMsg: + return pb.CatalogSnapshotMsg( + revision=catalog.revision, + operator_instance_id=catalog.operator_instance_id, + as_of_sequence=catalog.as_of_sequence, + workflows=[workflow_info_to_proto(item) for item in catalog.workflows], + scan_targets=[scan_target_to_proto(item) for item in catalog.scan_targets], + diagnostics=[discovery_diagnostic_to_proto(item) for item in catalog.diagnostics], + ) + + +def catalog_snapshot_from_proto(msg: pb.CatalogSnapshotMsg) -> CatalogSnapshot: + return CatalogSnapshot( + revision=msg.revision, + workflows=tuple(workflow_info_from_proto(item) for item in msg.workflows), + operator_instance_id=msg.operator_instance_id, + as_of_sequence=msg.as_of_sequence, + scan_targets=tuple(scan_target_from_proto(item) for item in msg.scan_targets), + diagnostics=tuple(discovery_diagnostic_from_proto(item) for item in msg.diagnostics), + ) + + def workflow_topology_to_proto(topology: WorkflowTopology) -> pb.WorkflowTopologyMsg: return pb.WorkflowTopologyMsg( node_ids=topology.node_ids, @@ -301,8 +344,8 @@ def agent_event_descriptor_from_proto( ) -def run_update_to_proto(update: RunUpdate) -> pb.RunUpdate: - message = pb.RunUpdate(sequence=update.sequence) +def operator_update_to_proto(update: OperatorUpdate) -> pb.OperatorUpdate: + message = pb.OperatorUpdate(sequence=update.sequence) change = update.change if isinstance(change, RunCreated): message.run_created.CopyFrom( @@ -357,12 +400,16 @@ def run_update_to_proto(update: RunUpdate) -> pb.RunUpdate: trace=trace_descriptor_to_proto(change.trace), ) ) + elif isinstance(change, CatalogReplaced): + message.catalog_replaced.CopyFrom( + pb.CatalogReplaced(catalog=catalog_snapshot_to_proto(change.catalog)) + ) else: - raise TypeError(f"Unsupported run update change: {type(change).__name__}") + raise TypeError(f"Unsupported operator update change: {type(change).__name__}") return message -def run_update_from_proto(msg: pb.RunUpdate) -> RunUpdate: +def operator_update_from_proto(msg: pb.OperatorUpdate) -> OperatorUpdate: change_name = msg.WhichOneof("change") if change_name == "run_created": change = RunCreated( @@ -410,15 +457,21 @@ def run_update_from_proto(msg: pb.RunUpdate) -> RunUpdate: node_id=item.node_id, trace=trace_descriptor_from_proto(item.trace), ) + elif change_name == "catalog_replaced": + change = CatalogReplaced( + catalog=catalog_snapshot_from_proto(msg.catalog_replaced.catalog) + ) else: - raise ValueError("run update is missing a change") - return RunUpdate(sequence=msg.sequence, change=change) + raise ValueError("operator update is missing a change") + return OperatorUpdate(sequence=msg.sequence, change=change) -def run_update_envelope_to_proto(envelope: RunUpdateEnvelope) -> pb.RunUpdateEnvelope: - message = pb.RunUpdateEnvelope(operator_instance_id=envelope.operator_instance_id) +def operator_update_envelope_to_proto( + envelope: OperatorUpdateEnvelope, +) -> pb.OperatorUpdateEnvelope: + message = pb.OperatorUpdateEnvelope(operator_instance_id=envelope.operator_instance_id) if envelope.update is not None: - message.update.CopyFrom(run_update_to_proto(envelope.update)) + message.update.CopyFrom(operator_update_to_proto(envelope.update)) elif envelope.reset_required is not None: message.reset_required.CopyFrom( pb.ResetRequired( @@ -429,22 +482,24 @@ def run_update_envelope_to_proto(envelope: RunUpdateEnvelope) -> pb.RunUpdateEnv return message -def run_update_envelope_from_proto(msg: pb.RunUpdateEnvelope) -> RunUpdateEnvelope: +def operator_update_envelope_from_proto( + msg: pb.OperatorUpdateEnvelope, +) -> OperatorUpdateEnvelope: payload = msg.WhichOneof("payload") if payload == "update": - return RunUpdateEnvelope( + return OperatorUpdateEnvelope( operator_instance_id=msg.operator_instance_id, - update=run_update_from_proto(msg.update), + update=operator_update_from_proto(msg.update), ) if payload == "reset_required": - return RunUpdateEnvelope( + return OperatorUpdateEnvelope( operator_instance_id=msg.operator_instance_id, reset_required=ResetRequired( history_floor=msg.reset_required.history_floor, latest_sequence=msg.reset_required.latest_sequence, ), ) - raise ValueError("run update envelope is missing a payload") + raise ValueError("operator update envelope is missing a payload") def _relative_source_file(info: WorkflowInfo) -> str: diff --git a/src/runtime/operator/models.py b/src/runtime/operator/models.py index 4400f08..1068318 100644 --- a/src/runtime/operator/models.py +++ b/src/runtime/operator/models.py @@ -304,6 +304,34 @@ class TraceHeader: telemetry_json: str | None = None +@dataclass(frozen=True) +class ScanTargetInfo: + """One normalized workflow discovery target exposed to clients.""" + + alias: str + target_path: str + kind: Literal["file", "directory"] + + +@dataclass(frozen=True) +class CatalogSnapshot: + """One complete authoritative current-workflow catalog projection.""" + + operator_instance_id: str = "" + as_of_sequence: int = 0 + revision: int = 0 + workflows: tuple[WorkflowInfo, ...] = () + scan_targets: tuple[ScanTargetInfo, ...] = () + diagnostics: tuple[WorkflowDiscoveryDiagnostic, ...] = () + + +@dataclass(frozen=True) +class CatalogReplaced: + """One full catalog publication carried by the operator update stream.""" + + catalog: CatalogSnapshot + + @dataclass(frozen=True) class RunCreated: summary: RunSummary @@ -359,12 +387,13 @@ class TraceFinalized: | AgentEventAppended | TraceFinalized ) +OperatorUpdateChange = RunUpdateChange | CatalogReplaced @dataclass(frozen=True) -class RunUpdate: +class OperatorUpdate: sequence: int - change: RunUpdateChange + change: OperatorUpdateChange @dataclass(frozen=True) @@ -374,14 +403,14 @@ class ResetRequired: @dataclass(frozen=True) -class RunUpdateEnvelope: +class OperatorUpdateEnvelope: operator_instance_id: str - update: RunUpdate | None = None + update: OperatorUpdate | None = None reset_required: ResetRequired | None = None def __post_init__(self) -> None: if (self.update is None) == (self.reset_required is None): - raise ValueError("update envelope requires exactly one payload") + raise ValueError("operator update envelope requires exactly one payload") @dataclass @@ -442,14 +471,16 @@ class ResetBaseline: generation: int operator_instance_id: str as_of_sequence: int - workflows: tuple[WorkflowInfo, ...] + catalog: CatalogSnapshot runs_by_workflow: Mapping[str, tuple[RunState, ...]] @dataclass(frozen=True) class WorkflowDiscoveryDiagnostic: path: str - kind: Literal["skipped", "import_error", "build_error", "invalid_schedule"] + kind: Literal[ + "skipped", "import_error", "build_error", "invalid_schedule", "invalid_catalog" + ] message: str @@ -482,14 +513,16 @@ class WorkflowDescriptor: @dataclass(frozen=True) class CatalogView: - """One atomically replaceable, current-only registry view.""" + """One atomically replaceable current-workflow registry view.""" + revision: int = 0 by_id: Mapping[str, WorkflowDescriptor] = field( default_factory=lambda: MappingProxyType({}) ) short_names: Mapping[str, tuple[str, ...]] = field( default_factory=lambda: MappingProxyType({}) ) + scan_targets: tuple[ScanTargetInfo, ...] = () diagnostics: tuple[WorkflowDiscoveryDiagnostic, ...] = () diff --git a/src/runtime/operator/operator.py b/src/runtime/operator/operator.py index 115689e..0219c1a 100644 --- a/src/runtime/operator/operator.py +++ b/src/runtime/operator/operator.py @@ -32,6 +32,9 @@ AgentEventDescriptor, AgentEventDetailAppended, AgentEventPage, + CatalogReplaced, + CatalogSnapshot, + CatalogView, DetailUpdate, FinalizedTrace, LogAppended, @@ -44,6 +47,8 @@ NodeState, NodeStatus, NodeStatusChanged, + OperatorUpdate, + OperatorUpdateEnvelope, ResetRequired, RunCreated, RunSnapshot, @@ -52,8 +57,6 @@ RunStatusChanged, RunSummary, RunSummaryPage, - RunUpdate, - RunUpdateEnvelope, SequencedLogEntry, TraceDescriptor, TraceFinalized, @@ -167,7 +170,7 @@ class _RunNotifications: run_callbacks: tuple[tuple[Callable[[RunState], None], RunState], ...] log_callbacks: tuple[tuple[Callable[[LogEntry], None], LogEntry], ...] detail_callbacks: tuple[tuple[Callable[[DetailUpdate], None], DetailUpdate], ...] - update_subscribers: tuple[tuple[queue.Queue, tuple[RunUpdateEnvelope, ...]], ...] + update_subscribers: tuple[tuple[queue.Queue, tuple[OperatorUpdateEnvelope, ...]], ...] ready: threading.Event delivered: threading.Event @@ -321,7 +324,7 @@ def __init__( self._update_subscribers: list[queue.Queue] = [] self._operator_instance_id = uuid4().hex self._sequence = 0 - self._stream_history: deque[RunUpdate] = deque(maxlen=stream_history_capacity) + self._stream_history: deque[OperatorUpdate] = deque(maxlen=stream_history_capacity) self._structural_baseline_capacity = structural_baseline_capacity self._structural_baselines: OrderedDict[int, _StructuralBaseline] = OrderedDict() self._lock = threading.RLock() @@ -369,8 +372,13 @@ def current_sequence(self) -> int: with self._lock: return self._sequence - def list_workflows(self) -> list[WorkflowInfo]: - workflows = self._registry.list_workflows() + def get_catalog(self) -> CatalogSnapshot: + """Return one complete, revisioned current-workflow catalog.""" + with self._lock: + return self._catalog_snapshot(self._registry.view, self._sequence) + + def _catalog_snapshot(self, view: CatalogView, as_of_sequence: int) -> CatalogSnapshot: + workflows = self._registry.list_workflows(view) for info in workflows: route = next( ( @@ -388,10 +396,20 @@ def list_workflows(self) -> list[WorkflowInfo]: nxt = self._scheduler.next_run_time(info.cron) info.next_run_at = nxt.timestamp() if nxt else None info.last_run_at = self._scheduler.last_triggered(info.workflow_id) - return workflows + return CatalogSnapshot( + revision=view.revision, + operator_instance_id=self._operator_instance_id, + as_of_sequence=as_of_sequence, + workflows=tuple(workflows), + scan_targets=view.scan_targets, + diagnostics=view.diagnostics, + ) + + def list_workflows(self) -> list[WorkflowInfo]: + return list(self.get_catalog().workflows) def list_diagnostics(self): - return self._registry.list_diagnostics() + return list(self.get_catalog().diagnostics) def list_runs(self, workflow_selector: str) -> list[RunState]: with self._lock: @@ -1107,7 +1125,7 @@ def on_detail_update(self, callback: Callable[[DetailUpdate], None]) -> None: def start_stream(self) -> None: """In-process callbacks are already live once registered.""" - def subscribe_run_updates( + def subscribe_operator_updates( self, operator_instance_id: str = "", after_sequence: int = 0 ) -> queue.Queue: """Atomically replay retained updates or require a structural reset.""" @@ -1133,7 +1151,7 @@ def subscribe_run_updates( for update in replay: subscription.put_nowait( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id=self._operator_instance_id, update=update, ) @@ -1148,9 +1166,9 @@ def _history_bounds_locked(self) -> tuple[int, int]: ) return history_floor, latest_sequence - def _update_reset_locked(self) -> RunUpdateEnvelope: + def _update_reset_locked(self) -> OperatorUpdateEnvelope: history_floor, latest_sequence = self._history_bounds_locked() - return RunUpdateEnvelope( + return OperatorUpdateEnvelope( operator_instance_id=self._operator_instance_id, reset_required=ResetRequired( history_floor=history_floor, @@ -1158,7 +1176,7 @@ def _update_reset_locked(self) -> RunUpdateEnvelope: ), ) - def unsubscribe_run_updates(self, subscription: queue.Queue) -> None: + def unsubscribe_operator_updates(self, subscription: queue.Queue) -> None: with self._lock: self._update_subscribers = [ item for item in self._update_subscribers if item is not subscription @@ -1331,13 +1349,10 @@ def _refresh_workflows(self) -> None: # Otherwise an old cron can resolve newly-published same-ID source in the # small window between these two operations. with self._scheduler.reconciliation_boundary(): - try: - view = self._registry.rescan(validate=routes_for) - except ValueError as exc: - logging.getLogger(__name__).warning("Webhook catalog refresh rejected: %s", exc) - return + view = self._registry.rescan(validate=routes_for) self._scheduler.reconcile(view.by_id.values()) self._reconcile_webhooks(view.by_id.values()) + self._publish_catalog(view) def _reconcile_webhooks(self, descriptors) -> None: routes = routes_for(tuple(descriptors)) @@ -2164,14 +2179,14 @@ def _publish_run_locked( updates = [] for change in changes: self._sequence += 1 - update = RunUpdate(sequence=self._sequence, change=change) + update = OperatorUpdate(sequence=self._sequence, change=change) self._stream_history.append(update) updates.append(update) if self._sequence != publication_sequence: raise RuntimeError("Run publication produced an inconsistent update batch") envelopes = tuple( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id=self._operator_instance_id, update=update, ) @@ -2239,6 +2254,33 @@ def _notify_run(self, run: RunState, *, summary_changed: bool = True) -> None: ) self._wait_for_notifications(notifications) + def _publish_catalog(self, view: CatalogView) -> None: + with self._lock: + self._sequence += 1 + catalog = self._catalog_snapshot(view, self._sequence) + update = OperatorUpdate( + sequence=self._sequence, + change=CatalogReplaced(catalog=catalog), + ) + self._stream_history.append(update) + envelope = OperatorUpdateEnvelope( + operator_instance_id=self._operator_instance_id, + update=update, + ) + notifications = _RunNotifications( + sequence=self._sequence, + run_callbacks=(), + detail_callbacks=(), + log_callbacks=(), + update_subscribers=tuple( + (subscription, (envelope,)) for subscription in self._update_subscribers + ), + ready=threading.Event(), + delivered=threading.Event(), + ) + self._notification_queue.put_nowait(notifications) + self._wait_for_notifications(notifications) + def _wait_for_notifications(self, notifications: _RunNotifications) -> None: notifications.ready.set() if threading.current_thread() is self._notification_thread: @@ -2278,7 +2320,7 @@ def _deliver_notifications(self, notifications: _RunNotifications) -> None: def _deliver_update_batch( self, subscription: queue.Queue, - envelopes: tuple[RunUpdateEnvelope, ...], + envelopes: tuple[OperatorUpdateEnvelope, ...], ) -> None: with self._lock: if subscription not in self._update_subscribers: diff --git a/src/runtime/operator/proto/operator.proto b/src/runtime/operator/proto/operator.proto index a259ebb..d77409e 100644 --- a/src/runtime/operator/proto/operator.proto +++ b/src/runtime/operator/proto/operator.proto @@ -9,7 +9,7 @@ package avalanche.operator; // ── Service ───────────────────────────────────────────── service OperatorService { - rpc ListFlows(Empty) returns (FlowList); + rpc GetCatalog(Empty) returns (CatalogSnapshotMsg); rpc StartRun(StartRunRequest) returns (StartRunResponse); rpc CancelRun(CancelRunRequest) returns (Empty); rpc GetRunResult(GetRunRequest) returns (RunResultMsg); @@ -19,7 +19,7 @@ service OperatorService { rpc ListAgentEvents(ListAgentEventsRequest) returns (AgentEventPage); rpc ReadTrace(ReadTraceRequest) returns (stream TraceChunk); rpc ReadDetail(ReadDetailRequest) returns (stream DetailChunk); - rpc StreamRunUpdates(StreamRunUpdatesRequest) returns (stream RunUpdateEnvelope); + rpc StreamOperatorUpdates(StreamOperatorUpdatesRequest) returns (stream OperatorUpdateEnvelope); } // ── Request / Response ────────────────────────────────── @@ -98,7 +98,7 @@ message ReadDetailRequest { string body_token = 1; } -message StreamRunUpdatesRequest { +message StreamOperatorUpdatesRequest { string operator_instance_id = 1; uint64 after_sequence = 2; } @@ -138,10 +138,6 @@ message FlowInfoMsg { bool webhook_active = 19; } -message FlowList { - repeated FlowInfoMsg flows = 1; - repeated DiscoveryDiagnosticMsg diagnostics = 2; -} message DiscoveryDiagnosticMsg { string path = 1; @@ -149,6 +145,20 @@ message DiscoveryDiagnosticMsg { string message = 3; } +message ScanTargetMsg { + string alias = 1; + string target_path = 2; + string kind = 3; +} +message CatalogSnapshotMsg { + string operator_instance_id = 1; + uint64 as_of_sequence = 2; + uint64 revision = 3; + repeated FlowInfoMsg workflows = 4; + repeated ScanTargetMsg scan_targets = 5; + repeated DiscoveryDiagnosticMsg diagnostics = 6; +} + message ResultFileAttachment { string attachment_id = 1; optional string name = 2; @@ -307,7 +317,11 @@ message TraceFinalized { TraceDescriptorMsg trace = 3; } -message RunUpdate { +message CatalogReplaced { + CatalogSnapshotMsg catalog = 1; +} + +message OperatorUpdate { uint64 sequence = 1; oneof change { RunCreated run_created = 2; @@ -316,6 +330,7 @@ message RunUpdate { LogAppended log_appended = 5; AgentEventAppended agent_event_appended = 6; TraceFinalized trace_finalized = 7; + CatalogReplaced catalog_replaced = 8; } } @@ -324,10 +339,10 @@ message ResetRequired { uint64 latest_sequence = 2; } -message RunUpdateEnvelope { +message OperatorUpdateEnvelope { string operator_instance_id = 1; oneof payload { - RunUpdate update = 2; + OperatorUpdate update = 2; ResetRequired reset_required = 3; } } diff --git a/src/runtime/operator/proto/operator_pb2.py b/src/runtime/operator/proto/operator_pb2.py index 5274eb6..f29d212 100644 --- a/src/runtime/operator/proto/operator_pb2.py +++ b/src/runtime/operator/proto/operator_pb2.py @@ -24,7 +24,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eoperator.proto\x12\x12\x61valanche.operator\"\x07\n\x05\x45mpty\"\xb2\x01\n\x0fStartRunRequest\x12\x11\n\tflow_name\x18\x01 \x01(\t\x12\x12\n\ninput_json\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_json\x18\x03 \x01(\t\x12\x37\n\x0binput_files\x18\x04 \x03(\x0b\x32\".avalanche.operator.FileAttachment\x12\x0e\n\x06run_id\x18\x06 \x01(\t\x12\x19\n\x11workflow_selector\x18\x07 \x01(\t\"i\n\x0e\x46ileAttachment\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x04 \x01(\t\x12\x0e\n\x06sha256\x18\x05 \x01(\t\"\"\n\x10StartRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\"\n\x10\x43\x61ncelRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"[\n\x17ListRunSummariesRequest\x12\x19\n\x11workflow_selector\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x12\n\npage_token\x18\x03 \x01(\t\"]\n\x15GetRunSnapshotRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x1c\n\x14operator_instance_id\x18\x02 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x03 \x01(\x04\"P\n\x0fListLogsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"]\n\x16ListAgentEventsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x1c\n\x14\x61\x66ter_event_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"c\n\x10ReadTraceRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x1c\n\x14operator_instance_id\x18\x04 \x01(\t\"\'\n\x11ReadDetailRequest\x12\x12\n\nbody_token\x18\x01 \x01(\t\"O\n\x17StreamRunUpdatesRequest\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\"\x1d\n\tNodeEdges\x12\x10\n\x08\x63hildren\x18\x01 \x03(\t\"\xbc\x03\n\x13WorkflowTopologyMsg\x12\x10\n\x08node_ids\x18\x01 \x03(\t\x12\x41\n\x05graph\x18\x02 \x03(\x0b\x32\x32.avalanche.operator.WorkflowTopologyMsg.GraphEntry\x12J\n\nnode_types\x18\x03 \x03(\x0b\x32\x36.avalanche.operator.WorkflowTopologyMsg.NodeTypesEntry\x12P\n\rdisplay_names\x18\x04 \x03(\x0b\x32\x39.avalanche.operator.WorkflowTopologyMsg.DisplayNamesEntry\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcd\x06\n\x0b\x46lowInfoMsg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x10\n\x08node_ids\x18\x03 \x03(\t\x12\x39\n\x05graph\x18\x04 \x03(\x0b\x32*.avalanche.operator.FlowInfoMsg.GraphEntry\x12\x42\n\nnode_types\x18\x05 \x03(\x0b\x32..avalanche.operator.FlowInfoMsg.NodeTypesEntry\x12H\n\rdisplay_names\x18\x06 \x03(\x0b\x32\x31.avalanche.operator.FlowInfoMsg.DisplayNamesEntry\x12\x0c\n\x04\x63ron\x18\x07 \x01(\t\x12\x13\n\x0bnext_run_at\x18\x08 \x01(\x01\x12\x13\n\x0blast_run_at\x18\t \x01(\x01\x12\x13\n\x0bworkflow_id\x18\n \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x12\x12\n\nroot_alias\x18\x0c \x01(\t\x12\x15\n\rrelative_file\x18\r \x01(\t\x12\x16\n\x0e\x62uilder_symbol\x18\x0e \x01(\t\x12\x16\n\x0e\x61gent_node_ids\x18\x0f \x03(\t\x12S\n\x13\x61gent_metadata_json\x18\x10 \x03(\x0b\x32\x36.avalanche.operator.FlowInfoMsg.AgentMetadataJsonEntry\x12\x14\n\x0cwebhook_path\x18\x11 \x01(\t\x12\x13\n\x0bwebhook_url\x18\x12 \x01(\t\x12\x16\n\x0ewebhook_active\x18\x13 \x01(\x08\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"{\n\x08\x46lowList\x12.\n\x05\x66lows\x18\x01 \x03(\x0b\x32\x1f.avalanche.operator.FlowInfoMsg\x12?\n\x0b\x64iagnostics\x18\x02 \x03(\x0b\x32*.avalanche.operator.DiscoveryDiagnosticMsg\"E\n\x16\x44iscoveryDiagnosticMsg\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\"\x92\x01\n\x14ResultFileAttachment\x12\x15\n\rattachment_id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x17\n\nmedia_type\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06sha256\x18\x05 \x01(\tB\x07\n\x05_nameB\r\n\x0b_media_type\"[\n\x0cRunResultMsg\x12\x12\n\nvalue_json\x18\x01 \x01(\t\x12\x37\n\x05\x66iles\x18\x02 \x03(\x0b\x32(.avalanche.operator.ResultFileAttachment\"\xde\x01\n\rRunSummaryMsg\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x11\n\tflow_name\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x14\n\x0ctriggered_by\x18\x06 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12\x1d\n\x15workflow_display_name\x18\x08 \x01(\t\x12\x18\n\x10\x63reated_sequence\x18\t \x01(\x04\x12\x10\n\x08revision\x18\n \x01(\x04\"\xa3\x01\n\x12TraceDescriptorMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\x04\x12\x11\n\tavailable\x18\x03 \x01(\x08\x12\x10\n\x08\x63omplete\x18\x04 \x01(\x08\x12\x13\n\x0b\x65vent_count\x18\x05 \x01(\x04\x12\x12\n\nsize_bytes\x18\x06 \x01(\x04\x12\x1d\n\x15latest_event_sequence\x18\x07 \x01(\x04\"\xfa\x01\n\x0fNodeSnapshotMsg\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tnode_type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12\x12\n\nstarted_at\x18\x05 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x06 \x01(\x01\x12\x35\n\x05trace\x18\x07 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\x12\x10\n\x08revision\x18\x08 \x01(\x04\x12\x18\n\x10\x65vent_page_token\x18\t \x01(\t\x12\x12\n\x05\x65rror\x18\n \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x9e\x02\n\x0eRunSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x32\n\x07summary\x18\x03 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x04 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x1b\n\x13latest_log_sequence\x18\x05 \x01(\x04\x12\x16\n\x0elog_page_token\x18\x06 \x01(\t\x12\x39\n\x08topology\x18\x07 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"\x90\x01\n\x0eRunSummaryPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12/\n\x04runs\x18\x03 \x03(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x85\x01\n\x16LogRecordDescriptorMsg\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x02 \x01(\x01\x12\r\n\x05level\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12\x12\n\nsize_bytes\x18\x05 \x01(\x04\x12\x12\n\nbody_token\x18\x06 \x01(\t\"\x92\x01\n\x07LogPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x38\n\x04logs\x18\x03 \x03(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x8e\x02\n\x17\x41gentEventDescriptorMsg\x12\x16\n\x0e\x65vent_sequence\x18\x01 \x01(\x04\x12\x12\n\nsize_bytes\x18\x02 \x01(\x04\x12\x12\n\nbody_token\x18\x03 \x01(\t\x12\x15\n\rinvocation_id\x18\x04 \x01(\t\x12\x12\n\nevent_kind\x18\x05 \x01(\t\x12\x16\n\titeration\x18\x06 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64uration_ms\x18\x07 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x65rror\x18\x08 \x01(\x08\x12\x12\n\ntool_count\x18\t \x01(\r\x12\x15\n\rpredict_count\x18\n \x01(\rB\x0c\n\n_iterationB\x0e\n\x0c_duration_ms\"\xbd\x01\n\x0e\x41gentEventPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12;\n\x06\x65vents\x18\x05 \x03(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\"N\n\nTraceChunk\x12\x10\n\x08revision\x18\x01 \x01(\x04\x12\x13\n\x0b\x63hunk_index\x18\x02 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x04 \x01(\x08\"=\n\x0b\x44\x65tailChunk\x12\x13\n\x0b\x63hunk_index\x18\x01 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x03 \x01(\x08\"\xaf\x01\n\nRunCreated\x12\x32\n\x07summary\x18\x01 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x02 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x39\n\x08topology\x18\x03 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"j\n\x10RunStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nstarted_at\x18\x03 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x04 \x01(\x01\x12\x10\n\x08revision\x18\x05 \x01(\x04\"\x9a\x01\n\x11NodeStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x10\n\x08revision\x18\x06 \x01(\x04\x12\x12\n\x05\x65rror\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"V\n\x0bLogAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x37\n\x03log\x18\x02 \x01(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\"q\n\x12\x41gentEventAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12:\n\x05\x65vent\x18\x03 \x01(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\"h\n\x0eTraceFinalized\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x35\n\x05trace\x18\x03 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\"\xa8\x03\n\tRunUpdate\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x35\n\x0brun_created\x18\x02 \x01(\x0b\x32\x1e.avalanche.operator.RunCreatedH\x00\x12\x42\n\x12run_status_changed\x18\x03 \x01(\x0b\x32$.avalanche.operator.RunStatusChangedH\x00\x12\x44\n\x13node_status_changed\x18\x04 \x01(\x0b\x32%.avalanche.operator.NodeStatusChangedH\x00\x12\x37\n\x0clog_appended\x18\x05 \x01(\x0b\x32\x1f.avalanche.operator.LogAppendedH\x00\x12\x46\n\x14\x61gent_event_appended\x18\x06 \x01(\x0b\x32&.avalanche.operator.AgentEventAppendedH\x00\x12=\n\x0ftrace_finalized\x18\x07 \x01(\x0b\x32\".avalanche.operator.TraceFinalizedH\x00\x42\x08\n\x06\x63hange\"?\n\rResetRequired\x12\x15\n\rhistory_floor\x18\x01 \x01(\x04\x12\x17\n\x0flatest_sequence\x18\x02 \x01(\x04\"\xaa\x01\n\x11RunUpdateEnvelope\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12/\n\x06update\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.RunUpdateH\x00\x12;\n\x0ereset_required\x18\x03 \x01(\x0b\x32!.avalanche.operator.ResetRequiredH\x00\x42\t\n\x07payload2\xdf\x07\n\x0fOperatorService\x12\x44\n\tListFlows\x12\x19.avalanche.operator.Empty\x1a\x1c.avalanche.operator.FlowList\x12U\n\x08StartRun\x12#.avalanche.operator.StartRunRequest\x1a$.avalanche.operator.StartRunResponse\x12L\n\tCancelRun\x12$.avalanche.operator.CancelRunRequest\x1a\x19.avalanche.operator.Empty\x12S\n\x0cGetRunResult\x12!.avalanche.operator.GetRunRequest\x1a .avalanche.operator.RunResultMsg\x12\x63\n\x10ListRunSummaries\x12+.avalanche.operator.ListRunSummariesRequest\x1a\".avalanche.operator.RunSummaryPage\x12_\n\x0eGetRunSnapshot\x12).avalanche.operator.GetRunSnapshotRequest\x1a\".avalanche.operator.RunSnapshotMsg\x12L\n\x08ListLogs\x12#.avalanche.operator.ListLogsRequest\x1a\x1b.avalanche.operator.LogPage\x12\x61\n\x0fListAgentEvents\x12*.avalanche.operator.ListAgentEventsRequest\x1a\".avalanche.operator.AgentEventPage\x12S\n\tReadTrace\x12$.avalanche.operator.ReadTraceRequest\x1a\x1e.avalanche.operator.TraceChunk0\x01\x12V\n\nReadDetail\x12%.avalanche.operator.ReadDetailRequest\x1a\x1f.avalanche.operator.DetailChunk0\x01\x12h\n\x10StreamRunUpdates\x12+.avalanche.operator.StreamRunUpdatesRequest\x1a%.avalanche.operator.RunUpdateEnvelope0\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eoperator.proto\x12\x12\x61valanche.operator\"\x07\n\x05\x45mpty\"\xb2\x01\n\x0fStartRunRequest\x12\x11\n\tflow_name\x18\x01 \x01(\t\x12\x12\n\ninput_json\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_json\x18\x03 \x01(\t\x12\x37\n\x0binput_files\x18\x04 \x03(\x0b\x32\".avalanche.operator.FileAttachment\x12\x0e\n\x06run_id\x18\x06 \x01(\t\x12\x19\n\x11workflow_selector\x18\x07 \x01(\t\"i\n\x0e\x46ileAttachment\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x04 \x01(\t\x12\x0e\n\x06sha256\x18\x05 \x01(\t\"\"\n\x10StartRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\"\n\x10\x43\x61ncelRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"[\n\x17ListRunSummariesRequest\x12\x19\n\x11workflow_selector\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x12\n\npage_token\x18\x03 \x01(\t\"]\n\x15GetRunSnapshotRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x1c\n\x14operator_instance_id\x18\x02 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x03 \x01(\x04\"P\n\x0fListLogsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"]\n\x16ListAgentEventsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x1c\n\x14\x61\x66ter_event_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"c\n\x10ReadTraceRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x1c\n\x14operator_instance_id\x18\x04 \x01(\t\"\'\n\x11ReadDetailRequest\x12\x12\n\nbody_token\x18\x01 \x01(\t\"T\n\x1cStreamOperatorUpdatesRequest\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\"\x1d\n\tNodeEdges\x12\x10\n\x08\x63hildren\x18\x01 \x03(\t\"\xbc\x03\n\x13WorkflowTopologyMsg\x12\x10\n\x08node_ids\x18\x01 \x03(\t\x12\x41\n\x05graph\x18\x02 \x03(\x0b\x32\x32.avalanche.operator.WorkflowTopologyMsg.GraphEntry\x12J\n\nnode_types\x18\x03 \x03(\x0b\x32\x36.avalanche.operator.WorkflowTopologyMsg.NodeTypesEntry\x12P\n\rdisplay_names\x18\x04 \x03(\x0b\x32\x39.avalanche.operator.WorkflowTopologyMsg.DisplayNamesEntry\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcd\x06\n\x0b\x46lowInfoMsg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x10\n\x08node_ids\x18\x03 \x03(\t\x12\x39\n\x05graph\x18\x04 \x03(\x0b\x32*.avalanche.operator.FlowInfoMsg.GraphEntry\x12\x42\n\nnode_types\x18\x05 \x03(\x0b\x32..avalanche.operator.FlowInfoMsg.NodeTypesEntry\x12H\n\rdisplay_names\x18\x06 \x03(\x0b\x32\x31.avalanche.operator.FlowInfoMsg.DisplayNamesEntry\x12\x0c\n\x04\x63ron\x18\x07 \x01(\t\x12\x13\n\x0bnext_run_at\x18\x08 \x01(\x01\x12\x13\n\x0blast_run_at\x18\t \x01(\x01\x12\x13\n\x0bworkflow_id\x18\n \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x12\x12\n\nroot_alias\x18\x0c \x01(\t\x12\x15\n\rrelative_file\x18\r \x01(\t\x12\x16\n\x0e\x62uilder_symbol\x18\x0e \x01(\t\x12\x16\n\x0e\x61gent_node_ids\x18\x0f \x03(\t\x12S\n\x13\x61gent_metadata_json\x18\x10 \x03(\x0b\x32\x36.avalanche.operator.FlowInfoMsg.AgentMetadataJsonEntry\x12\x14\n\x0cwebhook_path\x18\x11 \x01(\t\x12\x13\n\x0bwebhook_url\x18\x12 \x01(\t\x12\x16\n\x0ewebhook_active\x18\x13 \x01(\x08\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x16\x44iscoveryDiagnosticMsg\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\"A\n\rScanTargetMsg\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12\x13\n\x0btarget_path\x18\x02 \x01(\t\x12\x0c\n\x04kind\x18\x03 \x01(\t\"\x8a\x02\n\x12\x43\x61talogSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x32\n\tworkflows\x18\x04 \x03(\x0b\x32\x1f.avalanche.operator.FlowInfoMsg\x12\x37\n\x0cscan_targets\x18\x05 \x03(\x0b\x32!.avalanche.operator.ScanTargetMsg\x12?\n\x0b\x64iagnostics\x18\x06 \x03(\x0b\x32*.avalanche.operator.DiscoveryDiagnosticMsg\"\x92\x01\n\x14ResultFileAttachment\x12\x15\n\rattachment_id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x17\n\nmedia_type\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06sha256\x18\x05 \x01(\tB\x07\n\x05_nameB\r\n\x0b_media_type\"[\n\x0cRunResultMsg\x12\x12\n\nvalue_json\x18\x01 \x01(\t\x12\x37\n\x05\x66iles\x18\x02 \x03(\x0b\x32(.avalanche.operator.ResultFileAttachment\"\xde\x01\n\rRunSummaryMsg\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x11\n\tflow_name\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x14\n\x0ctriggered_by\x18\x06 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12\x1d\n\x15workflow_display_name\x18\x08 \x01(\t\x12\x18\n\x10\x63reated_sequence\x18\t \x01(\x04\x12\x10\n\x08revision\x18\n \x01(\x04\"\xa3\x01\n\x12TraceDescriptorMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\x04\x12\x11\n\tavailable\x18\x03 \x01(\x08\x12\x10\n\x08\x63omplete\x18\x04 \x01(\x08\x12\x13\n\x0b\x65vent_count\x18\x05 \x01(\x04\x12\x12\n\nsize_bytes\x18\x06 \x01(\x04\x12\x1d\n\x15latest_event_sequence\x18\x07 \x01(\x04\"\xfa\x01\n\x0fNodeSnapshotMsg\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tnode_type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12\x12\n\nstarted_at\x18\x05 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x06 \x01(\x01\x12\x35\n\x05trace\x18\x07 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\x12\x10\n\x08revision\x18\x08 \x01(\x04\x12\x18\n\x10\x65vent_page_token\x18\t \x01(\t\x12\x12\n\x05\x65rror\x18\n \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x9e\x02\n\x0eRunSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x32\n\x07summary\x18\x03 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x04 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x1b\n\x13latest_log_sequence\x18\x05 \x01(\x04\x12\x16\n\x0elog_page_token\x18\x06 \x01(\t\x12\x39\n\x08topology\x18\x07 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"\x90\x01\n\x0eRunSummaryPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12/\n\x04runs\x18\x03 \x03(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x85\x01\n\x16LogRecordDescriptorMsg\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x02 \x01(\x01\x12\r\n\x05level\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12\x12\n\nsize_bytes\x18\x05 \x01(\x04\x12\x12\n\nbody_token\x18\x06 \x01(\t\"\x92\x01\n\x07LogPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x38\n\x04logs\x18\x03 \x03(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x8e\x02\n\x17\x41gentEventDescriptorMsg\x12\x16\n\x0e\x65vent_sequence\x18\x01 \x01(\x04\x12\x12\n\nsize_bytes\x18\x02 \x01(\x04\x12\x12\n\nbody_token\x18\x03 \x01(\t\x12\x15\n\rinvocation_id\x18\x04 \x01(\t\x12\x12\n\nevent_kind\x18\x05 \x01(\t\x12\x16\n\titeration\x18\x06 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64uration_ms\x18\x07 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x65rror\x18\x08 \x01(\x08\x12\x12\n\ntool_count\x18\t \x01(\r\x12\x15\n\rpredict_count\x18\n \x01(\rB\x0c\n\n_iterationB\x0e\n\x0c_duration_ms\"\xbd\x01\n\x0e\x41gentEventPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12;\n\x06\x65vents\x18\x05 \x03(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\"N\n\nTraceChunk\x12\x10\n\x08revision\x18\x01 \x01(\x04\x12\x13\n\x0b\x63hunk_index\x18\x02 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x04 \x01(\x08\"=\n\x0b\x44\x65tailChunk\x12\x13\n\x0b\x63hunk_index\x18\x01 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x03 \x01(\x08\"\xaf\x01\n\nRunCreated\x12\x32\n\x07summary\x18\x01 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x02 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x39\n\x08topology\x18\x03 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"j\n\x10RunStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nstarted_at\x18\x03 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x04 \x01(\x01\x12\x10\n\x08revision\x18\x05 \x01(\x04\"\x9a\x01\n\x11NodeStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x10\n\x08revision\x18\x06 \x01(\x04\x12\x12\n\x05\x65rror\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"V\n\x0bLogAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x37\n\x03log\x18\x02 \x01(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\"q\n\x12\x41gentEventAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12:\n\x05\x65vent\x18\x03 \x01(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\"h\n\x0eTraceFinalized\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x35\n\x05trace\x18\x03 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\"J\n\x0f\x43\x61talogReplaced\x12\x37\n\x07\x63\x61talog\x18\x01 \x01(\x0b\x32&.avalanche.operator.CatalogSnapshotMsg\"\xee\x03\n\x0eOperatorUpdate\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x35\n\x0brun_created\x18\x02 \x01(\x0b\x32\x1e.avalanche.operator.RunCreatedH\x00\x12\x42\n\x12run_status_changed\x18\x03 \x01(\x0b\x32$.avalanche.operator.RunStatusChangedH\x00\x12\x44\n\x13node_status_changed\x18\x04 \x01(\x0b\x32%.avalanche.operator.NodeStatusChangedH\x00\x12\x37\n\x0clog_appended\x18\x05 \x01(\x0b\x32\x1f.avalanche.operator.LogAppendedH\x00\x12\x46\n\x14\x61gent_event_appended\x18\x06 \x01(\x0b\x32&.avalanche.operator.AgentEventAppendedH\x00\x12=\n\x0ftrace_finalized\x18\x07 \x01(\x0b\x32\".avalanche.operator.TraceFinalizedH\x00\x12?\n\x10\x63\x61talog_replaced\x18\x08 \x01(\x0b\x32#.avalanche.operator.CatalogReplacedH\x00\x42\x08\n\x06\x63hange\"?\n\rResetRequired\x12\x15\n\rhistory_floor\x18\x01 \x01(\x04\x12\x17\n\x0flatest_sequence\x18\x02 \x01(\x04\"\xb4\x01\n\x16OperatorUpdateEnvelope\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x34\n\x06update\x18\x02 \x01(\x0b\x32\".avalanche.operator.OperatorUpdateH\x00\x12;\n\x0ereset_required\x18\x03 \x01(\x0b\x32!.avalanche.operator.ResetRequiredH\x00\x42\t\n\x07payload2\xf9\x07\n\x0fOperatorService\x12O\n\nGetCatalog\x12\x19.avalanche.operator.Empty\x1a&.avalanche.operator.CatalogSnapshotMsg\x12U\n\x08StartRun\x12#.avalanche.operator.StartRunRequest\x1a$.avalanche.operator.StartRunResponse\x12L\n\tCancelRun\x12$.avalanche.operator.CancelRunRequest\x1a\x19.avalanche.operator.Empty\x12S\n\x0cGetRunResult\x12!.avalanche.operator.GetRunRequest\x1a .avalanche.operator.RunResultMsg\x12\x63\n\x10ListRunSummaries\x12+.avalanche.operator.ListRunSummariesRequest\x1a\".avalanche.operator.RunSummaryPage\x12_\n\x0eGetRunSnapshot\x12).avalanche.operator.GetRunSnapshotRequest\x1a\".avalanche.operator.RunSnapshotMsg\x12L\n\x08ListLogs\x12#.avalanche.operator.ListLogsRequest\x1a\x1b.avalanche.operator.LogPage\x12\x61\n\x0fListAgentEvents\x12*.avalanche.operator.ListAgentEventsRequest\x1a\".avalanche.operator.AgentEventPage\x12S\n\tReadTrace\x12$.avalanche.operator.ReadTraceRequest\x1a\x1e.avalanche.operator.TraceChunk0\x01\x12V\n\nReadDetail\x12%.avalanche.operator.ReadDetailRequest\x1a\x1f.avalanche.operator.DetailChunk0\x01\x12w\n\x15StreamOperatorUpdates\x12\x30.avalanche.operator.StreamOperatorUpdatesRequest\x1a*.avalanche.operator.OperatorUpdateEnvelope0\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -69,76 +69,80 @@ _globals['_READTRACEREQUEST']._serialized_end=904 _globals['_READDETAILREQUEST']._serialized_start=906 _globals['_READDETAILREQUEST']._serialized_end=945 - _globals['_STREAMRUNUPDATESREQUEST']._serialized_start=947 - _globals['_STREAMRUNUPDATESREQUEST']._serialized_end=1026 - _globals['_NODEEDGES']._serialized_start=1028 - _globals['_NODEEDGES']._serialized_end=1057 - _globals['_WORKFLOWTOPOLOGYMSG']._serialized_start=1060 - _globals['_WORKFLOWTOPOLOGYMSG']._serialized_end=1504 - _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_start=1326 - _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_end=1401 - _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_start=1403 - _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_end=1451 - _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_start=1453 - _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_end=1504 - _globals['_FLOWINFOMSG']._serialized_start=1507 - _globals['_FLOWINFOMSG']._serialized_end=2352 - _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_start=1326 - _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_end=1401 - _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_start=1403 - _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_end=1451 - _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_start=1453 - _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_end=1504 - _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_start=2296 - _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_end=2352 - _globals['_FLOWLIST']._serialized_start=2354 - _globals['_FLOWLIST']._serialized_end=2477 - _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_start=2479 - _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_end=2548 - _globals['_RESULTFILEATTACHMENT']._serialized_start=2551 - _globals['_RESULTFILEATTACHMENT']._serialized_end=2697 - _globals['_RUNRESULTMSG']._serialized_start=2699 - _globals['_RUNRESULTMSG']._serialized_end=2790 - _globals['_RUNSUMMARYMSG']._serialized_start=2793 - _globals['_RUNSUMMARYMSG']._serialized_end=3015 - _globals['_TRACEDESCRIPTORMSG']._serialized_start=3018 - _globals['_TRACEDESCRIPTORMSG']._serialized_end=3181 - _globals['_NODESNAPSHOTMSG']._serialized_start=3184 - _globals['_NODESNAPSHOTMSG']._serialized_end=3434 - _globals['_RUNSNAPSHOTMSG']._serialized_start=3437 - _globals['_RUNSNAPSHOTMSG']._serialized_end=3723 - _globals['_RUNSUMMARYPAGE']._serialized_start=3726 - _globals['_RUNSUMMARYPAGE']._serialized_end=3870 - _globals['_LOGRECORDDESCRIPTORMSG']._serialized_start=3873 - _globals['_LOGRECORDDESCRIPTORMSG']._serialized_end=4006 - _globals['_LOGPAGE']._serialized_start=4009 - _globals['_LOGPAGE']._serialized_end=4155 - _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_start=4158 - _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_end=4428 - _globals['_AGENTEVENTPAGE']._serialized_start=4431 - _globals['_AGENTEVENTPAGE']._serialized_end=4620 - _globals['_TRACECHUNK']._serialized_start=4622 - _globals['_TRACECHUNK']._serialized_end=4700 - _globals['_DETAILCHUNK']._serialized_start=4702 - _globals['_DETAILCHUNK']._serialized_end=4763 - _globals['_RUNCREATED']._serialized_start=4766 - _globals['_RUNCREATED']._serialized_end=4941 - _globals['_RUNSTATUSCHANGED']._serialized_start=4943 - _globals['_RUNSTATUSCHANGED']._serialized_end=5049 - _globals['_NODESTATUSCHANGED']._serialized_start=5052 - _globals['_NODESTATUSCHANGED']._serialized_end=5206 - _globals['_LOGAPPENDED']._serialized_start=5208 - _globals['_LOGAPPENDED']._serialized_end=5294 - _globals['_AGENTEVENTAPPENDED']._serialized_start=5296 - _globals['_AGENTEVENTAPPENDED']._serialized_end=5409 - _globals['_TRACEFINALIZED']._serialized_start=5411 - _globals['_TRACEFINALIZED']._serialized_end=5515 - _globals['_RUNUPDATE']._serialized_start=5518 - _globals['_RUNUPDATE']._serialized_end=5942 - _globals['_RESETREQUIRED']._serialized_start=5944 - _globals['_RESETREQUIRED']._serialized_end=6007 - _globals['_RUNUPDATEENVELOPE']._serialized_start=6010 - _globals['_RUNUPDATEENVELOPE']._serialized_end=6180 - _globals['_OPERATORSERVICE']._serialized_start=6183 - _globals['_OPERATORSERVICE']._serialized_end=7174 + _globals['_STREAMOPERATORUPDATESREQUEST']._serialized_start=947 + _globals['_STREAMOPERATORUPDATESREQUEST']._serialized_end=1031 + _globals['_NODEEDGES']._serialized_start=1033 + _globals['_NODEEDGES']._serialized_end=1062 + _globals['_WORKFLOWTOPOLOGYMSG']._serialized_start=1065 + _globals['_WORKFLOWTOPOLOGYMSG']._serialized_end=1509 + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_start=1331 + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_end=1406 + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_start=1408 + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_end=1456 + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_start=1458 + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_end=1509 + _globals['_FLOWINFOMSG']._serialized_start=1512 + _globals['_FLOWINFOMSG']._serialized_end=2357 + _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_start=1331 + _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_end=1406 + _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_start=1408 + _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_end=1456 + _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_start=1458 + _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_end=1509 + _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_start=2301 + _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_end=2357 + _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_start=2359 + _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_end=2428 + _globals['_SCANTARGETMSG']._serialized_start=2430 + _globals['_SCANTARGETMSG']._serialized_end=2495 + _globals['_CATALOGSNAPSHOTMSG']._serialized_start=2498 + _globals['_CATALOGSNAPSHOTMSG']._serialized_end=2764 + _globals['_RESULTFILEATTACHMENT']._serialized_start=2767 + _globals['_RESULTFILEATTACHMENT']._serialized_end=2913 + _globals['_RUNRESULTMSG']._serialized_start=2915 + _globals['_RUNRESULTMSG']._serialized_end=3006 + _globals['_RUNSUMMARYMSG']._serialized_start=3009 + _globals['_RUNSUMMARYMSG']._serialized_end=3231 + _globals['_TRACEDESCRIPTORMSG']._serialized_start=3234 + _globals['_TRACEDESCRIPTORMSG']._serialized_end=3397 + _globals['_NODESNAPSHOTMSG']._serialized_start=3400 + _globals['_NODESNAPSHOTMSG']._serialized_end=3650 + _globals['_RUNSNAPSHOTMSG']._serialized_start=3653 + _globals['_RUNSNAPSHOTMSG']._serialized_end=3939 + _globals['_RUNSUMMARYPAGE']._serialized_start=3942 + _globals['_RUNSUMMARYPAGE']._serialized_end=4086 + _globals['_LOGRECORDDESCRIPTORMSG']._serialized_start=4089 + _globals['_LOGRECORDDESCRIPTORMSG']._serialized_end=4222 + _globals['_LOGPAGE']._serialized_start=4225 + _globals['_LOGPAGE']._serialized_end=4371 + _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_start=4374 + _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_end=4644 + _globals['_AGENTEVENTPAGE']._serialized_start=4647 + _globals['_AGENTEVENTPAGE']._serialized_end=4836 + _globals['_TRACECHUNK']._serialized_start=4838 + _globals['_TRACECHUNK']._serialized_end=4916 + _globals['_DETAILCHUNK']._serialized_start=4918 + _globals['_DETAILCHUNK']._serialized_end=4979 + _globals['_RUNCREATED']._serialized_start=4982 + _globals['_RUNCREATED']._serialized_end=5157 + _globals['_RUNSTATUSCHANGED']._serialized_start=5159 + _globals['_RUNSTATUSCHANGED']._serialized_end=5265 + _globals['_NODESTATUSCHANGED']._serialized_start=5268 + _globals['_NODESTATUSCHANGED']._serialized_end=5422 + _globals['_LOGAPPENDED']._serialized_start=5424 + _globals['_LOGAPPENDED']._serialized_end=5510 + _globals['_AGENTEVENTAPPENDED']._serialized_start=5512 + _globals['_AGENTEVENTAPPENDED']._serialized_end=5625 + _globals['_TRACEFINALIZED']._serialized_start=5627 + _globals['_TRACEFINALIZED']._serialized_end=5731 + _globals['_CATALOGREPLACED']._serialized_start=5733 + _globals['_CATALOGREPLACED']._serialized_end=5807 + _globals['_OPERATORUPDATE']._serialized_start=5810 + _globals['_OPERATORUPDATE']._serialized_end=6304 + _globals['_RESETREQUIRED']._serialized_start=6306 + _globals['_RESETREQUIRED']._serialized_end=6369 + _globals['_OPERATORUPDATEENVELOPE']._serialized_start=6372 + _globals['_OPERATORUPDATEENVELOPE']._serialized_end=6552 + _globals['_OPERATORSERVICE']._serialized_start=6555 + _globals['_OPERATORSERVICE']._serialized_end=7572 # @@protoc_insertion_point(module_scope) diff --git a/src/runtime/operator/proto/operator_pb2.pyi b/src/runtime/operator/proto/operator_pb2.pyi index b5c7f25..d1c48e9 100644 --- a/src/runtime/operator/proto/operator_pb2.pyi +++ b/src/runtime/operator/proto/operator_pb2.pyi @@ -116,7 +116,7 @@ class ReadDetailRequest(_message.Message): body_token: str def __init__(self, body_token: _Optional[str] = ...) -> None: ... -class StreamRunUpdatesRequest(_message.Message): +class StreamOperatorUpdatesRequest(_message.Message): __slots__ = ("operator_instance_id", "after_sequence") OPERATOR_INSTANCE_ID_FIELD_NUMBER: _ClassVar[int] AFTER_SEQUENCE_FIELD_NUMBER: _ClassVar[int] @@ -233,14 +233,6 @@ class FlowInfoMsg(_message.Message): webhook_active: bool def __init__(self, name: _Optional[str] = ..., file_path: _Optional[str] = ..., node_ids: _Optional[_Iterable[str]] = ..., graph: _Optional[_Mapping[str, NodeEdges]] = ..., node_types: _Optional[_Mapping[str, str]] = ..., display_names: _Optional[_Mapping[str, str]] = ..., cron: _Optional[str] = ..., next_run_at: _Optional[float] = ..., last_run_at: _Optional[float] = ..., workflow_id: _Optional[str] = ..., display_name: _Optional[str] = ..., root_alias: _Optional[str] = ..., relative_file: _Optional[str] = ..., builder_symbol: _Optional[str] = ..., agent_node_ids: _Optional[_Iterable[str]] = ..., agent_metadata_json: _Optional[_Mapping[str, str]] = ..., webhook_path: _Optional[str] = ..., webhook_url: _Optional[str] = ..., webhook_active: bool = ...) -> None: ... -class FlowList(_message.Message): - __slots__ = ("flows", "diagnostics") - FLOWS_FIELD_NUMBER: _ClassVar[int] - DIAGNOSTICS_FIELD_NUMBER: _ClassVar[int] - flows: _containers.RepeatedCompositeFieldContainer[FlowInfoMsg] - diagnostics: _containers.RepeatedCompositeFieldContainer[DiscoveryDiagnosticMsg] - def __init__(self, flows: _Optional[_Iterable[_Union[FlowInfoMsg, _Mapping]]] = ..., diagnostics: _Optional[_Iterable[_Union[DiscoveryDiagnosticMsg, _Mapping]]] = ...) -> None: ... - class DiscoveryDiagnosticMsg(_message.Message): __slots__ = ("path", "kind", "message") PATH_FIELD_NUMBER: _ClassVar[int] @@ -251,6 +243,32 @@ class DiscoveryDiagnosticMsg(_message.Message): message: str def __init__(self, path: _Optional[str] = ..., kind: _Optional[str] = ..., message: _Optional[str] = ...) -> None: ... +class ScanTargetMsg(_message.Message): + __slots__ = ("alias", "target_path", "kind") + ALIAS_FIELD_NUMBER: _ClassVar[int] + TARGET_PATH_FIELD_NUMBER: _ClassVar[int] + KIND_FIELD_NUMBER: _ClassVar[int] + alias: str + target_path: str + kind: str + def __init__(self, alias: _Optional[str] = ..., target_path: _Optional[str] = ..., kind: _Optional[str] = ...) -> None: ... + +class CatalogSnapshotMsg(_message.Message): + __slots__ = ("operator_instance_id", "as_of_sequence", "revision", "workflows", "scan_targets", "diagnostics") + OPERATOR_INSTANCE_ID_FIELD_NUMBER: _ClassVar[int] + AS_OF_SEQUENCE_FIELD_NUMBER: _ClassVar[int] + REVISION_FIELD_NUMBER: _ClassVar[int] + WORKFLOWS_FIELD_NUMBER: _ClassVar[int] + SCAN_TARGETS_FIELD_NUMBER: _ClassVar[int] + DIAGNOSTICS_FIELD_NUMBER: _ClassVar[int] + operator_instance_id: str + as_of_sequence: int + revision: int + workflows: _containers.RepeatedCompositeFieldContainer[FlowInfoMsg] + scan_targets: _containers.RepeatedCompositeFieldContainer[ScanTargetMsg] + diagnostics: _containers.RepeatedCompositeFieldContainer[DiscoveryDiagnosticMsg] + def __init__(self, operator_instance_id: _Optional[str] = ..., as_of_sequence: _Optional[int] = ..., revision: _Optional[int] = ..., workflows: _Optional[_Iterable[_Union[FlowInfoMsg, _Mapping]]] = ..., scan_targets: _Optional[_Iterable[_Union[ScanTargetMsg, _Mapping]]] = ..., diagnostics: _Optional[_Iterable[_Union[DiscoveryDiagnosticMsg, _Mapping]]] = ...) -> None: ... + class ResultFileAttachment(_message.Message): __slots__ = ("attachment_id", "name", "content", "media_type", "sha256") ATTACHMENT_ID_FIELD_NUMBER: _ClassVar[int] @@ -529,8 +547,14 @@ class TraceFinalized(_message.Message): trace: TraceDescriptorMsg def __init__(self, run_id: _Optional[str] = ..., node_id: _Optional[str] = ..., trace: _Optional[_Union[TraceDescriptorMsg, _Mapping]] = ...) -> None: ... -class RunUpdate(_message.Message): - __slots__ = ("sequence", "run_created", "run_status_changed", "node_status_changed", "log_appended", "agent_event_appended", "trace_finalized") +class CatalogReplaced(_message.Message): + __slots__ = ("catalog",) + CATALOG_FIELD_NUMBER: _ClassVar[int] + catalog: CatalogSnapshotMsg + def __init__(self, catalog: _Optional[_Union[CatalogSnapshotMsg, _Mapping]] = ...) -> None: ... + +class OperatorUpdate(_message.Message): + __slots__ = ("sequence", "run_created", "run_status_changed", "node_status_changed", "log_appended", "agent_event_appended", "trace_finalized", "catalog_replaced") SEQUENCE_FIELD_NUMBER: _ClassVar[int] RUN_CREATED_FIELD_NUMBER: _ClassVar[int] RUN_STATUS_CHANGED_FIELD_NUMBER: _ClassVar[int] @@ -538,6 +562,7 @@ class RunUpdate(_message.Message): LOG_APPENDED_FIELD_NUMBER: _ClassVar[int] AGENT_EVENT_APPENDED_FIELD_NUMBER: _ClassVar[int] TRACE_FINALIZED_FIELD_NUMBER: _ClassVar[int] + CATALOG_REPLACED_FIELD_NUMBER: _ClassVar[int] sequence: int run_created: RunCreated run_status_changed: RunStatusChanged @@ -545,7 +570,8 @@ class RunUpdate(_message.Message): log_appended: LogAppended agent_event_appended: AgentEventAppended trace_finalized: TraceFinalized - def __init__(self, sequence: _Optional[int] = ..., run_created: _Optional[_Union[RunCreated, _Mapping]] = ..., run_status_changed: _Optional[_Union[RunStatusChanged, _Mapping]] = ..., node_status_changed: _Optional[_Union[NodeStatusChanged, _Mapping]] = ..., log_appended: _Optional[_Union[LogAppended, _Mapping]] = ..., agent_event_appended: _Optional[_Union[AgentEventAppended, _Mapping]] = ..., trace_finalized: _Optional[_Union[TraceFinalized, _Mapping]] = ...) -> None: ... + catalog_replaced: CatalogReplaced + def __init__(self, sequence: _Optional[int] = ..., run_created: _Optional[_Union[RunCreated, _Mapping]] = ..., run_status_changed: _Optional[_Union[RunStatusChanged, _Mapping]] = ..., node_status_changed: _Optional[_Union[NodeStatusChanged, _Mapping]] = ..., log_appended: _Optional[_Union[LogAppended, _Mapping]] = ..., agent_event_appended: _Optional[_Union[AgentEventAppended, _Mapping]] = ..., trace_finalized: _Optional[_Union[TraceFinalized, _Mapping]] = ..., catalog_replaced: _Optional[_Union[CatalogReplaced, _Mapping]] = ...) -> None: ... class ResetRequired(_message.Message): __slots__ = ("history_floor", "latest_sequence") @@ -555,12 +581,12 @@ class ResetRequired(_message.Message): latest_sequence: int def __init__(self, history_floor: _Optional[int] = ..., latest_sequence: _Optional[int] = ...) -> None: ... -class RunUpdateEnvelope(_message.Message): +class OperatorUpdateEnvelope(_message.Message): __slots__ = ("operator_instance_id", "update", "reset_required") OPERATOR_INSTANCE_ID_FIELD_NUMBER: _ClassVar[int] UPDATE_FIELD_NUMBER: _ClassVar[int] RESET_REQUIRED_FIELD_NUMBER: _ClassVar[int] operator_instance_id: str - update: RunUpdate + update: OperatorUpdate reset_required: ResetRequired - def __init__(self, operator_instance_id: _Optional[str] = ..., update: _Optional[_Union[RunUpdate, _Mapping]] = ..., reset_required: _Optional[_Union[ResetRequired, _Mapping]] = ...) -> None: ... + def __init__(self, operator_instance_id: _Optional[str] = ..., update: _Optional[_Union[OperatorUpdate, _Mapping]] = ..., reset_required: _Optional[_Union[ResetRequired, _Mapping]] = ...) -> None: ... diff --git a/src/runtime/operator/proto/operator_pb2_grpc.py b/src/runtime/operator/proto/operator_pb2_grpc.py index 775e6f4..6db1488 100644 --- a/src/runtime/operator/proto/operator_pb2_grpc.py +++ b/src/runtime/operator/proto/operator_pb2_grpc.py @@ -40,10 +40,10 @@ def __init__(self, channel): Args: channel: A grpc.Channel. """ - self.ListFlows = channel.unary_unary( - '/avalanche.operator.OperatorService/ListFlows', + self.GetCatalog = channel.unary_unary( + '/avalanche.operator.OperatorService/GetCatalog', request_serializer=operator__pb2.Empty.SerializeToString, - response_deserializer=operator__pb2.FlowList.FromString, + response_deserializer=operator__pb2.CatalogSnapshotMsg.FromString, _registered_method=True) self.StartRun = channel.unary_unary( '/avalanche.operator.OperatorService/StartRun', @@ -90,10 +90,10 @@ def __init__(self, channel): request_serializer=operator__pb2.ReadDetailRequest.SerializeToString, response_deserializer=operator__pb2.DetailChunk.FromString, _registered_method=True) - self.StreamRunUpdates = channel.unary_stream( - '/avalanche.operator.OperatorService/StreamRunUpdates', - request_serializer=operator__pb2.StreamRunUpdatesRequest.SerializeToString, - response_deserializer=operator__pb2.RunUpdateEnvelope.FromString, + self.StreamOperatorUpdates = channel.unary_stream( + '/avalanche.operator.OperatorService/StreamOperatorUpdates', + request_serializer=operator__pb2.StreamOperatorUpdatesRequest.SerializeToString, + response_deserializer=operator__pb2.OperatorUpdateEnvelope.FromString, _registered_method=True) @@ -106,7 +106,7 @@ class OperatorServiceServicer(object): """ - def ListFlows(self, request, context): + def GetCatalog(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -166,7 +166,7 @@ def ReadDetail(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def StreamRunUpdates(self, request, context): + def StreamOperatorUpdates(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -175,10 +175,10 @@ def StreamRunUpdates(self, request, context): def add_OperatorServiceServicer_to_server(servicer, server): rpc_method_handlers = { - 'ListFlows': grpc.unary_unary_rpc_method_handler( - servicer.ListFlows, + 'GetCatalog': grpc.unary_unary_rpc_method_handler( + servicer.GetCatalog, request_deserializer=operator__pb2.Empty.FromString, - response_serializer=operator__pb2.FlowList.SerializeToString, + response_serializer=operator__pb2.CatalogSnapshotMsg.SerializeToString, ), 'StartRun': grpc.unary_unary_rpc_method_handler( servicer.StartRun, @@ -225,10 +225,10 @@ def add_OperatorServiceServicer_to_server(servicer, server): request_deserializer=operator__pb2.ReadDetailRequest.FromString, response_serializer=operator__pb2.DetailChunk.SerializeToString, ), - 'StreamRunUpdates': grpc.unary_stream_rpc_method_handler( - servicer.StreamRunUpdates, - request_deserializer=operator__pb2.StreamRunUpdatesRequest.FromString, - response_serializer=operator__pb2.RunUpdateEnvelope.SerializeToString, + 'StreamOperatorUpdates': grpc.unary_stream_rpc_method_handler( + servicer.StreamOperatorUpdates, + request_deserializer=operator__pb2.StreamOperatorUpdatesRequest.FromString, + response_serializer=operator__pb2.OperatorUpdateEnvelope.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -248,7 +248,7 @@ class OperatorService(object): """ @staticmethod - def ListFlows(request, + def GetCatalog(request, target, options=(), channel_credentials=None, @@ -261,9 +261,9 @@ def ListFlows(request, return grpc.experimental.unary_unary( request, target, - '/avalanche.operator.OperatorService/ListFlows', + '/avalanche.operator.OperatorService/GetCatalog', operator__pb2.Empty.SerializeToString, - operator__pb2.FlowList.FromString, + operator__pb2.CatalogSnapshotMsg.FromString, options, channel_credentials, insecure, @@ -518,7 +518,7 @@ def ReadDetail(request, _registered_method=True) @staticmethod - def StreamRunUpdates(request, + def StreamOperatorUpdates(request, target, options=(), channel_credentials=None, @@ -531,9 +531,9 @@ def StreamRunUpdates(request, return grpc.experimental.unary_stream( request, target, - '/avalanche.operator.OperatorService/StreamRunUpdates', - operator__pb2.StreamRunUpdatesRequest.SerializeToString, - operator__pb2.RunUpdateEnvelope.FromString, + '/avalanche.operator.OperatorService/StreamOperatorUpdates', + operator__pb2.StreamOperatorUpdatesRequest.SerializeToString, + operator__pb2.OperatorUpdateEnvelope.FromString, options, channel_credentials, insecure, diff --git a/src/runtime/operator/registry.py b/src/runtime/operator/registry.py index e9209a2..7d6acd2 100644 --- a/src/runtime/operator/registry.py +++ b/src/runtime/operator/registry.py @@ -5,6 +5,7 @@ import json import threading from collections import defaultdict +from dataclasses import replace from types import MappingProxyType from typing import Callable @@ -13,6 +14,7 @@ from .discovery import ConfiguredRoot, configure_roots, discover, load_builder from .models import ( CatalogView, + ScanTargetInfo, WorkflowDescriptor, WorkflowDiscoveryDiagnostic, WorkflowInfo, @@ -134,17 +136,78 @@ def scan( *, validate: Callable[[tuple[WorkflowDescriptor, ...]], object] | None = None, ) -> CatalogView: - """Build a complete catalog off-lock, then atomically install it.""" + """Configure roots and atomically install one complete valid catalog.""" roots = configure_roots(paths) + with self._lock: + self._scan_paths = tuple(paths) + self._roots = roots + return self._scan_roots(roots, validate=validate) + + def rescan( + self, + *, + validate: Callable[[tuple[WorkflowDescriptor, ...]], object] | None = None, + ) -> CatalogView: + """Refresh configured roots while preserving the last valid catalog.""" + with self._lock: + roots = self._roots + if not roots: + return self.view + return self._scan_roots(roots, validate=validate) + + def _scan_roots( + self, + roots: tuple[ConfiguredRoot, ...], + *, + validate: Callable[[tuple[WorkflowDescriptor, ...]], object] | None, + ) -> CatalogView: descriptors, diagnostics = discover(roots, timeout=self._discovery_timeout) - if validate is not None: - validate(descriptors) + candidate_diagnostics = list(diagnostics) + try: + if validate is not None: + validate(descriptors) + except ValueError as exc: + candidate_diagnostics.append( + WorkflowDiscoveryDiagnostic( + path=", ".join(str(root.target) for root in roots), + kind="invalid_catalog", + message=str(exc), + ) + ) by_id: dict[str, WorkflowDescriptor] = {} for descriptor in descriptors: if descriptor.workflow_id in by_id: - raise ValueError(f"Duplicate canonical workflow ID: {descriptor.workflow_id}") + candidate_diagnostics.append( + WorkflowDiscoveryDiagnostic( + path=descriptor.locator.relative_file, + kind="invalid_catalog", + message=f"Duplicate canonical workflow ID: {descriptor.workflow_id}", + ) + ) + break by_id[descriptor.workflow_id] = descriptor + + scan_targets = tuple( + ScanTargetInfo( + alias=root.alias, + target_path=str(root.target), + kind="directory" if root.target == root.path else "file", + ) + for root in roots + ) + diagnostics_tuple = tuple(candidate_diagnostics) + candidate_failed = any(item.kind != "skipped" for item in diagnostics_tuple) + if candidate_failed: + with self._lock: + self._view = replace( + self._view, + scan_targets=scan_targets, + diagnostics=diagnostics_tuple, + ) + return self._view + + by_id = dict(sorted(by_id.items())) short_names: defaultdict[str, list[str]] = defaultdict(list) for descriptor in descriptors: short_names[descriptor.display_name].append(descriptor.workflow_id) @@ -153,28 +216,16 @@ def scan( name: tuple(sorted(set(candidate_ids))) for name, candidate_ids in short_names.items() } - view = CatalogView( - by_id=MappingProxyType(dict(sorted(by_id.items()))), - short_names=MappingProxyType(dict(sorted(frozen_short_names.items()))), - diagnostics=diagnostics, - ) with self._lock: - self._scan_paths = tuple(paths) - self._roots = roots + view = CatalogView( + revision=self._view.revision + 1, + by_id=MappingProxyType(by_id), + short_names=MappingProxyType(dict(sorted(frozen_short_names.items()))), + scan_targets=scan_targets, + diagnostics=diagnostics_tuple, + ) self._view = view - return view - - def rescan( - self, - *, - validate: Callable[[tuple[WorkflowDescriptor, ...]], object] | None = None, - ) -> CatalogView: - """Refresh configured roots without retaining a last-good descriptor.""" - with self._lock: - paths = list(self._scan_paths) - if not paths: - return self.view - return self.scan(paths, validate=validate) + return view def resolve(self, selector: str) -> WorkflowDescriptor: descriptor, _ = self.resolve_source(selector) @@ -210,8 +261,9 @@ def register(self, builder: Callable[[], Workflow], file_path: str = "") with self._lock: self._manual[workflow.name] = (builder, info) - def list_workflows(self) -> list[WorkflowInfo]: - scanned = [descriptor_to_info(item) for item in self.descriptors()] + def list_workflows(self, view: CatalogView | None = None) -> list[WorkflowInfo]: + catalog = view if view is not None else self.view + scanned = [descriptor_to_info(item) for item in catalog.by_id.values()] with self._lock: manual = [entry[1] for entry in self._manual.values()] return scanned + manual diff --git a/src/runtime/operator/server.py b/src/runtime/operator/server.py index 6a2f03f..52f652e 100644 --- a/src/runtime/operator/server.py +++ b/src/runtime/operator/server.py @@ -18,12 +18,11 @@ from ._grpc import _BOUNDED_MESSAGE_OPTIONS from .convert import ( agent_event_descriptor_to_proto, - discovery_diagnostic_to_proto, + catalog_snapshot_to_proto, log_record_descriptor_to_proto, + operator_update_envelope_to_proto, run_snapshot_to_proto, run_summary_to_proto, - run_update_envelope_to_proto, - workflow_info_to_proto, ) from .operator import ( InvalidRunIdError, @@ -50,14 +49,8 @@ class OperatorServicer(pb_grpc.OperatorServiceServicer): def __init__(self, operator: Operator) -> None: self._op = operator - def ListFlows(self, request, context): # noqa: N802 - workflows = self._op.list_workflows() - return pb.FlowList( - flows=[workflow_info_to_proto(p) for p in workflows], - diagnostics=[ - discovery_diagnostic_to_proto(item) for item in self._op.list_diagnostics() - ], - ) + def GetCatalog(self, request, context): # noqa: N802 + return catalog_snapshot_to_proto(self._op.get_catalog()) def StartRun(self, request, context): # noqa: N802 try: @@ -237,9 +230,9 @@ def ReadDetail(self, request, context): # noqa: N802 eof=offset + len(chunk) == len(data), ) - def StreamRunUpdates(self, request, context): # noqa: N802 - """Replay typed updates for one operator epoch, or require a reset.""" - subscription = self._op.subscribe_run_updates( + def StreamOperatorUpdates(self, request, context): # noqa: N802 + """Replay typed operator updates for one epoch, or require a reset.""" + subscription = self._op.subscribe_operator_updates( request.operator_instance_id, request.after_sequence, ) @@ -250,11 +243,11 @@ def StreamRunUpdates(self, request, context): # noqa: N802 envelope = subscription.get(timeout=1.0) except queue.Empty: continue - yield run_update_envelope_to_proto(envelope) + yield operator_update_envelope_to_proto(envelope) if envelope.reset_required is not None: return finally: - self._op.unsubscribe_run_updates(subscription) + self._op.unsubscribe_operator_updates(subscription) def serve( diff --git a/src/tui/app.py b/src/tui/app.py index 3e5ee5d..819a989 100644 --- a/src/tui/app.py +++ b/src/tui/app.py @@ -161,6 +161,7 @@ def on_mount(self) -> None: self.push_screen(self._screen) self.store.provider.on_run_update(self._on_run_update_bg) + self.store.provider.on_catalog_update(self.store.enqueue_catalog_update) self.store.provider.on_detail_update(self.store.enqueue_detail_update) self.store.provider.on_log(lambda _: None) self.store.provider.start_stream() diff --git a/src/tui/mock.py b/src/tui/mock.py index c416780..79aee5d 100644 --- a/src/tui/mock.py +++ b/src/tui/mock.py @@ -10,6 +10,7 @@ from uuid import uuid4 from .models import ( + CatalogSnapshot, DetailUpdate, LogDetailAppended, LogEntry, @@ -562,6 +563,7 @@ def __init__(self, *, include_agent_trace: bool = False) -> None: self._workflows[AGENT_TRACE_WORKFLOW.selector] = AGENT_TRACE_WORKFLOW self._runs: dict[str, RunState] = {} self._run_callbacks: list[Callable[[RunState], None]] = [] + self._catalog_callbacks: list[Callable[[CatalogSnapshot], None]] = [] self._log_callbacks: list[Callable[[LogEntry], None]] = [] self._detail_callbacks: list[Callable[[DetailUpdate], None]] = [] self._stream_reset_callbacks: list[Callable[[StreamResetNotice], None]] = [] @@ -837,9 +839,18 @@ def cancel_run(self, run_id: str) -> None: ns.ended_at = time.monotonic() self._notify_run(run) + def get_catalog(self) -> CatalogSnapshot: + return CatalogSnapshot( + operator_instance_id=self.operator_instance_id, + workflows=tuple(self.list_workflows()), + ) + def on_run_update(self, callback: Callable[[RunState], None]) -> None: self._run_callbacks.append(callback) + def on_catalog_update(self, callback: Callable[[CatalogSnapshot], None]) -> None: + self._catalog_callbacks.append(callback) + def on_log(self, callback: Callable[[LogEntry], None]) -> None: self._log_callbacks.append(callback) @@ -853,15 +864,15 @@ def on_stream_reset(self, callback: Callable[[StreamResetNotice], None]) -> None self._stream_reset_callbacks.append(callback) def load_reset_baseline(self, notice: StreamResetNotice) -> ResetBaseline: - workflows = tuple(self.list_workflows()) + catalog = self.get_catalog() return ResetBaseline( generation=notice.generation, operator_instance_id=self.operator_instance_id, as_of_sequence=0, - workflows=workflows, + catalog=catalog, runs_by_workflow={ workflow.selector: tuple(self.list_runs(workflow.selector)) - for workflow in workflows + for workflow in catalog.workflows }, ) diff --git a/src/tui/models.py b/src/tui/models.py index fe431df..8d6b8b1 100644 --- a/src/tui/models.py +++ b/src/tui/models.py @@ -2,6 +2,7 @@ from avalanche.operator.models import ( AgentEventDetailAppended, + CatalogSnapshot, DetailUpdate, LogDetailAppended, LogEntry, @@ -19,6 +20,7 @@ __all__ = [ "AgentEventDetailAppended", + "CatalogSnapshot", "DetailUpdate", "LogEntry", "LogLevel", diff --git a/src/tui/state.py b/src/tui/state.py index f5e04b6..7af12ee 100644 --- a/src/tui/state.py +++ b/src/tui/state.py @@ -5,6 +5,7 @@ from typing import Any, Callable, Protocol, runtime_checkable from .models import ( + CatalogSnapshot, DetailUpdate, LogEntry, ResetBaseline, @@ -25,6 +26,8 @@ class StateProvider(Protocol): def list_workflows(self) -> list[WorkflowInfo]: ... + def get_catalog(self) -> CatalogSnapshot: ... + def list_runs(self, workflow_selector: str) -> list[RunState]: ... def get_run(self, run_id: str) -> RunState | None: ... @@ -40,6 +43,8 @@ def cancel_run(self, run_id: str) -> None: ... def on_run_update(self, callback: Callable[[RunState], None]) -> None: ... + def on_catalog_update(self, callback: Callable[[CatalogSnapshot], None]) -> None: ... + def on_log(self, callback: Callable[[LogEntry], None]) -> None: ... def on_detail_update(self, callback: Callable[[DetailUpdate], None]) -> None: ... def start_stream(self) -> None: diff --git a/src/tui/ui_store.py b/src/tui/ui_store.py index 96122c0..c16ca69 100644 --- a/src/tui/ui_store.py +++ b/src/tui/ui_store.py @@ -16,6 +16,7 @@ from .dag_layout import DagNode, SeqGroup, build_nav_grid, nav_move, workflow_to_layout from .models import ( AgentEventDetailAppended, + CatalogSnapshot, DetailUpdate, LogDetailAppended, LogEntry, @@ -269,6 +270,7 @@ def __init__( self.workflows: list[WorkflowInfo] = ( [] if defer_initial_catalog else provider.list_workflows() ) + self.catalog = CatalogSnapshot(workflows=tuple(self.workflows)) self.current_workflow: WorkflowInfo | None = None self.current_run: RunState | None = None self.run_pinned: bool = False # True = user picked a run; False = follow latest @@ -1283,6 +1285,10 @@ def enqueue_polled_run_update( ("polled_run", (selector, data_revision, context_epoch, run)) ) + def enqueue_catalog_update(self, catalog: CatalogSnapshot) -> None: + """Queue one authoritative catalog replacement for the UI thread.""" + self._background_updates.put(("catalog_replaced", catalog)) + @staticmethod def _reset_baseline_validation_error( notice: StreamResetNotice, @@ -2368,6 +2374,13 @@ def _apply_background_updates(self) -> None: except Exception as exc: self.run_error = f"Live state reset failed: {exc}" continue + if kind == "catalog_replaced": + catalog = payload + if catalog.revision >= self.catalog_revision: + self.catalog = catalog + self.catalog_revision = catalog.revision + self._reconcile_workflows(list(catalog.workflows)) + continue if kind == "catalog": self._catalog_refresh_in_flight = False context_epoch, workflows = payload @@ -2539,12 +2552,14 @@ def _apply_reset_baseline(self, baseline: ResetBaseline) -> None: self.current_run.run_id if self.run_pinned and self.current_run else None ) previous_selectors = {workflow.selector for workflow in self.workflows} - baseline_selectors = {workflow.selector for workflow in baseline.workflows} + baseline_selectors = {workflow.selector for workflow in baseline.catalog.workflows} self._workflow_context_epoch += 1 for selector in previous_selectors | baseline_selectors: self._advance_run_data_revision(selector) - self._reconcile_workflows(list(baseline.workflows)) + self.catalog = baseline.catalog + self.catalog_revision = baseline.catalog.revision + self._reconcile_workflows(list(baseline.catalog.workflows)) # A selection change can schedule a refresh during reconciliation. Invalidate # it too so a pre-baseline response cannot overwrite authoritative state. for selector in previous_selectors | baseline_selectors: diff --git a/test/operator_tests/test_grpc.py b/test/operator_tests/test_grpc.py index 21b5601..e0562e1 100644 --- a/test/operator_tests/test_grpc.py +++ b/test/operator_tests/test_grpc.py @@ -26,6 +26,7 @@ workflow_info_to_proto, ) from avalanche.operator.models import ( + CatalogSnapshot, NodeSnapshot, NodeState, NodeStatus, @@ -512,11 +513,11 @@ def details(self): return "stream offline" class SplitHealthStub: - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 raise Unavailable() - def ListFlows(self, request, **kwargs): # noqa: N802 - return pb.FlowList() + def GetCatalog(self, request, **kwargs): # noqa: N802 + return pb.CatalogSnapshotMsg() provider._stub = SplitHealthStub() try: @@ -560,7 +561,7 @@ def details(self): return "operation failed" class ErrorStub: - def ListFlows(self, request, **kwargs): # noqa: N802 + def GetCatalog(self, request, **kwargs): # noqa: N802 raise RpcFailure() provider._stub = ErrorStub() @@ -626,7 +627,7 @@ def ReadTrace(self, request, **kwargs): # noqa: N802 try: detail = provider.hydrate_trace("run-trace-health", "agent") assert detail is not None - assert detail.trace_body == {"complete": True} + assert detail.trace_body == {"complete": True, "steps": []} assert provider.operator_reachable is True assert provider.stream_state is StreamState.FAILED assert provider.stream_error == "UNAVAILABLE: live updates interrupted" @@ -689,7 +690,7 @@ def ReadTrace(self, request, **kwargs): # noqa: N802 for run_id in runs: detail = provider.hydrate_trace(run_id, "agent") assert detail is not None - assert detail.trace_body == {} + assert detail.trace_body == {"steps": []} assert provider._retained_detail_count <= 2 assert provider._retained_detail_bytes <= 4 assert len(provider._detail_cache_usage) <= 2 @@ -996,12 +997,12 @@ def details(self): return "late application error" class BlockingStub: - def ListFlows(self, request, **kwargs): # noqa: N802 + def GetCatalog(self, request, **kwargs): # noqa: N802 entered.set() assert release.wait(timeout=1.0) if status is not None: raise RpcFailure() - return pb.FlowList() + return pb.CatalogSnapshotMsg() def invoke() -> None: try: @@ -1055,7 +1056,7 @@ def __next__(self): raise StopIteration class IdleStub: - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 return IdleStream() provider._stub = IdleStub() @@ -1133,7 +1134,7 @@ def __iter__(self): raise Unavailable() class FailingStub: - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 return AcceptedThenUnavailable() provider._stream_stop = RecordingStop() @@ -1174,9 +1175,9 @@ def wait(self, delay): self.stopped = True return self.stopped - duplicate = pb.RunUpdateEnvelope( + duplicate = pb.OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=pb.RunUpdate( + update=pb.OperatorUpdate( sequence=7, run_created=pb.RunCreated( summary=pb.RunSummaryMsg( @@ -1199,7 +1200,7 @@ def __iter__(self): raise Unavailable() class DuplicateStub: - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 requests.append((request.operator_instance_id, request.after_sequence)) return DuplicateThenUnavailable() @@ -1248,9 +1249,9 @@ def initial_metadata(self): return () def __iter__(self): - yield pb.RunUpdateEnvelope( + yield pb.OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=pb.RunUpdate( + update=pb.OperatorUpdate( sequence=1, run_created=pb.RunCreated( summary=pb.RunSummaryMsg( @@ -1269,7 +1270,7 @@ class ProgressStub: def __init__(self): self.calls = 0 - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 self.calls += 1 if self.calls == 1: raise Unavailable() @@ -1315,7 +1316,7 @@ class ReconnectingStub: def __init__(self): self.calls = 0 - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 self.calls += 1 observed.append(provider.stream_state) if self.calls == 1: @@ -1328,9 +1329,9 @@ def initial_metadata(self): def __iter__(self): observed.append(provider.stream_state) - yield pb.RunUpdateEnvelope( + yield pb.OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=pb.RunUpdate( + update=pb.OperatorUpdate( sequence=1, run_created=pb.RunCreated( summary=pb.RunSummaryMsg( @@ -1542,9 +1543,13 @@ def ListRunSummaries(self, request, **kwargs): # noqa: N802 runs=[run_summary_to_proto(summaries[1])], ) - def ListFlows(self, request, **kwargs): # noqa: N802 + def GetCatalog(self, request, **kwargs): # noqa: N802 self.list_flows_calls += 1 - return pb.FlowList(flows=[workflow_info_to_proto(workflow)]) + return pb.CatalogSnapshotMsg( + operator_instance_id="operator-new", + as_of_sequence=3, + workflows=[workflow_info_to_proto(workflow)], + ) def GetRunSnapshot(self, request, **kwargs): # noqa: N802 self.snapshot_calls.append(request.run_id) @@ -1571,7 +1576,7 @@ def GetRunSnapshot(self, request, **kwargs): # noqa: N802 assert baseline.generation == 7 assert baseline.operator_instance_id == "operator-new" assert baseline.as_of_sequence == 3 - assert [item.selector for item in baseline.workflows] == [workflow.selector] + assert [item.selector for item in baseline.catalog.workflows] == [workflow.selector] assert [run.run_id for run in baseline.runs_by_workflow[workflow.selector]] == [ "run_1", "run_2", @@ -1615,8 +1620,12 @@ def __init__(self): self.summary_calls = 0 self.snapshot_requests = [] - def ListFlows(self, request, **kwargs): # noqa: N802 - return pb.FlowList(flows=[workflow_info_to_proto(workflow)]) + def GetCatalog(self, request, **kwargs): # noqa: N802 + return pb.CatalogSnapshotMsg( + operator_instance_id="operator-live", + as_of_sequence=self.current_sequence, + workflows=[workflow_info_to_proto(workflow)], + ) def ListRunSummaries(self, request, **kwargs): # noqa: N802 self.summary_calls += 1 @@ -1662,7 +1671,7 @@ def load_baseline(notice): generation=notice.generation, operator_instance_id="operator-restarted", as_of_sequence=3, - workflows=(), + catalog=CatalogSnapshot(workflows=()), runs_by_workflow={}, ) @@ -1676,9 +1685,9 @@ def load_baseline(notice): release = threading.Event() received = [] - reset_envelope = pb.RunUpdateEnvelope( + reset_envelope = pb.OperatorUpdateEnvelope( operator_instance_id="operator-restarted", - update=pb.RunUpdate( + update=pb.OperatorUpdate( sequence=2, run_created=pb.RunCreated( summary=pb.RunSummaryMsg( @@ -1697,9 +1706,9 @@ def initial_metadata(self): return () def __iter__(self): - yield pb.RunUpdateEnvelope( + yield pb.OperatorUpdateEnvelope( operator_instance_id="operator-restarted", - update=pb.RunUpdate( + update=pb.OperatorUpdate( sequence=4, run_created=pb.RunCreated( summary=pb.RunSummaryMsg( @@ -1719,7 +1728,7 @@ class RestartedStub: def __init__(self): self.calls = 0 - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 self.calls += 1 assert metadata is None if self.calls == 1: @@ -1797,7 +1806,7 @@ def test_reset_acknowledgement_requires_exact_validated_baseline( generation=notice.generation, operator_instance_id="operator-restarted", as_of_sequence=3, - workflows=(), + catalog=CatalogSnapshot(workflows=()), runs_by_workflow={}, ) provider = GrpcStateProvider( @@ -1848,13 +1857,13 @@ def test_update_epoch_change_requires_reset_at_equal_or_higher_sequence( reset_observed = threading.Event() class RestartedStub: - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 assert request.operator_instance_id == "operator-original" assert request.after_sequence == 99 assert metadata is None - yield pb.RunUpdateEnvelope( + yield pb.OperatorUpdateEnvelope( operator_instance_id="operator-restarted", - update=pb.RunUpdate( + update=pb.OperatorUpdate( sequence=observed_sequence, run_created=pb.RunCreated( summary=pb.RunSummaryMsg( @@ -1898,14 +1907,14 @@ def test_client_skips_duplicate_update_sequence_without_epoch_reset(): received = [] class DuplicateFirstStub: - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 assert request.operator_instance_id == "operator-1" assert request.after_sequence == 99 assert metadata is None for sequence, run_id in ((99, "duplicate"), (100, "run_live")): - yield pb.RunUpdateEnvelope( + yield pb.OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=pb.RunUpdate( + update=pb.OperatorUpdate( sequence=sequence, run_created=pb.RunCreated( summary=pb.RunSummaryMsg( @@ -1944,7 +1953,7 @@ def __init__(self): self.calls = 0 self.thread_ids = set() - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 self.calls += 1 self.thread_ids.add(threading.get_ident()) @@ -2003,7 +2012,7 @@ def __init__(self): self.calls = 0 self.post_close_calls = 0 - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 self.calls += 1 if close_returned.is_set(): self.post_close_calls += 1 @@ -2053,7 +2062,7 @@ class FailingStub: def __init__(self): self.calls = 0 - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 self.calls += 1 called.set() raise Unavailable() @@ -2086,9 +2095,9 @@ def __init__(self): self.start_request = None self.list_request = None - def ListFlows(self, request, **kwargs): # noqa: N802 - return pb.FlowList( - flows=[ + def GetCatalog(self, request, **kwargs): # noqa: N802 + return pb.CatalogSnapshotMsg( + workflows=[ pb.FlowInfoMsg( name="Daily report", display_name="Daily report", @@ -2133,9 +2142,9 @@ def _capture(self, name, timeout): assert timeout is not None assert 0 < timeout < float("inf") - def ListFlows(self, request, *, timeout, **kwargs): # noqa: N802 + def GetCatalog(self, request, *, timeout, **kwargs): # noqa: N802 self._capture("list", timeout) - return pb.FlowList() + return pb.CatalogSnapshotMsg() def StartRun(self, request, *, timeout, **kwargs): # noqa: N802 self._capture("start", timeout) diff --git a/test/operator_tests/test_grpc_client_auth_tls.py b/test/operator_tests/test_grpc_client_auth_tls.py index 9e28e9f..3759a00 100644 --- a/test/operator_tests/test_grpc_client_auth_tls.py +++ b/test/operator_tests/test_grpc_client_auth_tls.py @@ -91,8 +91,8 @@ def fake_insecure_channel(address: str, *, options): class AuthenticatedOperatorService(pb_grpc.OperatorServiceServicer): - def ListFlows(self, request, context): # noqa: N802 + def GetCatalog(self, request, context): # noqa: N802 authorization = dict(context.invocation_metadata()).get("authorization") if authorization != "Bearer secret": context.abort(grpc.StatusCode.UNAUTHENTICATED, "missing_bearer") - return pb.FlowList(flows=[pb.FlowInfoMsg(name="demo-flow")]) + return pb.CatalogSnapshotMsg(workflows=[pb.FlowInfoMsg(name="demo-flow")]) diff --git a/test/operator_tests/test_operator.py b/test/operator_tests/test_operator.py index e015809..1f07b28 100644 --- a/test/operator_tests/test_operator.py +++ b/test/operator_tests/test_operator.py @@ -196,7 +196,7 @@ def test_list_runs_filters_by_workflow(self): runs = op.list_runs("nonexistent") assert len(runs) == 0 - def test_refresh_invalid_file_removes_descriptor_and_schedule(self, tmp_path): + def test_refresh_invalid_file_retains_descriptor_and_schedule(self, tmp_path): workflow_file = tmp_path / "scheduled.py" workflow_file.write_text( "import avalanche as ava\n" @@ -213,8 +213,11 @@ def test_refresh_invalid_file_removes_descriptor_and_schedule(self, tmp_path): workflow_file.write_text("invalid Python !!!\n") operator._refresh_workflows() - assert operator.list_workflows() == [] - assert operator._scheduler.list_schedules() == [] + assert [item.workflow_id for item in operator.list_workflows()] == [ + "scheduled.py::scheduled" + ] + assert len(operator._scheduler.list_schedules()) == 1 + assert [item.kind for item in operator.list_diagnostics()] == ["import_error"] @pytest.mark.parametrize( "factory", @@ -447,7 +450,7 @@ def _make_operator(self): def test_subscribe_receives_updates(self): op = self._make_operator() - q = op.subscribe_run_updates() + q = op.subscribe_operator_updates() run_id = op.start_run("simple_workflow") @@ -467,7 +470,7 @@ def test_subscribe_receives_updates(self): updates.append(q.get_nowait().update) break - op.unsubscribe_run_updates(q) + op.unsubscribe_operator_updates(q) # Every accepted mutation is delivered once in global sequence order. assert len(updates) >= 2 @@ -485,8 +488,8 @@ def test_replays_exact_missed_updates_within_retained_history(self): run.status = RunStatus.SUCCESS op._notify_run(run) - assert op.subscribe_run_updates(op.operator_instance_id, 3).empty() - replay = op.subscribe_run_updates(op.operator_instance_id, 1) + assert op.subscribe_operator_updates(op.operator_instance_id, 3).empty() + replay = op.subscribe_operator_updates(op.operator_instance_id, 1) envelopes = [replay.get_nowait() for _ in range(2)] assert [item.update.sequence for item in envelopes] == [2, 3] @@ -510,7 +513,7 @@ def test_old_update_cursor_requires_structural_reset(self): run.status = RunStatus.SUCCESS op._notify_run(run) - recovery = op.subscribe_run_updates(op.operator_instance_id, 0) + recovery = op.subscribe_operator_updates(op.operator_instance_id, 0) reset = recovery.get_nowait() assert reset.reset_required.history_floor == 2 @@ -523,7 +526,7 @@ def test_old_update_cursor_requires_structural_reset(self): def test_cursor_ahead_after_restart_requires_structural_reset(self): op = Operator([], watch=False, schedule=False) try: - recovery = op.subscribe_run_updates("previous-operator", 99) + recovery = op.subscribe_operator_updates("previous-operator", 99) reset = recovery.get_nowait() assert reset.operator_instance_id == op.operator_instance_id @@ -543,7 +546,7 @@ def test_subscribe_notify_race_never_misses_or_duplicates_boundary_update(self): def subscribe(): barrier.wait() - subscriptions.append(op.subscribe_run_updates(op.operator_instance_id, 0)) + subscriptions.append(op.subscribe_operator_updates(op.operator_instance_id, 0)) def notify(): barrier.wait() diff --git a/test/operator_tests/test_operator_dev_reload.py b/test/operator_tests/test_operator_dev_reload.py index 02d2b68..f1c6945 100644 --- a/test/operator_tests/test_operator_dev_reload.py +++ b/test/operator_tests/test_operator_dev_reload.py @@ -468,7 +468,7 @@ def test_malformed_run_event_terminalizes_and_cleans_up(event): operator._active_runs[run_id] = handle logs = [] operator.on_log(logs.append) - updates = operator.subscribe_run_updates() + updates = operator.subscribe_operator_updates() errors = [] def drain(): @@ -637,7 +637,7 @@ def test_cancel_request_is_non_terminal_until_coordinator_stops(tmp_path): schedule=False, cancel_grace=0.15, ) - updates = operator.subscribe_run_updates() + updates = operator.subscribe_operator_updates() try: run_id = operator.start_run("flow") deadline = time.monotonic() + 2 @@ -674,7 +674,7 @@ def test_slow_update_consumer_receives_ordered_descriptors_and_detail_bodies(tmp body="log.info('first')\n log.info('second')", ) operator = Operator([str(workflow)], watch=False, schedule=False) - subscription = operator.subscribe_run_updates() + subscription = operator.subscribe_operator_updates() details = [] operator.on_detail_update(details.append) try: diff --git a/test/operator_tests/test_protocol_contract.py b/test/operator_tests/test_protocol_contract.py index 52c61cc..dd9b387 100644 --- a/test/operator_tests/test_protocol_contract.py +++ b/test/operator_tests/test_protocol_contract.py @@ -145,9 +145,9 @@ def test_detail_records_expose_only_bounded_metadata(): def test_update_envelope_distinguishes_changes_from_reset(): - update = pb.RunUpdateEnvelope( + update = pb.OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=pb.RunUpdate( + update=pb.OperatorUpdate( sequence=24, node_status_changed=pb.NodeStatusChanged( run_id="run-1", @@ -157,7 +157,7 @@ def test_update_envelope_distinguishes_changes_from_reset(): ), ), ) - reset = pb.RunUpdateEnvelope( + reset = pb.OperatorUpdateEnvelope( operator_instance_id="operator-2", reset_required=pb.ResetRequired(history_floor=100, latest_sequence=200), ) @@ -168,10 +168,10 @@ def test_update_envelope_distinguishes_changes_from_reset(): def test_run_update_is_a_sequenced_typed_change_record(): - update_fields = pb.RunUpdate.DESCRIPTOR.fields_by_name - change_fields = pb.RunUpdate.DESCRIPTOR.oneofs_by_name["change"].fields - envelope_fields = pb.RunUpdateEnvelope.DESCRIPTOR.fields_by_name - payload_fields = pb.RunUpdateEnvelope.DESCRIPTOR.oneofs_by_name["payload"].fields + update_fields = pb.OperatorUpdate.DESCRIPTOR.fields_by_name + change_fields = pb.OperatorUpdate.DESCRIPTOR.oneofs_by_name["change"].fields + envelope_fields = pb.OperatorUpdateEnvelope.DESCRIPTOR.fields_by_name + payload_fields = pb.OperatorUpdateEnvelope.DESCRIPTOR.oneofs_by_name["payload"].fields assert {name: field.number for name, field in update_fields.items()} == { "sequence": 1, @@ -181,6 +181,7 @@ def test_run_update_is_a_sequenced_typed_change_record(): "log_appended": 5, "agent_event_appended": 6, "trace_finalized": 7, + "catalog_replaced": 8, } assert [field.name for field in change_fields] == [ "run_created", @@ -189,6 +190,7 @@ def test_run_update_is_a_sequenced_typed_change_record(): "log_appended", "agent_event_appended", "trace_finalized", + "catalog_replaced", ] assert "run" not in update_fields assert {name: field.number for name, field in envelope_fields.items()} == { @@ -221,10 +223,10 @@ def test_service_exposes_parallel_workstream_contracts(): "ListLogs", "ListAgentEvents", "ReadTrace", - "StreamRunUpdates", + "StreamOperatorUpdates", } <= set(methods) assert methods["ReadTrace"].server_streaming is True - assert methods["StreamRunUpdates"].server_streaming is True + assert methods["StreamOperatorUpdates"].server_streaming is True assert methods["ReadDetail"].server_streaming is True diff --git a/test/operator_tests/test_registry.py b/test/operator_tests/test_registry.py index de4aeea..e53e42f 100644 --- a/test/operator_tests/test_registry.py +++ b/test/operator_tests/test_registry.py @@ -274,7 +274,7 @@ def test_two_roots_with_same_package_are_discovered_and_runnable_independently( assert registry.get_builder(descriptors[0].workflow_id)().name == "left_build" assert registry.get_builder(descriptors[1].workflow_id)().name == "right_build" - def test_refresh_invalid_file_removes_current_descriptor(self, tmp_path): + def test_refresh_invalid_file_retains_current_descriptor(self, tmp_path): workflow_file = tmp_path / "flow.py" workflow_file.write_text( "import avalanche as ava\n" @@ -289,10 +289,10 @@ def test_refresh_invalid_file_removes_current_descriptor(self, tmp_path): workflow_file.write_text("this is not valid Python !!!\n") registry.rescan() - assert registry.descriptors() == () + assert [item.workflow_id for item in registry.descriptors()] == ["flow.py::scheduled"] assert registry.list_diagnostics()[0].kind == "import_error" - def test_discovery_timeout_installs_empty_current_view(self, tmp_path): + def test_discovery_timeout_retains_current_view(self, tmp_path): workflow_file = tmp_path / "flow.py" workflow_file.write_text( "import avalanche as ava\n" @@ -300,7 +300,7 @@ def test_discovery_timeout_installs_empty_current_view(self, tmp_path): "def scheduled():\n" " return None\n" ) - registry = WorkflowRegistry(discovery_timeout=2.0) + registry = WorkflowRegistry(discovery_timeout=5.0) registry.scan([str(workflow_file)]) assert registry.descriptors() @@ -310,7 +310,7 @@ def test_discovery_timeout_installs_empty_current_view(self, tmp_path): registry.rescan() assert time.monotonic() - started < 2.0 - assert registry.descriptors() == () + assert [item.workflow_id for item in registry.descriptors()] == ["flow.py::scheduled"] assert "exceeded 0.2s" in registry.list_diagnostics()[0].message def test_discovery_stdout_and_delayed_background_output_do_not_corrupt_result( @@ -395,7 +395,7 @@ def test_explicit_alias_ids_are_stable_after_root_relocation(self, tmp_path): assert tuple(first.view.by_id) == tuple(second.view.by_id) - def test_duplicate_canonical_ids_are_rejected(self, monkeypatch): + def test_duplicate_canonical_ids_publish_invalid_catalog_diagnostic(self, monkeypatch): from avalanche.operator.models import WorkflowDescriptor, WorkflowLocator descriptor = WorkflowDescriptor( @@ -411,8 +411,10 @@ def test_duplicate_canonical_ids_are_rejected(self, monkeypatch): "runtime.operator.registry.discover", lambda roots, timeout: ((descriptor, descriptor), ()), ) - with pytest.raises(ValueError, match="Duplicate canonical workflow ID"): - WorkflowRegistry().scan(["root=/tmp"]) + registry = WorkflowRegistry() + registry.scan(["root=/tmp"]) + assert registry.descriptors() == () + assert [item.kind for item in registry.list_diagnostics()] == ["invalid_catalog"] def test_sequential_package_scans_isolate_identical_module_names(self, tmp_path): first = tmp_path / "first" diff --git a/test/operator_tests/test_run_updates.py b/test/operator_tests/test_run_updates.py index 3c478c5..633f653 100644 --- a/test/operator_tests/test_run_updates.py +++ b/test/operator_tests/test_run_updates.py @@ -15,14 +15,15 @@ _RunUpdateResetError, ) from runtime.operator.convert import ( - run_update_envelope_from_proto, - run_update_envelope_to_proto, + operator_update_envelope_from_proto, + operator_update_envelope_to_proto, ) from runtime.operator.models import ( AgentEvent, AgentEventAppended, AgentEventDescriptor, AgentEventDetailAppended, + CatalogSnapshot, LogAppended, LogDetailAppended, LogEntry, @@ -32,6 +33,8 @@ NodeState, NodeStatus, NodeStatusChanged, + OperatorUpdate, + OperatorUpdateEnvelope, ResetBaseline, ResetRequired, RunCreated, @@ -40,8 +43,6 @@ RunStatus, RunStatusChanged, RunSummary, - RunUpdate, - RunUpdateEnvelope, TraceDescriptor, TraceFinalized, ) @@ -64,10 +65,10 @@ def _drain(subscription): return values -def _created(sequence: int = 1, *, epoch: str = "operator-1") -> RunUpdateEnvelope: - return RunUpdateEnvelope( +def _created(sequence: int = 1, *, epoch: str = "operator-1") -> OperatorUpdateEnvelope: + return OperatorUpdateEnvelope( operator_instance_id=epoch, - update=RunUpdate( + update=OperatorUpdate( sequence=sequence, change=RunCreated( summary=RunSummary( @@ -128,12 +129,13 @@ def test_typed_update_envelopes_roundtrip_all_changes(): ] for sequence, change in enumerate(changes, start=1): - envelope = RunUpdateEnvelope( + envelope = OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate(sequence=sequence, change=change), + update=OperatorUpdate(sequence=sequence, change=change), ) assert ( - run_update_envelope_from_proto(run_update_envelope_to_proto(envelope)) == envelope + operator_update_envelope_from_proto(operator_update_envelope_to_proto(envelope)) + == envelope ) @@ -197,7 +199,9 @@ def test_operator_replays_typed_updates_in_order(): }, ) - envelopes = _drain(operator.subscribe_run_updates(operator.operator_instance_id, 0)) + envelopes = _drain( + operator.subscribe_operator_updates(operator.operator_instance_id, 0) + ) assert [envelope.update.sequence for envelope in envelopes] == list( range(1, operator.current_sequence + 1) ) @@ -213,7 +217,7 @@ def test_operator_replays_typed_updates_in_order(): TraceFinalized, ] replay = _drain( - operator.subscribe_run_updates( + operator.subscribe_operator_updates( operator.operator_instance_id, envelopes[2].update.sequence, ) @@ -233,7 +237,7 @@ def test_stale_cursor_and_epoch_explicitly_require_reset(): run.status = status operator._notify_run(run) - stale_cursor = operator.subscribe_run_updates(operator.operator_instance_id, 0) + stale_cursor = operator.subscribe_operator_updates(operator.operator_instance_id, 0) cursor_reset = stale_cursor.get_nowait() assert cursor_reset.update is None assert cursor_reset.reset_required == ResetRequired( @@ -241,7 +245,7 @@ def test_stale_cursor_and_epoch_explicitly_require_reset(): latest_sequence=3, ) - stale_epoch = operator.subscribe_run_updates("previous-operator", 3) + stale_epoch = operator.subscribe_operator_updates("previous-operator", 3) epoch_reset = stale_epoch.get_nowait() assert epoch_reset.operator_instance_id == operator.operator_instance_id assert epoch_reset.reset_required is not None @@ -262,7 +266,7 @@ def test_slow_update_consumer_gets_bounded_overflow_reset_on_terminal_update(): operator._runs[run.run_id] = run try: operator._notify_run(run) - subscription = operator.subscribe_run_updates( + subscription = operator.subscribe_operator_updates( operator.operator_instance_id, operator.current_sequence, ) @@ -305,7 +309,7 @@ def test_operator_restart_rejects_previous_epoch_cursor(): first._runs[run.run_id] = run first._notify_run(run) - subscription = second.subscribe_run_updates( + subscription = second.subscribe_operator_updates( first.operator_instance_id, first.current_sequence, ) @@ -341,7 +345,7 @@ def test_bounded_journal_retains_updates_not_run_state_snapshots(): ) assert len(operator._stream_history) == 2 - assert all(isinstance(item, RunUpdate) for item in operator._stream_history) + assert all(isinstance(item, OperatorUpdate) for item in operator._stream_history) assert all(isinstance(item.change, LogAppended) for item in operator._stream_history) assert [item.change.log.size_bytes for item in operator._stream_history] == [ 65_536, @@ -372,9 +376,9 @@ def test_client_applies_ordered_updates_and_ignores_duplicates(): run, _ = provider._apply_update_envelope(_created()) assert run.status == RunStatus.PENDING - status = RunUpdateEnvelope( + status = OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=2, change=RunStatusChanged("run-1", RunStatus.RUNNING, started_at=1.0, revision=2), ), @@ -384,9 +388,9 @@ def test_client_applies_ordered_updates_and_ignores_duplicates(): assert provider._apply_update_envelope(status) == (None, None) assert provider._cursor.sequence == 2 - node_update = RunUpdateEnvelope( + node_update = OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=3, change=NodeStatusChanged( "run-1", @@ -404,9 +408,9 @@ def test_client_applies_ordered_updates_and_ignores_duplicates(): "log-token": b"complete", "event-token": b'{"sequence":2,"event_kind":"code.executed","data":{}}', }[token] - log_update = RunUpdateEnvelope( + log_update = OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=4, change=LogAppended( "run-1", @@ -427,9 +431,9 @@ def test_client_applies_ordered_updates_and_ignores_duplicates(): assert run.logs == [] assert run.latest_log_sequence == 1 - event_update = RunUpdateEnvelope( + event_update = OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=5, change=AgentEventAppended( "run-1", @@ -455,9 +459,9 @@ def test_client_applies_ordered_updates_and_ignores_duplicates(): {"sequence": 2, "event_kind": "code.executed", "data": {}} ] - trace_update = RunUpdateEnvelope( + trace_update = OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=6, change=TraceFinalized( "run-1", @@ -485,9 +489,9 @@ def test_client_applies_ordered_updates_and_ignores_duplicates(): provider._hydrated_trace_revisions[key] = 6 run, _ = provider._apply_update_envelope( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=7, change=TraceFinalized( "run-1", @@ -514,9 +518,9 @@ def test_client_applies_ordered_updates_and_ignores_duplicates(): with pytest.raises(_RunUpdateResetError, match="sequence gap"): provider._apply_update_envelope( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=9, change=RunStatusChanged("run-1", RunStatus.SUCCESS, revision=8), ), @@ -558,9 +562,9 @@ def append(self, item): message=str(log_sequence), ) run, detail = provider._apply_update_envelope_locked( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=log_sequence + 1, change=LogAppended( "run-1", @@ -602,9 +606,9 @@ def test_client_detail_cache_evicts_oldest_buckets_within_count_and_byte_limits( run_id = f"run-{index}" sequence += 1 provider._apply_update_envelope( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=sequence, change=RunCreated( summary=RunSummary( @@ -620,9 +624,9 @@ def test_client_detail_cache_evicts_oldest_buckets_within_count_and_byte_limits( ) sequence += 1 provider._apply_update_envelope( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=sequence, change=LogAppended( run_id, @@ -659,9 +663,9 @@ def test_client_detail_cache_evicts_oldest_buckets_within_count_and_byte_limits( assert provider._log_entries == {} provider._apply_update_envelope( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-2", - update=RunUpdate( + update=OperatorUpdate( sequence=sequence + 2, change=RunCreated( summary=RunSummary( @@ -676,9 +680,9 @@ def test_client_detail_cache_evicts_oldest_buckets_within_count_and_byte_limits( ) ) provider._apply_update_envelope( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-2", - update=RunUpdate( + update=OperatorUpdate( sequence=sequence + 3, change=LogAppended( "run-after-reset", @@ -731,9 +735,9 @@ def parse_one_event(value, *args, **kwargs): guarded.setattr(client_module.json, "loads", parse_one_event) with provider._state_lock: status_run, _ = provider._apply_update_envelope_locked( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=2, change=RunStatusChanged( "run-1", @@ -749,9 +753,9 @@ def parse_one_event(value, *args, **kwargs): assert status_run.logs is initial.logs node_run, _ = provider._apply_update_envelope_locked( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=3, change=NodeStatusChanged( "run-1", @@ -775,9 +779,9 @@ def parse_one_event(value, *args, **kwargs): message="complete", ) log_run, _ = provider._apply_update_envelope_locked( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=4, change=LogAppended( "run-1", @@ -810,9 +814,9 @@ def parse_one_event(value, *args, **kwargs): } ) event_run, _ = provider._apply_update_envelope_locked( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=event_sequence + 4, change=AgentEventAppended( "run-1", @@ -1284,9 +1288,9 @@ def load_authoritative_baseline(load_snapshot): assert provider._runs_by_id["run-1"] is baseline run, _ = provider._apply_update_envelope( - RunUpdateEnvelope( + OperatorUpdateEnvelope( operator_instance_id="operator-1", - update=RunUpdate( + update=OperatorUpdate( sequence=4, change=RunStatusChanged( "run-1", @@ -1308,13 +1312,13 @@ def test_client_resets_baseline_and_resumes_after_operator_restart(): class RestartedStub: stream_calls = 0 - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 assert metadata is None self.stream_calls += 1 if self.stream_calls == 1: assert request.operator_instance_id == "old-operator" assert request.after_sequence == 99 - yield pb.RunUpdateEnvelope( + yield pb.OperatorUpdateEnvelope( operator_instance_id="new-operator", reset_required=pb.ResetRequired( history_floor=1, @@ -1324,9 +1328,9 @@ def StreamRunUpdates(self, request, *, metadata): # noqa: N802 return assert request.operator_instance_id == "new-operator" assert request.after_sequence == 2 - yield pb.RunUpdateEnvelope( + yield pb.OperatorUpdateEnvelope( operator_instance_id="new-operator", - update=pb.RunUpdate( + update=pb.OperatorUpdate( sequence=3, run_status_changed=pb.RunStatusChanged( run_id="run-1", @@ -1350,7 +1354,7 @@ def StreamRunUpdates(self, request, *, metadata): # noqa: N802 generation=notice.generation, operator_instance_id="new-operator", as_of_sequence=2, - workflows=(), + catalog=CatalogSnapshot(workflows=()), runs_by_workflow={"flow": (baseline,)}, ) diff --git a/test/operator_tests/test_state_detail.py b/test/operator_tests/test_state_detail.py index 6490c64..aef1f7c 100644 --- a/test/operator_tests/test_state_detail.py +++ b/test/operator_tests/test_state_detail.py @@ -12,7 +12,7 @@ from avalanche.operator import Operator from avalanche.operator.client import GrpcStateProvider, StreamState -from avalanche.operator.convert import run_update_envelope_to_proto +from avalanche.operator.convert import operator_update_envelope_to_proto from avalanche.operator.models import ( AgentEvent, AgentEventDetailAppended, @@ -20,10 +20,10 @@ LogEntry, LogLevel, NodeState, + OperatorUpdateEnvelope, RunState, RunStatus, RunStatusChanged, - RunUpdateEnvelope, SequencedLogEntry, ) from avalanche.operator.server import TRACE_CHUNK_BYTES, serve @@ -422,7 +422,7 @@ def test_start_run_publication_blocks_pagination_until_creation_is_revisioned(): start_errors = [] reader_done = threading.Event() page_holder = [] - subscription = operator.subscribe_run_updates() + subscription = operator.subscribe_operator_updates() operator.block_next_publication() def start_run() -> None: @@ -463,7 +463,7 @@ def read_page() -> None: starter.join(timeout=1) if reader.ident is not None: reader.join(timeout=1) - operator.unsubscribe_run_updates(subscription) + operator.unsubscribe_operator_updates(subscription) operator.close() @@ -529,7 +529,7 @@ def read_detail() -> None: def test_concurrent_publishers_dispatch_detail_callbacks_and_updates_in_order(): operator = _OrderedDeliveryOperator(watch=False, schedule=False) run = _add_run(operator, "run-ordered") - subscription = operator.subscribe_run_updates( + subscription = operator.subscribe_operator_updates( operator.operator_instance_id, operator.current_sequence ) first_callback_entered = threading.Event() @@ -604,7 +604,7 @@ def publish(message: str, timestamp: float) -> None: publisher_n.join(timeout=1) if publisher_n1.ident is not None: publisher_n1.join(timeout=1) - operator.unsubscribe_run_updates(subscription) + operator.unsubscribe_operator_updates(subscription) operator.close() assert not operator._notification_thread.is_alive() @@ -612,7 +612,7 @@ def publish(message: str, timestamp: float) -> None: def test_close_keeps_dispatcher_alive_for_notification_from_delayed_drain(): operator = Operator(watch=False, schedule=False, cancel_grace=0) run = _add_run(operator, "run-delayed-close") - subscription = operator.subscribe_run_updates( + subscription = operator.subscribe_operator_updates( operator.operator_instance_id, operator.current_sequence ) callback_statuses = [] @@ -670,7 +670,7 @@ def delayed_drain() -> None: release_drain.set() if drain.ident is not None: drain.join(timeout=1) - operator.unsubscribe_run_updates(subscription) + operator.unsubscribe_operator_updates(subscription) operator.close() @@ -876,8 +876,8 @@ def test_max_log_and_large_agent_event_use_bounded_live_and_hydration_transport( ] for update in operator._stream_history: - envelope_message = run_update_envelope_to_proto( - RunUpdateEnvelope( + envelope_message = operator_update_envelope_to_proto( + OperatorUpdateEnvelope( operator_instance_id=operator.operator_instance_id, update=update, ) diff --git a/test/tui_test.py b/test/tui_test.py index 479dd6e..03645ce 100644 --- a/test/tui_test.py +++ b/test/tui_test.py @@ -50,6 +50,7 @@ MockStateProvider, ) from avalanche.tui.models import ( + CatalogSnapshot, LogEntry, LogLevel, NodeState, @@ -2106,7 +2107,7 @@ def close(self): generation=1, operator_instance_id="operator-1", as_of_sequence=2, - workflows=(workflow,), + catalog=CatalogSnapshot(workflows=(workflow,)), runs_by_workflow={workflow.selector: (reset_run,)}, ) ) @@ -2244,7 +2245,7 @@ def test_detail_retry_cancelled_by_navigation_reset_and_shutdown(self): generation=1, operator_instance_id="operator-2", as_of_sequence=2, - workflows=(workflow,), + catalog=CatalogSnapshot(workflows=(workflow,)), runs_by_workflow={workflow.selector: (reset_run,)}, ) ) @@ -2670,7 +2671,7 @@ def load_reset_baseline(self, notice): generation=notice.generation, operator_instance_id="operator-recovered", as_of_sequence=notice.observed_sequence, - workflows=(INGEST_WORKFLOW,), + catalog=CatalogSnapshot(workflows=(INGEST_WORKFLOW,)), runs_by_workflow={INGEST_WORKFLOW.selector: ()}, ) @@ -2726,14 +2727,14 @@ def load_reset_baseline(self, notice): generation=generation, operator_instance_id=operator_instance_id, as_of_sequence=as_of_sequence, - workflows=(), + catalog=CatalogSnapshot(workflows=()), runs_by_workflow={}, ) return ResetBaseline( generation=notice.generation, operator_instance_id=notice.operator_instance_id, as_of_sequence=notice.observed_sequence, - workflows=(INGEST_WORKFLOW,), + catalog=CatalogSnapshot(workflows=(INGEST_WORKFLOW,)), runs_by_workflow={INGEST_WORKFLOW.selector: ()}, ) @@ -2801,7 +2802,7 @@ def get_run(self, run_id): generation=1, operator_instance_id="operator-1", as_of_sequence=2, - workflows=(ORDER_WORKFLOW,), + catalog=CatalogSnapshot(workflows=(ORDER_WORKFLOW,)), runs_by_workflow={ORDER_WORKFLOW.selector: (authoritative,)}, ) ) @@ -2845,7 +2846,7 @@ def load_baseline(notice): generation=notice.generation, operator_instance_id="operator-restarted", as_of_sequence=notice.observed_sequence, - workflows=(ORDER_WORKFLOW,), + catalog=CatalogSnapshot(workflows=(ORDER_WORKFLOW,)), runs_by_workflow={ORDER_WORKFLOW.selector: ()}, ) @@ -3023,8 +3024,8 @@ class RestartedStub: def __init__(self): self.stream_calls = 0 - def ListFlows(self, request, **kwargs): # noqa: N802 - return pb.FlowList(flows=[workflow_info_to_proto(stale_workflow)]) + def GetCatalog(self, request, **kwargs): # noqa: N802 + return pb.CatalogSnapshotMsg(workflows=[workflow_info_to_proto(stale_workflow)]) def ListRunSummaries(self, request, **kwargs): # noqa: N802 return pb.RunSummaryPage( @@ -3032,7 +3033,7 @@ def ListRunSummaries(self, request, **kwargs): # noqa: N802 as_of_sequence=99, ) - def StreamRunUpdates(self, request, *, metadata): # noqa: N802 + def StreamOperatorUpdates(self, request, *, metadata): # noqa: N802 self.stream_calls += 1 assert metadata is None if self.stream_calls == 1: @@ -3040,7 +3041,7 @@ def StreamRunUpdates(self, request, *, metadata): # noqa: N802 assert request.after_sequence == 99 return iter( ( - pb.RunUpdateEnvelope( + pb.OperatorUpdateEnvelope( operator_instance_id="operator-restarted", reset_required=pb.ResetRequired( history_floor=1, @@ -3059,7 +3060,7 @@ def load_baseline(notice: StreamResetNotice) -> ResetBaseline: generation=notice.generation, operator_instance_id="operator-restarted", as_of_sequence=3, - workflows=(workflow,), + catalog=CatalogSnapshot(workflows=(workflow,)), runs_by_workflow={workflow.selector: (recovered,)}, ) @@ -3175,13 +3176,17 @@ def __init__( self.summary_tokens = [] self.snapshot_calls = [] - def ListFlows(self, request, context): # noqa: N802 - return pb.FlowList(flows=[workflow_info_to_proto(workflow)]) + def GetCatalog(self, request, context): # noqa: N802 + return pb.CatalogSnapshotMsg( + operator_instance_id=self.operator_id, + as_of_sequence=self.baseline_sequence, + workflows=[workflow_info_to_proto(workflow)], + ) - def StreamRunUpdates(self, request, context): # noqa: N802 + def StreamOperatorUpdates(self, request, context): # noqa: N802 context.send_initial_metadata(()) if request.operator_instance_id != self.operator_id: - yield pb.RunUpdateEnvelope( + yield pb.OperatorUpdateEnvelope( operator_instance_id=self.operator_id, reset_required=pb.ResetRequired( history_floor=1, From 204b3eb6340bba057b69200a10b9741bf388edd6 Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Fri, 31 Jul 2026 19:45:00 +0000 Subject: [PATCH 04/25] Add in-process gRPC-Web listener --- src/runtime/operator/web.py | 343 ++++++++++++++++++++++++++++++++ test/operator_tests/test_web.py | 133 +++++++++++++ 2 files changed, 476 insertions(+) create mode 100644 src/runtime/operator/web.py create mode 100644 test/operator_tests/test_web.py diff --git a/src/runtime/operator/web.py b/src/runtime/operator/web.py new file mode 100644 index 0000000..bafa6cb --- /dev/null +++ b/src/runtime/operator/web.py @@ -0,0 +1,343 @@ +"""In-process gRPC-Web and static asset listener for the local operator UI.""" + +from __future__ import annotations + +import logging +import mimetypes +import select +import socket +import struct +import threading +from collections.abc import Callable, Iterator +from dataclasses import dataclass +from http import HTTPStatus +from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer +from pathlib import Path +from types import MappingProxyType +from urllib.parse import unquote, urlsplit + +import grpc +from google.protobuf.message import Message + +from .operator import Operator +from .proto import operator_pb2 as pb +from .server import OperatorServicer + +logger = logging.getLogger(__name__) + +DEFAULT_WEB_HOST = "127.0.0.1" +DEFAULT_WEB_PORT = 7435 +_GRPC_WEB_CONTENT_TYPE = "application/grpc-web+proto" +_GRPC_SERVICE_PATH = "/avalanche.operator.OperatorService/" +_FRAME_HEADER_BYTES = 5 +_MAX_REQUEST_BYTES = 4 * 1024 * 1024 + + +@dataclass(frozen=True) +class _RpcMethod: + request_type: type[Message] + response_type: type[Message] + server_streaming: bool = False + + +_RPC_METHODS = MappingProxyType( + { + "GetCatalog": _RpcMethod(pb.Empty, pb.CatalogSnapshotMsg), + "StartRun": _RpcMethod(pb.StartRunRequest, pb.StartRunResponse), + "CancelRun": _RpcMethod(pb.CancelRunRequest, pb.Empty), + "GetRunResult": _RpcMethod(pb.GetRunRequest, pb.RunResultMsg), + "ListRunSummaries": _RpcMethod(pb.ListRunSummariesRequest, pb.RunSummaryPage), + "GetRunSnapshot": _RpcMethod(pb.GetRunSnapshotRequest, pb.RunSnapshotMsg), + "ListLogs": _RpcMethod(pb.ListLogsRequest, pb.LogPage), + "ListAgentEvents": _RpcMethod(pb.ListAgentEventsRequest, pb.AgentEventPage), + "ReadTrace": _RpcMethod(pb.ReadTraceRequest, pb.TraceChunk, server_streaming=True), + "ReadDetail": _RpcMethod(pb.ReadDetailRequest, pb.DetailChunk, server_streaming=True), + "StreamOperatorUpdates": _RpcMethod( + pb.StreamOperatorUpdatesRequest, + pb.OperatorUpdateEnvelope, + server_streaming=True, + ), + } +) + + +class _WebRpcAbortError(Exception): + def __init__(self, code: grpc.StatusCode, detail: str) -> None: + super().__init__(detail) + self.code = code + self.detail = detail + + +class _WebRpcContext: + def __init__(self, active: Callable[[], bool]) -> None: + self._active = active + + def abort(self, code: grpc.StatusCode, detail: str) -> None: + raise _WebRpcAbortError(code, detail) + + def is_active(self) -> bool: + return self._active() + + def send_initial_metadata(self, metadata: tuple[()]) -> None: + del metadata + + +class _BrowserHTTPServer(ThreadingHTTPServer): + daemon_threads = True + + def __init__( + self, + server_address: tuple[str, int], + operator: Operator, + asset_root: Path, + ) -> None: + self.operator_servicer = OperatorServicer(operator) + self.asset_root = asset_root + self.stopping = threading.Event() + super().__init__(server_address, _BrowserRequestHandler) + + +class _BrowserRequestHandler(BaseHTTPRequestHandler): + protocol_version = "HTTP/1.1" + server: _BrowserHTTPServer + + def do_GET(self) -> None: # noqa: N802 + self._serve_asset() + + def do_POST(self) -> None: # noqa: N802 + method_name = urlsplit(self.path).path.removeprefix(_GRPC_SERVICE_PATH) + method = _RPC_METHODS.get(method_name) + if method is None or urlsplit(self.path).path != f"{_GRPC_SERVICE_PATH}{method_name}": + self.send_error(HTTPStatus.NOT_FOUND) + return + content_type = self.headers.get_content_type() + if content_type != _GRPC_WEB_CONTENT_TYPE: + self.send_error(HTTPStatus.UNSUPPORTED_MEDIA_TYPE) + return + try: + request = _decode_request(self.rfile.read(self._request_content_length()), method) + except ValueError as exc: + self._send_grpc_error(grpc.StatusCode.INVALID_ARGUMENT, str(exc)) + return + context = _WebRpcContext(self._request_is_active) + handler = getattr(self.server.operator_servicer, method_name) + try: + result = handler(request, context) + if method.server_streaming: + self._send_stream(iter(result)) + else: + self._send_unary(result) + except _WebRpcAbortError as exc: + self._send_grpc_error(exc.code, exc.detail) + except (BrokenPipeError, ConnectionResetError): + return + except Exception: + logger.exception("Unhandled gRPC-Web method failure: %s", method_name) + self._send_grpc_error(grpc.StatusCode.INTERNAL, "internal operator error") + + def do_OPTIONS(self) -> None: # noqa: N802 + self.send_response(HTTPStatus.NO_CONTENT) + self.send_header("Allow", "GET, POST, OPTIONS") + self.send_header("Content-Length", "0") + self.end_headers() + + def _request_content_length(self) -> int: + raw = self.headers.get("Content-Length") + if raw is None: + raise ValueError("Content-Length is required") + try: + length = int(raw) + except ValueError as exc: + raise ValueError("Content-Length must be an integer") from exc + if not 0 <= length <= _MAX_REQUEST_BYTES: + raise ValueError(f"request body exceeds {_MAX_REQUEST_BYTES} byte limit") + return length + + def _request_is_active(self) -> bool: + if self.server.stopping.is_set(): + return False + try: + readable, _, _ = select.select([self.connection], [], [], 0) + if not readable: + return True + return bool(self.connection.recv(1, socket.MSG_PEEK)) + except OSError: + return False + + def _send_unary(self, response: Message) -> None: + body = _data_frame(response) + _trailer_frame(grpc.StatusCode.OK, "") + self.send_response(HTTPStatus.OK) + self._send_grpc_headers() + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + + def _send_stream(self, responses: Iterator[Message]) -> None: + self.send_response(HTTPStatus.OK) + self._send_grpc_headers() + self.send_header("Transfer-Encoding", "chunked") + self.end_headers() + try: + try: + for response in responses: + self._write_chunk(_data_frame(response)) + except _WebRpcAbortError as exc: + trailer = _trailer_frame(exc.code, exc.detail) + else: + trailer = _trailer_frame(grpc.StatusCode.OK, "") + self._write_chunk(trailer) + self.wfile.write(b"0\r\n\r\n") + self.wfile.flush() + finally: + close = getattr(responses, "close", None) + if close is not None: + close() + + def _send_grpc_error(self, code: grpc.StatusCode, detail: str) -> None: + if self.wfile.closed: + return + body = _trailer_frame(code, detail) + self.send_response(HTTPStatus.OK) + self._send_grpc_headers() + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + + def _send_grpc_headers(self) -> None: + self.send_header("Content-Type", _GRPC_WEB_CONTENT_TYPE) + self.send_header("X-Content-Type-Options", "nosniff") + self.send_header("Cache-Control", "no-store") + + def _write_chunk(self, data: bytes) -> None: + self.wfile.write(f"{len(data):x}\r\n".encode("ascii")) + self.wfile.write(data) + self.wfile.write(b"\r\n") + self.wfile.flush() + + def _serve_asset(self) -> None: + request_path = unquote(urlsplit(self.path).path) + relative = request_path.lstrip("/") or "index.html" + candidate = (self.server.asset_root / relative).resolve() + try: + candidate.relative_to(self.server.asset_root) + except ValueError: + self.send_error(HTTPStatus.NOT_FOUND) + return + if not candidate.is_file() and "." not in Path(relative).name: + candidate = self.server.asset_root / "index.html" + if not candidate.is_file(): + self.send_error(HTTPStatus.NOT_FOUND) + return + data = candidate.read_bytes() + content_type = mimetypes.guess_type(candidate.name)[0] or "application/octet-stream" + self.send_response(HTTPStatus.OK) + self.send_header("Content-Type", content_type) + self.send_header("Content-Length", str(len(data))) + if candidate.name == "index.html": + self.send_header("Cache-Control", "no-store") + else: + self.send_header("Cache-Control", "public, max-age=31536000, immutable") + self.send_header("X-Content-Type-Options", "nosniff") + self.end_headers() + self.wfile.write(data) + + def log_message(self, format: str, *args: object) -> None: + logger.debug("Browser listener: " + format, *args) + + +class BrowserServer: + """Owned browser listener serving gRPC-Web and the compiled SPA.""" + + def __init__(self, server: _BrowserHTTPServer, thread: threading.Thread) -> None: + self._server = server + self._thread = thread + + @property + def host(self) -> str: + return str(self._server.server_address[0]) + + @property + def port(self) -> int: + return int(self._server.server_address[1]) + + @property + def endpoint(self) -> str: + host = f"[{self.host}]" if ":" in self.host else self.host + return f"http://{host}:{self.port}" + + def close(self) -> None: + if self._server.stopping.is_set(): + return + self._server.stopping.set() + self._server.shutdown() + self._server.server_close() + self._thread.join(timeout=2.0) + + +def start_browser_server( + operator: Operator, + *, + host: str = DEFAULT_WEB_HOST, + port: int = DEFAULT_WEB_PORT, + asset_root: Path | None = None, + trust_non_loopback: bool = False, +) -> BrowserServer: + """Start the loopback-default browser listener for one shared operator.""" + if not _is_loopback_host(host) and not trust_non_loopback: + raise ValueError( + "Non-loopback web UI exposure requires --web-trusted-proxy and an external " + "trusted, authenticated boundary" + ) + root = (asset_root or Path(__file__).with_name("web_assets")).resolve() + server = _BrowserHTTPServer((host, port), operator, root) + thread = threading.Thread( + target=server.serve_forever, + name="avalanche-browser-listener", + daemon=True, + ) + thread.start() + logger.info("Operator web UI listening on %s", BrowserServer(server, thread).endpoint) + return BrowserServer(server, thread) + + +def _decode_request(data: bytes, method: _RpcMethod) -> Message: + if len(data) < _FRAME_HEADER_BYTES: + raise ValueError("gRPC-Web request frame is truncated") + flags, length = struct.unpack(">BI", data[:_FRAME_HEADER_BYTES]) + if flags != 0: + raise ValueError("compressed or trailer request frames are unsupported") + if length != len(data) - _FRAME_HEADER_BYTES: + raise ValueError("gRPC-Web request frame length does not match its payload") + request = method.request_type() + request.ParseFromString(data[_FRAME_HEADER_BYTES:]) + return request + + +def _data_frame(message: Message) -> bytes: + payload = message.SerializeToString() + return struct.pack(">BI", 0, len(payload)) + payload + + +def _trailer_frame(code: grpc.StatusCode, detail: str) -> bytes: + status = code.value[0] + safe_detail = detail.replace("\r", " ").replace("\n", " ") + payload = f"grpc-status: {status}\r\ngrpc-message: {safe_detail}\r\n".encode() + return struct.pack(">BI", 0x80, len(payload)) + payload + + +def _is_loopback_host(host: str) -> bool: + normalized = host[1:-1] if host.startswith("[") and host.endswith("]") else host + if normalized.lower() == "localhost": + return True + try: + return socket.gethostbyname(normalized).startswith("127.") or normalized == "::1" + except OSError: + return False + + +__all__ = [ + "BrowserServer", + "DEFAULT_WEB_HOST", + "DEFAULT_WEB_PORT", + "start_browser_server", +] diff --git a/test/operator_tests/test_web.py b/test/operator_tests/test_web.py new file mode 100644 index 0000000..05aa97f --- /dev/null +++ b/test/operator_tests/test_web.py @@ -0,0 +1,133 @@ +"""Browser-compatible transport and asset serving tests.""" + +from __future__ import annotations + +import http.client +import struct +from pathlib import Path + +import pytest + +from runtime.operator.operator import Operator +from runtime.operator.proto import operator_pb2 as pb +from runtime.operator.web import start_browser_server + +_SERVICE = "/avalanche.operator.OperatorService/" +_CONTENT_TYPE = "application/grpc-web+proto" + + +def _frame(message) -> bytes: + payload = message.SerializeToString() + return struct.pack(">BI", 0, len(payload)) + payload + + +def _frames(body: bytes) -> list[tuple[int, bytes]]: + frames = [] + offset = 0 + while offset < len(body): + flags, length = struct.unpack(">BI", body[offset : offset + 5]) + offset += 5 + frames.append((flags, body[offset : offset + length])) + offset += length + assert offset == len(body) + return frames + + +def _post(server, method: str, request) -> tuple[int, str, bytes]: + connection = http.client.HTTPConnection(server.host, server.port, timeout=5) + body = _frame(request) + connection.request( + "POST", + f"{_SERVICE}{method}", + body=body, + headers={"Content-Type": _CONTENT_TYPE}, + ) + response = connection.getresponse() + result = response.status, response.getheader("Content-Type"), response.read() + connection.close() + return result + + +def test_browser_listener_serves_unary_catalog_from_shared_operator(tmp_path: Path): + (tmp_path / "index.html").write_text("
Avalanche
") + operator = Operator([], watch=False, schedule=False) + server = start_browser_server(operator, port=0, asset_root=tmp_path) + try: + status, content_type, body = _post(server, "GetCatalog", pb.Empty()) + frames = _frames(body) + catalog = pb.CatalogSnapshotMsg.FromString(frames[0][1]) + + assert status == 200 + assert content_type == _CONTENT_TYPE + assert catalog.operator_instance_id == operator.operator_instance_id + assert catalog.as_of_sequence == operator.current_sequence + assert frames[1][0] == 0x80 + assert b"grpc-status: 0" in frames[1][1] + finally: + server.close() + operator.close() + + +def test_browser_listener_delivers_stream_reset_as_grpc_web_frames(tmp_path: Path): + (tmp_path / "index.html").write_text("
Avalanche
") + operator = Operator([], watch=False, schedule=False) + server = start_browser_server(operator, port=0, asset_root=tmp_path) + try: + status, _, body = _post( + server, + "StreamOperatorUpdates", + pb.StreamOperatorUpdatesRequest( + operator_instance_id="stale-operator", + after_sequence=42, + ), + ) + frames = _frames(body) + envelope = pb.OperatorUpdateEnvelope.FromString(frames[0][1]) + + assert status == 200 + assert envelope.operator_instance_id == operator.operator_instance_id + assert envelope.HasField("reset_required") + assert frames[-1][0] == 0x80 + assert b"grpc-status: 0" in frames[-1][1] + finally: + server.close() + operator.close() + + +def test_browser_listener_serves_assets_and_spa_routes(tmp_path: Path): + (tmp_path / "index.html").write_text("
Avalanche
") + assets = tmp_path / "assets" + assets.mkdir() + (assets / "app.js").write_text("console.log('loaded')") + operator = Operator([], watch=False, schedule=False) + server = start_browser_server(operator, port=0, asset_root=tmp_path) + try: + connection = http.client.HTTPConnection(server.host, server.port, timeout=5) + connection.request("GET", "/runs/run-1") + response = connection.getresponse() + assert response.status == 200 + assert response.read() == b"
Avalanche
" + + connection.request("GET", "/assets/app.js") + response = connection.getresponse() + assert response.status == 200 + assert response.getheader("Content-Type") == "text/javascript" + assert response.read() == b"console.log('loaded')" + connection.close() + finally: + server.close() + operator.close() + + +def test_browser_listener_rejects_non_loopback_without_trusted_proxy(tmp_path: Path): + operator = Operator([], watch=False, schedule=False) + try: + with pytest.raises(ValueError, match="trusted, authenticated boundary"): + start_browser_server( + operator, + host="0.0.0.0", + port=0, + asset_root=tmp_path, + ) + finally: + operator.close() From d4a97dc341055feba24be5956cd82f0f326d0f72 Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Fri, 31 Jul 2026 19:46:10 +0000 Subject: [PATCH 05/25] Wire operator web listener controls --- src/ava_cli/app.py | 27 +++++++++++++++++++++++++++ src/runtime/operator/__init__.py | 18 +++++++++++++++++- src/runtime/operator/__main__.py | 19 +++++++++++++++++++ test/cli_test.py | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 1 deletion(-) diff --git a/src/ava_cli/app.py b/src/ava_cli/app.py index b6c2940..a60d4e7 100644 --- a/src/ava_cli/app.py +++ b/src/ava_cli/app.py @@ -69,6 +69,21 @@ def _build_parser() -> argparse.ArgumentParser: operator.add_argument( "--webhook-port", type=int, default=7434, help="loopback webhook HTTP port" ) + operator.add_argument("--web", action="store_true", help="serve the local browser UI") + operator.add_argument( + "--web-host", + default="127.0.0.1", + help="browser UI listen host (default: loopback)", + ) + operator.add_argument("--web-port", type=int, default=7435, help="browser UI HTTP port") + operator.add_argument( + "--web-trusted-proxy", + action="store_true", + help=( + "confirm non-loopback browser traffic is protected by an external trusted " + "and authenticated boundary" + ), + ) operator.add_argument("--ray", action="store_true", help="use the Ray executor") operator.set_defaults(handler=_run_operator) @@ -216,6 +231,18 @@ def _run_operator(args: argparse.Namespace) -> int: "--webhook-port", str(args.webhook_port), ] + if args.web: + runtime_args.extend( + [ + "--web", + "--web-host", + args.web_host, + "--web-port", + str(args.web_port), + ] + ) + if args.web_trusted_proxy: + runtime_args.append("--web-trusted-proxy") if args.ray: runtime_args.append("--ray") return _operator_main(runtime_args) diff --git a/src/runtime/operator/__init__.py b/src/runtime/operator/__init__.py index 1391f46..cbdb74d 100644 --- a/src/runtime/operator/__init__.py +++ b/src/runtime/operator/__init__.py @@ -33,13 +33,29 @@ def serve( *, host: str = "127.0.0.1", webhook_port: int = 7434, + web: bool = False, + web_host: str = "127.0.0.1", + web_port: int = 7435, + web_trusted_proxy: bool = False, **kwargs, ) -> None: - """Start the operator daemon with gRPC server.""" + """Start the operator daemon with gRPC and optional browser listeners.""" from .server import serve as _serve + from .web import start_browser_server op = Operator(workflow_paths, webhook_port=webhook_port, **kwargs) + browser_server = None try: + if web: + browser_server = start_browser_server( + op, + host=web_host, + port=web_port, + trust_non_loopback=web_trusted_proxy, + ) + print(f"Avalanche web UI: {browser_server.endpoint}") _serve(op, port=port, block=True, host=host) finally: + if browser_server is not None: + browser_server.close() op.close() diff --git a/src/runtime/operator/__main__.py b/src/runtime/operator/__main__.py index 712330d..b9aa4d0 100644 --- a/src/runtime/operator/__main__.py +++ b/src/runtime/operator/__main__.py @@ -31,6 +31,21 @@ def main(argv: Sequence[str] | None = None) -> int: "--webhook-port", type=int, default=7434, help="loopback webhook HTTP port" ) parser.add_argument("--ray", action="store_true", help="use the Ray executor") + parser.add_argument("--web", action="store_true", help="serve the local browser UI") + parser.add_argument( + "--web-host", + default="127.0.0.1", + help="browser UI listen host (default: loopback)", + ) + parser.add_argument("--web-port", type=int, default=7435, help="browser UI HTTP port") + parser.add_argument( + "--web-trusted-proxy", + action="store_true", + help=( + "confirm non-loopback browser traffic is protected by an external trusted " + "and authenticated boundary" + ), + ) args = parser.parse_args(list(argv) if argv is not None else None) if args.ray: @@ -48,6 +63,10 @@ def main(argv: Sequence[str] | None = None) -> int: host=args.host, webhook_port=args.webhook_port, executor_backend="ray" if args.ray else "local", + web=args.web, + web_host=args.web_host, + web_port=args.web_port, + web_trusted_proxy=args.web_trusted_proxy, ) return 0 diff --git a/test/cli_test.py b/test/cli_test.py index b2cad0c..093d3bf 100644 --- a/test/cli_test.py +++ b/test/cli_test.py @@ -74,6 +74,38 @@ def fake_operator_main(argv): ] +def test_ava_operator_delegates_web_listener_configuration(monkeypatch): + from ava_cli import app + + calls = [] + monkeypatch.setattr(app, "_operator_main", lambda argv: calls.append(argv) or 0) + + assert ( + app.main( + [ + "operator", + "--flows", + "examples", + "--web", + "--web-host", + "0.0.0.0", + "--web-port", + "17778", + "--web-trusted-proxy", + ] + ) + == 0 + ) + assert calls[0][-6:] == [ + "--web", + "--web-host", + "0.0.0.0", + "--web-port", + "17778", + "--web-trusted-proxy", + ] + + def test_ava_operator_rejects_old_workflows_flag(): from ava_cli import app From 1e7d876728908feddd09c95fc06d8e059361fded Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Fri, 31 Jul 2026 20:06:05 +0000 Subject: [PATCH 06/25] Build the operator React interface --- Makefile | 12 + .../web_assets/assets/editor-Dh6wG2B-.js | 10 + .../web_assets/assets/graph-CoDTrhFP.js | 7 + .../web_assets/assets/index-BADaCtIl.css | 1 + .../web_assets/assets/index-BBkdXJIH.js | 9 + .../web_assets/assets/protobuf-BR9ifi4u.js | 4 + src/runtime/operator/web_assets/index.html | 17 + test/operator_tests/test_web.py | 19 + web/operator/index.html | 13 + web/operator/package.json | 38 + web/operator/pnpm-lock.yaml | 2396 +++++++++ web/operator/src/App.tsx | 144 + web/operator/src/Explorer.tsx | 202 + web/operator/src/GraphCanvas.tsx | 243 + web/operator/src/Inspector.tsx | 358 ++ web/operator/src/RunControls.tsx | 132 + web/operator/src/ValueView.test.tsx | 30 + web/operator/src/ValueView.tsx | 54 + web/operator/src/api.ts | 172 + web/operator/src/generated/operator.client.ts | 179 + web/operator/src/generated/operator.ts | 4269 +++++++++++++++++ web/operator/src/guards.ts | 3 + web/operator/src/main.tsx | 16 + web/operator/src/state.test.ts | 170 + web/operator/src/state.ts | 256 + web/operator/src/styles.css | 225 + web/operator/src/test/setup.ts | 1 + web/operator/tsconfig.app.json | 21 + web/operator/tsconfig.json | 7 + web/operator/tsconfig.node.json | 11 + web/operator/tsconfig.node.tsbuildinfo | 1 + web/operator/vite.config.ts | 37 + 32 files changed, 9057 insertions(+) create mode 100644 src/runtime/operator/web_assets/assets/editor-Dh6wG2B-.js create mode 100644 src/runtime/operator/web_assets/assets/graph-CoDTrhFP.js create mode 100644 src/runtime/operator/web_assets/assets/index-BADaCtIl.css create mode 100644 src/runtime/operator/web_assets/assets/index-BBkdXJIH.js create mode 100644 src/runtime/operator/web_assets/assets/protobuf-BR9ifi4u.js create mode 100644 src/runtime/operator/web_assets/index.html create mode 100644 web/operator/index.html create mode 100644 web/operator/package.json create mode 100644 web/operator/pnpm-lock.yaml create mode 100644 web/operator/src/App.tsx create mode 100644 web/operator/src/Explorer.tsx create mode 100644 web/operator/src/GraphCanvas.tsx create mode 100644 web/operator/src/Inspector.tsx create mode 100644 web/operator/src/RunControls.tsx create mode 100644 web/operator/src/ValueView.test.tsx create mode 100644 web/operator/src/ValueView.tsx create mode 100644 web/operator/src/api.ts create mode 100644 web/operator/src/generated/operator.client.ts create mode 100644 web/operator/src/generated/operator.ts create mode 100644 web/operator/src/guards.ts create mode 100644 web/operator/src/main.tsx create mode 100644 web/operator/src/state.test.ts create mode 100644 web/operator/src/state.ts create mode 100644 web/operator/src/styles.css create mode 100644 web/operator/src/test/setup.ts create mode 100644 web/operator/tsconfig.app.json create mode 100644 web/operator/tsconfig.json create mode 100644 web/operator/tsconfig.node.json create mode 100644 web/operator/tsconfig.node.tsbuildinfo create mode 100644 web/operator/vite.config.ts diff --git a/Makefile b/Makefile index f1d562e..766fc04 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,18 @@ proto: perl -pi -e 's/^import operator_pb2 as operator__pb2$$/from . import operator_pb2 as operator__pb2/' \ src/runtime/operator/proto/operator_pb2_grpc.py +# Regenerate the checked-in TypeScript operator client. +web-proto: + cd web/operator && pnpm generate + +# Build the packaged browser interface. +web-build: + cd web/operator && pnpm build + +# Run browser projection and component tests. +web-test: + cd web/operator && pnpm test + # Build checked-in brand image artifacts from the Three.js source HTML. brand: node docs/assets/brand/source/export-brand-assets.mjs diff --git a/src/runtime/operator/web_assets/assets/editor-Dh6wG2B-.js b/src/runtime/operator/web_assets/assets/editor-Dh6wG2B-.js new file mode 100644 index 0000000..cf7788e --- /dev/null +++ b/src/runtime/operator/web_assets/assets/editor-Dh6wG2B-.js @@ -0,0 +1,10 @@ +let Mo=0,$i=class{constructor(t,e){this.from=t,this.to=e}};class R{constructor(t={}){this.id=Mo++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=ot.match(t)),e=>{let i=t(e);return i===void 0?null:[this,i]}}}R.closedBy=new R({deserialize:r=>r.split(" ")});R.openedBy=new R({deserialize:r=>r.split(" ")});R.group=new R({deserialize:r=>r.split(" ")});R.isolate=new R({deserialize:r=>{if(r&&r!="rtl"&&r!="ltr"&&r!="auto")throw new RangeError("Invalid value for isolate: "+r);return r||"auto"}});R.contextHash=new R({perNode:!0});R.lookAhead=new R({perNode:!0});R.mounted=new R({perNode:!0});class De{constructor(t,e,i,s=!1){this.tree=t,this.overlay=e,this.parser=i,this.bracketed=s}static get(t){return t&&t.props&&t.props[R.mounted.id]}}const Po=Object.create(null);class ot{constructor(t,e,i,s=0){this.name=t,this.props=e,this.id=i,this.flags=s}static define(t){let e=t.props&&t.props.length?Object.create(null):Po,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),s=new ot(t.name||"",e,t.id,i);if(t.props){for(let n of t.props)if(Array.isArray(n)||(n=n(s)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[n[0].id]=n[1]}}return s}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(R.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let s of i.split(" "))e[s]=t[i];return i=>{for(let s=i.prop(R.group),n=-1;n<(s?s.length:0);n++){let o=e[n<0?i.name:s[n]];if(o)return o}}}}ot.none=new ot("",Object.create(null),0,8);class Hs{constructor(t){this.types=t;for(let e=0;e0;for(let h=this.cursor(o|$.IncludeAnonymous);;){let a=!1;if(h.from<=n&&h.to>=s&&(!l&&h.type.isAnonymous||e(h)!==!1)){if(h.firstChild())continue;a=!0}for(;a&&i&&(l||!h.type.isAnonymous)&&i(h),!h.nextSibling();){if(!h.parent())return;a=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Ks(ot.none,this.children,this.positions,0,this.children.length,0,this.length,(e,i,s)=>new Q(this.type,e,i,s,this.propValues),t.makeTree||((e,i,s)=>new Q(ot.none,e,i,s)))}static build(t){return Eo(t)}}Q.empty=new Q(ot.none,[],[],0);class Vs{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Vs(this.buffer,this.index)}}class $t{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return ot.none}toString(){let t=[];for(let e=0;e0));h=o[h+3]);return l}slice(t,e,i){let s=this.buffer,n=new Uint16Array(e-t),o=0;for(let l=t,h=0;l=t&&et;case 1:return e<=t&&i>t;case 2:return i>t;case 4:return!0}}function Le(r,t,e,i){for(var s;r.from==r.to||(e<1?r.from>=t:r.from>t)||(e>-1?r.to<=t:r.to0?l.length:-1;t!=a;t+=e){let f=l[t],u=h[t]+o.from,c;if(!(!(n&$.EnterBracketed&&f instanceof Q&&(c=De.get(f))&&!c.overlay&&c.bracketed&&i>=u&&i<=u+f.length)&&!ur(s,i,u,u+f.length))){if(f instanceof $t){if(n&$.ExcludeBuffers)continue;let d=f.findChild(0,f.buffer.length,e,i-u,s);if(d>-1)return new zt(new Do(o,f,t,u),null,d)}else if(n&$.IncludeAnonymous||!f.type.isAnonymous||zs(f)){let d;if(!(n&$.IgnoreMounts)&&(d=De.get(f))&&!d.overlay)return new dt(d.tree,u,t,o);let p=new dt(f,u,t,o);return n&$.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(e<0?f.children.length-1:0,e,i,s,n)}}}if(n&$.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+e:t=e<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,e,i=0){let s;if(!(i&$.IgnoreOverlays)&&(s=De.get(this._tree))&&s.overlay){let n=t-this.from,o=i&$.EnterBracketed&&s.bracketed;for(let{from:l,to:h}of s.overlay)if((e>0||o?l<=n:l=n:h>n))return new dt(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ln(r,t,e,i){let s=r.cursor(),n=[];if(!s.firstChild())return n;if(e!=null){for(let o=!1;!o;)if(o=s.type.is(e),!s.nextSibling())return n}for(;;){if(i!=null&&s.type.is(i))return n;if(s.type.is(t)&&n.push(s.node),!s.nextSibling())return i==null?n:[]}}function os(r,t,e=t.length-1){for(let i=r;e>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[e]&&t[e]!=i.name)return!1;e--}}return!0}class Do{constructor(t,e,i,s){this.parent=t,this.buffer=e,this.index=i,this.start=s}}class zt extends cr{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:s}=this.context,n=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.context.start,i);return n<0?null:new zt(this.context,this,n)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,e,i=0){if(i&$.ExcludeBuffers)return null;let{buffer:s}=this.context,n=s.findChild(this.index+4,s.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return n<0?null:new zt(this.context,this,n)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new zt(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new zt(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,s=this.index+4,n=i.buffer[this.index+3];if(n>s){let o=i.buffer[this.index+1];t.push(i.slice(s,n,o)),e.push(0)}return new Q(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function dr(r){if(!r.length)return null;let t=0,e=r[0];for(let n=1;ne.from||o.to=t){let l=new dt(o.tree,o.overlay[0].from+n.from,-1,n);(s||(s=[i])).push(Le(l,t,e,!1))}}return s?dr(s):i}class ls{get name(){return this.type.name}constructor(t,e=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=e&~$.EnterBracketed,t instanceof dt)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,e){this.index=t;let{start:i,buffer:s}=this.buffer;return this.type=e||s.set.types[s.buffer[t]],this.from=i+s.buffer[t+1],this.to=i+s.buffer[t+2],!0}yield(t){return t?t instanceof dt?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:s}=this.buffer,n=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.buffer.start,i);return n<0?!1:(this.stack.push(this.index),this.yieldBuf(n))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?i&$.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&$.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&$.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(e.findChild(s,this.index,-1,0,4))}else{let s=e.buffer[this.index+3];if(s<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:s}=this;if(s){if(t>0){if(this.index-1)for(let n=e+t,o=t<0?-1:i._tree.children.length;n!=o;n+=t){let l=i._tree.children[n];if(this.mode&$.IncludeAnonymous||l instanceof $t||!l.type.isAnonymous||zs(l))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==s){if(s==this.index)return o;e=o,i=n+1;break t}s=this.stack[--n]}for(let s=i;s=0;n--){if(n<0)return os(this._tree,t,s);let o=i[e.buffer[this.stack[n]]];if(!o.isAnonymous){if(t[s]&&t[s]!=o.name)return!1;s--}}return!0}}function zs(r){return r.children.some(t=>t instanceof $t||!t.type.isAnonymous||zs(t))}function Eo(r){var t;let{buffer:e,nodeSet:i,maxBufferLength:s=1024,reused:n=[],minRepeatType:o=i.types.length}=r,l=Array.isArray(e)?new Vs(e,e.length):e,h=i.types,a=0,f=0;function u(T,C,S,H,W,K){let{id:P,start:O,end:V,size:z}=l,X=f,Lt=a;if(z<0)if(l.next(),z==-1){let Pt=n[P];S.push(Pt),H.push(O-T);return}else if(z==-3){a=P;return}else if(z==-4){f=P;return}else throw new RangeError(`Unrecognized record size: ${z}`);let Se=h[P],Ue,Qt,nn=O-T;if(V-O<=s&&(Qt=m(l.pos-C,W))){let Pt=new Uint16Array(Qt.size-Qt.skip),ft=l.pos-Qt.size,xt=Pt.length;for(;l.pos>ft;)xt=b(Qt.start,Pt,xt);Ue=new $t(Pt,V-Qt.start,i),nn=Qt.start-T}else{let Pt=l.pos-z;l.next();let ft=[],xt=[],Ut=P>=o?P:-1,ne=0,Ge=V;for(;l.pos>Pt;)Ut>=0&&l.id==Ut&&l.size>=0?(l.end<=Ge-s&&(p(ft,xt,O,ne,l.end,Ge,Ut,X,Lt),ne=ft.length,Ge=l.end),l.next()):K>2500?c(O,Pt,ft,xt):u(O,Pt,ft,xt,Ut,K+1);if(Ut>=0&&ne>0&&ne-1&&ne>0){let rn=d(Se,Lt);Ue=Ks(Se,ft,xt,0,ft.length,0,V-O,rn,rn)}else Ue=g(Se,ft,xt,V-O,X-V,Lt)}S.push(Ue),H.push(nn)}function c(T,C,S,H){let W=[],K=0,P=-1;for(;l.pos>C;){let{id:O,start:V,end:z,size:X}=l;if(X>4)l.next();else{if(P>-1&&V=0;z-=3)O[X++]=W[z],O[X++]=W[z+1]-V,O[X++]=W[z+2]-V,O[X++]=X;S.push(new $t(O,W[2]-V,i)),H.push(V-T)}}function d(T,C){return(S,H,W)=>{let K=0,P=S.length-1,O,V;if(P>=0&&(O=S[P])instanceof Q){if(!P&&O.type==T&&O.length==W)return O;(V=O.prop(R.lookAhead))&&(K=H[P]+O.length+V)}return g(T,S,H,W,K,C)}}function p(T,C,S,H,W,K,P,O,V){let z=[],X=[];for(;T.length>H;)z.push(T.pop()),X.push(C.pop()+S-W);T.push(g(i.types[P],z,X,K-W,O-K,V)),C.push(W-S)}function g(T,C,S,H,W,K,P){if(K){let O=[R.contextHash,K];P=P?[O].concat(P):[O]}if(W>25){let O=[R.lookAhead,W];P=P?[O].concat(P):[O]}return new Q(T,C,S,H,P)}function m(T,C){let S=l.fork(),H=0,W=0,K=0,P=S.end-s,O={size:0,start:0,skip:0};t:for(let V=S.pos-T;S.pos>V;){let z=S.size;if(S.id==C&&z>=0){O.size=H,O.start=W,O.skip=K,K+=4,H+=4,S.next();continue}let X=S.pos-z;if(z<0||X=o?4:0,Se=S.start;for(S.next();S.pos>X;){if(S.size<0)if(S.size==-3||S.size==-4)Lt+=4;else break t;else S.id>=o&&(Lt+=4);S.next()}W=Se,H+=z,K+=Lt}return(C<0||H==T)&&(O.size=H,O.start=W,O.skip=K),O.size>4?O:void 0}function b(T,C,S){let{id:H,start:W,end:K,size:P}=l;if(l.next(),P>=0&&H4){let V=l.pos-(P-4);for(;l.pos>V;)S=b(T,C,S)}C[--S]=O,C[--S]=K-T,C[--S]=W-T,C[--S]=H}else P==-3?a=H:P==-4&&(f=H);return S}let y=[],v=[];for(;l.pos>0;)u(r.start||0,r.bufferStart||0,y,v,-1,0);let E=(t=r.length)!==null&&t!==void 0?t:y.length?v[0]+y[0].length:0;return new Q(h[r.topID],y.reverse(),v.reverse(),E)}const hn=new WeakMap;function ui(r,t){if(!r.isAnonymous||t instanceof $t||t.type!=r)return 1;let e=hn.get(t);if(e==null){e=1;for(let i of t.children){if(i.type!=r||!(i instanceof Q)){e=1;break}e+=ui(r,i)}hn.set(t,e)}return e}function Ks(r,t,e,i,s,n,o,l,h){let a=0;for(let p=i;p=f)break;C+=S}if(v==E+1){if(C>f){let S=p[E];d(S.children,S.positions,0,S.children.length,g[E]+y);continue}u.push(p[E])}else{let S=g[v-1]+p[v-1].length-T;u.push(Ks(r,p,g,E,v,T,S,null,h))}c.push(T+y-n)}}return d(t,e,i,s,0),(l||h)(u,c,o)}class Jt{constructor(t,e,i,s,n=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=s,this.open=(n?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],i=!1){let s=[new Jt(0,t.length,t,0,!1,i)];for(let n of e)n.to>t.length&&s.push(n);return s}static applyChanges(t,e,i=128){if(!e.length)return t;let s=[],n=1,o=t.length?t[0]:null;for(let l=0,h=0,a=0;;l++){let f=l=i)for(;o&&o.from=c.from||u<=c.to||a){let d=Math.max(c.from,h)-a,p=Math.min(c.to,u)-a;c=d>=p?null:new Jt(d,p,c.tree,c.offset+a,l>0,!!f)}if(c&&s.push(c),o.to>u)break;o=nnew $i(s.from,s.to)):[new $i(0,0)]:[new $i(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let s=this.startParse(t,e,i);for(;;){let n=s.advance();if(n)return n}}}class No{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}new R({perNode:!0});var an={};class bi{constructor(t,e,i,s,n,o,l,h,a,f=0,u){this.p=t,this.stack=e,this.state=i,this.reducePos=s,this.pos=n,this.score=o,this.buffer=l,this.bufferBase=h,this.curContext=a,this.lookAhead=f,this.parent=u}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,i=0){let s=t.parser.context;return new bi(t,[],e,i,i,0,[],0,s?new fn(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let i=t>>19,s=t&65535,{parser:n}=this.p,o=this.reducePos=2e3&&!(!((e=this.p.parser.nodeSet.types[s])===null||e===void 0)&&e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=f):this.p.lastBigReductionSizeh;)this.stack.pop();this.reduceContext(s,a)}storeNode(t,e,i,s=4,n=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(e==i)return;if(this.buffer[o-2]>=e){this.buffer[o-2]=i;return}}}if(!n||this.pos==i)this.buffer.push(t,e,i,s);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let h=o;h>0&&this.buffer[h-2]>i;h-=4)if(this.buffer[h-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4)}this.buffer[o]=t,this.buffer[o+1]=e,this.buffer[o+2]=i,this.buffer[o+3]=s}}shift(t,e,i,s){if(t&131072)this.pushState(t&65535,this.pos);else if((t&262144)==0){let n=t,{parser:o}=this.p;this.pos=s;let l=o.stateFlag(n,1);!l&&(s>i||e<=o.maxNode)&&(this.reducePos=s),this.pushState(n,l?i:Math.min(i,this.reducePos)),this.shiftContext(e,i),e<=o.maxNode&&this.buffer.push(e,i,s,4)}else this.pos=s,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,s,4)}apply(t,e,i,s){t&65536?this.reduce(t):this.shift(t,e,i,s)}useNode(t,e){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let s=this.pos;this.reducePos=this.pos=s+t.length,this.pushState(e,s),this.buffer.push(i,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(e&&t.buffer[e-4]==0&&(e-=4);e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let i=t.buffer.slice(e),s=t.bufferBase+e;for(;t&&s==t.bufferBase;)t=t.parent;return new bi(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,s,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,i?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new Io(this);;){let i=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(i==0)return!1;if((i&65536)==0)return!0;e.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let s=[];for(let n=0,o;nh&1&&l==o)||s.push(e[n],o)}e=s}let i=[];for(let s=0;s>19,s=e&65535,n=this.stack.length-i*3;if(n<0||t.getGoto(this.stack[n],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;e=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],i=(s,n)=>{if(!e.includes(s))return e.push(s),t.allActions(s,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-n;if(l>1){let h=o&65535,a=this.stack.length-l*3;if(a>=0&&t.getGoto(this.stack[a],h,!1)>=0)return l<<19|65536|h}}else{let l=i(o,n+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e0&&this.emitLookAhead()}}class fn{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class Io{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=s}}class xi{constructor(t,e,i){this.stack=t,this.pos=e,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new xi(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new xi(this.stack,this.pos,this.index)}}function Xe(r,t=Uint16Array){if(typeof r!="string")return r;let e=null;for(let i=0,s=0;i=92&&o--,o>=34&&o--;let h=o-32;if(h>=46&&(h-=46,l=!0),n+=h,l)break;n*=46}e?e[s++]=n:e=new t(n)}return e}class ci{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const un=new ci;class Lo{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=un,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let i=this.range,s=this.rangeIndex,n=this.pos+t;for(;ni.to:n>=i.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];n+=o.from-i.to,i=o}return n}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,e.from);return this.end}peek(t){let e=this.chunkOff+t,i,s;if(e>=0&&e=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),s=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),s}acceptToken(t,e=0){let i=e?this.resolveOffset(e,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=un,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let i="";for(let s of this.ranges){if(s.from>=e)break;s.to>t&&(i+=this.input.read(Math.max(s.from,t),Math.min(s.to,e)))}return i}}class le{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:i}=e.p;Wo(this.data,t,e,this.id,i.data,i.tokenPrecTable)}}le.prototype.contextual=le.prototype.fallback=le.prototype.extend=!1;le.prototype.fallback=le.prototype.extend=!1;function Wo(r,t,e,i,s,n){let o=0,l=1<0){let p=r[d];if(h.allows(p)&&(t.token.value==-1||t.token.value==p||Fo(p,t.token.value,s,n))){t.acceptToken(p);break}}let f=t.next,u=0,c=r[o+2];if(t.next<0&&c>u&&r[a+c*3-3]==65535){o=r[a+c*3-1];continue t}for(;u>1,p=a+d+(d<<1),g=r[p],m=r[p+1]||65536;if(f=m)u=d+1;else{o=r[p+2],t.advance();continue t}}break}}function cn(r,t,e){for(let i=t,s;(s=r[i])!=65535;i++)if(s==e)return i-t;return-1}function Fo(r,t,e,i){let s=cn(e,i,t);return s<0||cn(e,i,r)t)&&!i.type.isError)return e<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(r.length,Math.max(i.from+1,t+25));if(e<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return e<0?0:r.length}}class Ho{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?dn(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?dn(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(n instanceof Q){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(n),this.start.push(o),this.index.push(0))}else this.index[e]++,this.nextStart=o+n.length}}}class Vo{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new ci)}getActions(t){let e=0,i=null,{parser:s}=t.p,{tokenizers:n}=s,o=s.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,h=0;for(let a=0;au.end+25&&(h=Math.max(u.lookAhead,h)),u.value!=0)){let c=e;if(u.extended>-1&&(e=this.addActions(t,u.extended,u.end,e)),e=this.addActions(t,u.value,u.end,e),!f.extend&&(i=u,e>c))break}}for(;this.actions.length>e;)this.actions.pop();return h&&t.setLookAhead(h),!i&&t.pos==this.stream.end&&(i=new ci,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,e=this.addActions(t,i.value,i.end,e)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new ci,{pos:i,p:s}=t;return e.start=i,e.end=Math.min(i+1,s.stream.end),e.value=i==s.stream.end?s.parser.eofTerm:0,e}updateCachedToken(t,e,i){let s=this.stream.clipPos(i.pos);if(e.token(this.stream.reset(s,t),i),t.value>-1){let{parser:n}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){(l&1)==0?t.value=l>>1:t.extended=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(s+1)}putAction(t,e,i,s){for(let n=0;nt.bufferLength*4?new Ho(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,e=this.minStackPos,i=this.stacks=[],s,n;if(this.bigReductionCount>300&&t.length==1){let[o]=t;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;oe)i.push(l);else{if(this.advanceStack(l,i,t))continue;{s||(s=[],n=[]),s.push(l);let h=this.tokens.getMainToken(l);n.push(h.value,h.end)}}break}}if(!i.length){let o=s&&$o(s);if(o)return lt&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw lt&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+e);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,n,i);if(o)return lt&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,h)=>h.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>e)&&this.recovering--}else if(i.length>1){t:for(let o=0;o500&&a.buffer.length>500)if((l.score-a.score||l.buffer.length-a.buffer.length)>0)i.splice(h--,1);else{i.splice(o--,1);continue t}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let a=t.curContext&&t.curContext.tracker.strict,f=a?t.curContext.hash:0;for(let u=this.fragments.nodeAt(s);u;){let c=this.parser.nodeSet.types[u.type.id]==u.type?n.getGoto(t.state,u.type.id):-1;if(c>-1&&u.length&&(!a||(u.prop(R.contextHash)||0)==f))return t.useNode(u,c),lt&&console.log(o+this.stackID(t)+` (via reuse of ${n.getName(u.type.id)})`),!0;if(!(u instanceof Q)||u.children.length==0||u.positions[0]>0)break;let d=u.children[0];if(d instanceof Q&&u.positions[0]==0)u=d;else break}}let l=n.stateSlot(t.state,4);if(l>0)return t.reduce(l),lt&&console.log(o+this.stackID(t)+` (via always-reduce ${n.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let h=this.tokens.getActions(t);for(let a=0;as?e.push(p):i.push(p)}return!1}advanceFully(t,e){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return pn(t,e),!0}}runRecovery(t,e,i){let s=null,n=!1;for(let o=0;o ":"";if(l.deadEnd&&(n||(n=!0,l.restart(),lt&&console.log(f+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let u=l.split(),c=f;for(let d=0;d<10&&u.forceReduce()&&(lt&&console.log(c+this.stackID(u)+" (via force-reduce)"),!this.advanceFully(u,i));d++)lt&&(c=this.stackID(u)+" -> ");for(let d of l.recoverByInsert(h))lt&&console.log(f+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,i);this.stream.end>l.pos?(a==l.pos&&(a++,h=0),l.recoverByDelete(h,a),lt&&console.log(f+this.stackID(l)+` (via recover-delete ${this.parser.getName(h)})`),pn(l,i)):(!s||s.scoret.topRules[l][1]),s=[];for(let l=0;l=0)n(f,h,l[a++]);else{let u=l[a+-f];for(let c=-f;c>0;c--)n(l[a++],h,u);a++}}}this.nodeSet=new Hs(e.map((l,h)=>ot.define({name:h>=this.minRepeatTerm?void 0:l,id:h,props:s[h],top:i.indexOf(h)>-1,error:h==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(h)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=1024;let o=Xe(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new le(o,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,i){let s=new zo(this,t,e,i);for(let n of this.wrappers)s=n(s,t,e,i);return s}getGoto(t,e,i=!1){let s=this.goto;if(e>=s[0])return-1;for(let n=s[e+1];;){let o=s[n++],l=o&1,h=s[n++];if(l&&i)return h;for(let a=n+(o>>1);n0}validAction(t,e){return!!this.allActions(t,i=>i==e?!0:null)}allActions(t,e){let i=this.stateSlot(t,4),s=i?e(i):void 0;for(let n=this.stateSlot(t,1);s==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Dt(this.data,n+2);else break;s=e(Dt(this.data,n+1))}return s}nextStates(t){let e=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Dt(this.data,i+2);else break;if((this.data[i+2]&1)==0){let s=this.data[i+1];e.some((n,o)=>o&1&&n==s)||e.push(this.data[i],s)}}return e}configure(t){let e=Object.assign(Object.create(wi.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=i}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(i=>{let s=t.tokenizers.find(n=>n.from==i);return s?s.to:i})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((i,s)=>{let n=t.specializers.find(l=>l.from==i.external);if(!n)return i;let o=Object.assign(Object.assign({},i),{external:n.to});return e.specializers[s]=gn(o),o})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),t.bufferLength!=null&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return e==null?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),i=e.map(()=>!1);if(t)for(let n of t.split(" ")){let o=e.indexOf(n);o>=0&&(i[o]=!0)}let s=null;for(let n=0;ni)&&e.p.parser.stateFlag(e.state,2)&&(!t||t.scorer.external(e,i)<<1|t}return r.get}let qo=0;class ut{constructor(t,e,i,s){this.name=t,this.set=e,this.base=i,this.modified=s,this.id=qo++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i=typeof t=="string"?t:"?";if(t instanceof ut&&(e=t),e?.base)throw new Error("Can not derive from a modified tag");let s=new ut(i,[],null,[]);if(s.set.push(s),e)for(let n of e.set)s.set.push(n);return s}static defineModifier(t){let e=new yi(t);return i=>i.modified.indexOf(e)>-1?i:yi.get(i.base||i,i.modified.concat(e).sort((s,n)=>s.id-n.id))}}let jo=0;class yi{constructor(t){this.name=t,this.instances=[],this.id=jo++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(l=>l.base==t&&Qo(e,l.modified));if(i)return i;let s=[],n=new ut(t.name,s,t,e);for(let l of e)l.instances.push(n);let o=Uo(e);for(let l of t.set)if(!l.modified.length)for(let h of o)s.push(yi.get(l,h));return n}}function Qo(r,t){return r.length==t.length&&r.every((e,i)=>e==t[i])}function Uo(r){let t=[[]];for(let e=0;ei.length-e.length)}function gr(r){let t=Object.create(null);for(let e in r){let i=r[e];Array.isArray(i)||(i=[i]);for(let s of e.split(" "))if(s){let n=[],o=2,l=s;for(let u=0;;){if(l=="..."&&u>0&&u+3==s.length){o=1;break}let c=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!c)throw new RangeError("Invalid path: "+s);if(n.push(c[0]=="*"?"":c[0][0]=='"'?JSON.parse(c[0]):c[0]),u+=c[0].length,u==s.length)break;let d=s[u++];if(u==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(u)}let h=n.length-1,a=n[h];if(!a)throw new RangeError("Invalid path: "+s);let f=new ki(i,o,h>0?n.slice(0,h):null);t[a]=f.sort(t[a])}}return Go.add(t)}const Go=new R({combine(r,t){let e,i,s;for(;r||t;){if(!r||t&&r.depth>=t.depth?(s=t,t=t.next):(s=r,r=r.next),e&&e.mode==s.mode&&!s.context&&!e.context)continue;let n=new ki(s.tags,s.mode,s.context);e?e.next=n:i=n,e=n}return i}});class ki{constructor(t,e,i,s){this.tags=t,this.mode=e,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=s;for(let l of n)for(let h of l.set){let a=e[h.id];if(a){o=o?o+" "+a:a;break}}return o},scope:i}}const x=ut.define,_e=x(),Wt=x(),mn=x(Wt),bn=x(Wt),Ft=x(),Je=x(Ft),ji=x(Ft),St=x(),Gt=x(St),wt=x(),yt=x(),hs=x(),ve=x(hs),Ze=x(),A={comment:_e,lineComment:x(_e),blockComment:x(_e),docComment:x(_e),name:Wt,variableName:x(Wt),typeName:mn,tagName:x(mn),propertyName:bn,attributeName:x(bn),className:x(Wt),labelName:x(Wt),namespace:x(Wt),macroName:x(Wt),literal:Ft,string:Je,docString:x(Je),character:x(Je),attributeValue:x(Je),number:ji,integer:x(ji),float:x(ji),bool:x(Ft),regexp:x(Ft),escape:x(Ft),color:x(Ft),url:x(Ft),keyword:wt,self:x(wt),null:x(wt),atom:x(wt),unit:x(wt),modifier:x(wt),operatorKeyword:x(wt),controlKeyword:x(wt),definitionKeyword:x(wt),moduleKeyword:x(wt),operator:yt,derefOperator:x(yt),arithmeticOperator:x(yt),logicOperator:x(yt),bitwiseOperator:x(yt),compareOperator:x(yt),updateOperator:x(yt),definitionOperator:x(yt),typeOperator:x(yt),controlOperator:x(yt),punctuation:hs,separator:x(hs),bracket:ve,angleBracket:x(ve),squareBracket:x(ve),paren:x(ve),brace:x(ve),content:St,heading:Gt,heading1:x(Gt),heading2:x(Gt),heading3:x(Gt),heading4:x(Gt),heading5:x(Gt),heading6:x(Gt),contentSeparator:x(St),list:x(St),quote:x(St),emphasis:x(St),strong:x(St),link:x(St),monospace:x(St),strikethrough:x(St),inserted:x(),deleted:x(),changed:x(),invalid:x(),meta:Ze,documentMeta:x(Ze),annotation:x(Ze),processingInstruction:x(Ze),definition:ut.defineModifier("definition"),constant:ut.defineModifier("constant"),function:ut.defineModifier("function"),standard:ut.defineModifier("standard"),local:ut.defineModifier("local"),special:ut.defineModifier("special")};for(let r in A){let t=A[r];t instanceof ut&&(t.name=r)}Yo([{tag:A.link,class:"tok-link"},{tag:A.heading,class:"tok-heading"},{tag:A.emphasis,class:"tok-emphasis"},{tag:A.strong,class:"tok-strong"},{tag:A.keyword,class:"tok-keyword"},{tag:A.atom,class:"tok-atom"},{tag:A.bool,class:"tok-bool"},{tag:A.url,class:"tok-url"},{tag:A.labelName,class:"tok-labelName"},{tag:A.inserted,class:"tok-inserted"},{tag:A.deleted,class:"tok-deleted"},{tag:A.literal,class:"tok-literal"},{tag:A.string,class:"tok-string"},{tag:A.number,class:"tok-number"},{tag:[A.regexp,A.escape,A.special(A.string)],class:"tok-string2"},{tag:A.variableName,class:"tok-variableName"},{tag:A.local(A.variableName),class:"tok-variableName tok-local"},{tag:A.definition(A.variableName),class:"tok-variableName tok-definition"},{tag:A.special(A.variableName),class:"tok-variableName2"},{tag:A.definition(A.propertyName),class:"tok-propertyName tok-definition"},{tag:A.typeName,class:"tok-typeName"},{tag:A.namespace,class:"tok-namespace"},{tag:A.className,class:"tok-className"},{tag:A.macroName,class:"tok-macroName"},{tag:A.propertyName,class:"tok-propertyName"},{tag:A.operator,class:"tok-operator"},{tag:A.comment,class:"tok-comment"},{tag:A.meta,class:"tok-meta"},{tag:A.invalid,class:"tok-invalid"},{tag:A.punctuation,class:"tok-punctuation"}]);const Xo=gr({String:A.string,Number:A.number,"True False":A.bool,PropertyName:A.propertyName,Null:A.null,", :":A.separator,"[ ]":A.squareBracket,"{ }":A.brace}),_o=wi.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Xo],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let as=[],mr=[];(()=>{let r="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,e=0;t>1;if(r=mr[i])t=i+1;else return!0;if(t==e)return!1}}function xn(r){return r>=127462&&r<=127487}const wn=8205;function Zo(r,t,e=!0,i=!0){return(e?br:tl)(r,t,i)}function br(r,t,e){if(t==r.length)return t;t&&xr(r.charCodeAt(t))&&wr(r.charCodeAt(t-1))&&t--;let i=Qi(r,t);for(t+=yn(i);t=0&&xn(Qi(r,o));)n++,o-=2;if(n%2==0)break;t+=2}else break}return t}function tl(r,t,e){for(;t>1;){let i=br(r,t-2,e);if(i=56320&&r<57344}function wr(r){return r>=55296&&r<56320}function yn(r){return r<65536?1:2}class B{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=ce(this,t,e);let s=[];return this.decompose(0,t,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(e,this.length,s,1),vt.from(s,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=ce(this,t,e);let i=[];return this.decompose(t,e,i,0),vt.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),s=new Be(this),n=new Be(t);for(let o=e,l=e;;){if(s.next(o),n.next(o),o=0,s.lineBreak!=n.lineBreak||s.done!=n.done||s.value!=n.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(t=1){return new Be(this,t)}iterRange(t,e=this.length){return new yr(this,t,e)}iterLines(t,e){let i;if(t==null)i=this.iter();else{e==null&&(e=this.lines+1);let s=this.line(t).from;i=this.iterRange(s,Math.max(s,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new kr(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?B.empty:t.length<=32?new j(t):vt.from(j.split(t,[]))}}class j extends B{constructor(t,e=el(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,s){for(let n=0;;n++){let o=this.text[n],l=s+o.length;if((e?i:l)>=t)return new il(s,l,i,o);s=l+1,i++}}decompose(t,e,i,s){let n=t<=0&&e>=this.length?this:new j(kn(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(s&1){let o=i.pop(),l=di(n.text,o.text.slice(),0,n.length);if(l.length<=32)i.push(new j(l,o.length+n.length));else{let h=l.length>>1;i.push(new j(l.slice(0,h)),new j(l.slice(h)))}}else i.push(n)}replace(t,e,i){if(!(i instanceof j))return super.replace(t,e,i);[t,e]=ce(this,t,e);let s=di(this.text,di(i.text,kn(this.text,0,t)),e),n=this.length+i.length-(e-t);return s.length<=32?new j(s,n):vt.from(j.split(s,[]),n)}sliceString(t,e=this.length,i=` +`){[t,e]=ce(this,t,e);let s="";for(let n=0,o=0;n<=e&&ot&&o&&(s+=i),tn&&(s+=l.slice(Math.max(0,t-n),e-n)),n=h+1}return s}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],s=-1;for(let n of t)i.push(n),s+=n.length+1,i.length==32&&(e.push(new j(i,s)),i=[],s=-1);return s>-1&&e.push(new j(i,s)),e}}class vt extends B{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,e,i,s){for(let n=0;;n++){let o=this.children[n],l=s+o.length,h=i+o.lines-1;if((e?h:l)>=t)return o.lineInner(t,e,i,s);s=l+1,i=h+1}}decompose(t,e,i,s){for(let n=0,o=0;o<=e&&n=o){let a=s&((o<=t?1:0)|(h>=e?2:0));o>=t&&h<=e&&!a?i.push(l):l.decompose(t-o,e-o,i,a)}o=h+1}}replace(t,e,i){if([t,e]=ce(this,t,e),i.lines=n&&e<=l){let h=o.replace(t-n,e-n,i),a=this.lines-o.lines+h.lines;if(h.lines>4&&h.lines>a>>6){let f=this.children.slice();return f[s]=h,new vt(f,this.length-(e-t)+i.length)}return super.replace(n,l,h)}n=l+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i=` +`){[t,e]=ce(this,t,e);let s="";for(let n=0,o=0;nt&&n&&(s+=i),to&&(s+=l.sliceString(t-o,e-o,i)),o=h+1}return s}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof vt))return 0;let i=0,[s,n,o,l]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;s+=e,n+=e){if(s==o||n==l)return i;let h=this.children[s],a=t.children[n];if(h!=a)return i+h.scanIdentical(a,e);i+=h.length+1}}static from(t,e=t.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of t)i+=d.lines;if(i<32){let d=[];for(let p of t)p.flatten(d);return new j(d,e)}let s=Math.max(32,i>>5),n=s<<1,o=s>>1,l=[],h=0,a=-1,f=[];function u(d){let p;if(d.lines>n&&d instanceof vt)for(let g of d.children)u(g);else d.lines>o&&(h>o||!h)?(c(),l.push(d)):d instanceof j&&h&&(p=f[f.length-1])instanceof j&&d.lines+p.lines<=32?(h+=d.lines,a+=d.length+1,f[f.length-1]=new j(p.text.concat(d.text),p.length+1+d.length)):(h+d.lines>s&&c(),h+=d.lines,a+=d.length+1,f.push(d))}function c(){h!=0&&(l.push(f.length==1?f[0]:vt.from(f,a)),a=-1,h=f.length=0)}for(let d of t)u(d);return c(),l.length==1?l[0]:new vt(l,e)}}B.empty=new j([""],0);function el(r){let t=-1;for(let e of r)t+=e.length+1;return t}function di(r,t,e=0,i=1e9){for(let s=0,n=0,o=!0;n=e&&(h>i&&(l=l.slice(0,i-s)),s0?1:(t instanceof j?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],n=this.offsets[i],o=n>>1,l=s instanceof j?s.text.length:s.children.length;if(o==(e>0?l:0)){if(i==0)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((n&1)==(e>0?0:1)){if(this.offsets[i]+=e,t==0)return this.lineBreak=!0,this.value=` +`,this;t--}else if(s instanceof j){let h=s.text[o+(e<0?-1:0)];if(this.offsets[i]+=e,h.length>Math.max(0,t))return this.value=t==0?h:e>0?h.slice(t):h.slice(0,h.length-t),this;t-=h.length}else{let h=s.children[o+(e<0?-1:0)];t>h.length?(t-=h.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(h),this.offsets.push(e>0?1:(h instanceof j?h.text.length:h.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class yr{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new Be(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:s}=this.cursor.next(t);return this.pos+=(s.length+t)*e,this.value=s.length<=i?s:e<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class kr{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:s}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(B.prototype[Symbol.iterator]=function(){return this.iter()},Be.prototype[Symbol.iterator]=yr.prototype[Symbol.iterator]=kr.prototype[Symbol.iterator]=function(){return this});class il{constructor(t,e,i,s){this.from=t,this.to=e,this.number=i,this.text=s}get length(){return this.to-this.from}}function ce(r,t,e){return t=Math.max(0,Math.min(r.length,t)),[t,Math.max(t,Math.min(r.length,e))]}function At(r,t,e=!0,i=!0){return Zo(r,t,e,i)}function sl(r){return r>=56320&&r<57344}function nl(r){return r>=55296&&r<56320}function rl(r,t){let e=r.charCodeAt(t);if(!nl(e)||t+1==r.length)return e;let i=r.charCodeAt(t+1);return sl(i)?(e-55296<<10)+(i-56320)+65536:e}function ol(r){return r<65536?1:2}const fs=/\r\n?|\n/;var at=(function(r){return r[r.Simple=0]="Simple",r[r.TrackDel=1]="TrackDel",r[r.TrackBefore=2]="TrackBefore",r[r.TrackAfter=3]="TrackAfter",r})(at||(at={}));class Et{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return n+(t-s);n+=l}else{if(i!=at.Simple&&a>=t&&(i==at.TrackDel&&st||i==at.TrackBefore&&st))return null;if(a>t||a==t&&e<0&&!l)return t==s||e<0?n:n+h;n+=h}s=a}if(t>s)throw new RangeError(`Position ${t} is out of range for changeset of length ${s}`);return n}touchesRange(t,e=t){for(let i=0,s=0;i=0&&s<=e&&l>=t)return se?"cover":!0;s=l}return!1}toString(){let t="";for(let e=0;e=0?":"+s:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Et(t)}static create(t){return new Et(t)}}class Y extends Et{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return us(this,(e,i,s,n,o)=>t=t.replace(s,s+(i-e),o),!1),t}mapDesc(t,e=!1){return cs(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let s=0,n=0;s=0){e[s]=l,e[s+1]=o;let h=s>>1;for(;i.length0&&Kt(i,e,n.text),n.forward(f),l+=f}let a=t[o++];for(;l>1].toJSON()))}return t}static of(t,e,i){let s=[],n=[],o=0,l=null;function h(f=!1){if(!f&&!s.length)return;oc||u<0||c>e)throw new RangeError(`Invalid change range ${u} to ${c} (in doc of length ${e})`);let p=d?typeof d=="string"?B.of(d.split(i||fs)):d:B.empty,g=p.length;if(u==c&&g==0)return;uo&&Z(s,u-o,-1),Z(s,c-u,g),Kt(n,s,p),o=c}}return a(t),h(!l),l}static empty(t){return new Y(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(n.length==1)e.push(n[0],0);else{for(;i.length=0&&e<=0&&e==r[s+1]?r[s]+=t:s>=0&&t==0&&r[s]==0?r[s+1]+=e:i?(r[s]+=t,r[s+1]+=e):r.push(t,e)}function Kt(r,t,e){if(e.length==0)return;let i=t.length-2>>1;if(i>1])),!(e||o==r.sections.length||r.sections[o+1]<0);)l=r.sections[o++],h=r.sections[o++];t(s,a,n,f,u),s=a,n=f}}}function cs(r,t,e,i=!1){let s=[],n=i?[]:null,o=new We(r),l=new We(t);for(let h=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let a=Math.min(o.len,l.len);Z(s,a,-1),o.forward(a),l.forward(a)}else if(l.ins>=0&&(o.ins<0||h==o.i||o.off==0&&(l.len=0&&h=0){let a=0,f=o.len;for(;f;)if(l.ins==-1){let u=Math.min(f,l.len);a+=u,f-=u,l.forward(u)}else if(l.ins==0&&l.lenh||o.ins>=0&&o.len>h)&&(l||i.length>a),n.forward2(h),o.forward(h)}}}}class We{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?B.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?B.empty:e[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class Ht{constructor(t,e,i,s){this.from=t,this.to=e,this.flags=i,this.goalColumn=s}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,e=-1){let i,s;return this.empty?i=s=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),s=t.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new Ht(i,s,this.flags,this.goalColumn)}extend(t,e=t,i=0){if(t<=this.anchor&&e>=this.anchor)return k.range(t,e,void 0,void 0,i);let s=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return k.range(this.anchor,s,void 0,void 0,i)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return k.range(t.anchor,t.head)}static create(t,e,i,s){return new Ht(t,e,i,s)}}class k{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:k.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new k(t.ranges.map(e=>Ht.fromJSON(e)),t.main)}static single(t,e=t){return new k([k.range(t,e)],0)}static create(t,e=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;ss.from-n.from),e=t.indexOf(i);for(let s=1;sn.head?k.range(h,l):k.range(l,h))}}return new k(t,e)}}function vr(r,t){for(let e of r.ranges)if(e.to>t)throw new RangeError("Selection points outside of document")}let $s=0;class M{constructor(t,e,i,s,n){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=s,this.id=$s++,this.default=t([]),this.extensions=typeof n=="function"?n(this):n}get reader(){return this}static define(t={}){return new M(t.combine||(e=>e),t.compareInput||((e,i)=>e===i),t.compare||(t.combine?(e,i)=>e===i:qs),!!t.static,t.enables)}of(t){return new pi([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new pi(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new pi(t,this,2,e)}from(t,e){return e||(e=i=>i),this.compute([t],i=>e(i.field(t)))}}function qs(r,t){return r==t||r.length==t.length&&r.every((e,i)=>e===t[i])}class pi{constructor(t,e,i,s){this.dependencies=t,this.facet=e,this.type=i,this.value=s,this.id=$s++}dynamicSlot(t){var e;let i=this.value,s=this.facet.compareInput,n=this.id,o=t[n]>>1,l=this.type==2,h=!1,a=!1,f=[];for(let u of this.dependencies)u=="doc"?h=!0:u=="selection"?a=!0:(((e=t[u.id])!==null&&e!==void 0?e:1)&1)==0&&f.push(t[u.id]);return{create(u){return u.values[o]=i(u),1},update(u,c){if(h&&c.docChanged||a&&(c.docChanged||c.selection)||ds(u,f)){let d=i(u);if(l?!Sn(d,u.values[o],s):!s(d,u.values[o]))return u.values[o]=d,1}return 0},reconfigure:(u,c)=>{let d,p=c.config.address[n];if(p!=null){let g=vi(c,p);if(this.dependencies.every(m=>m instanceof M?c.facet(m)===u.facet(m):m instanceof se?c.field(m,!1)==u.field(m,!1):!0)||(l?Sn(d=i(u),g,s):s(d=i(u),g)))return u.values[o]=g,0}else d=i(u);return u.values[o]=d,1}}}get extension(){return this}}function Sn(r,t,e){if(r.length!=t.length)return!1;for(let i=0;ir[h.id]),s=e.map(h=>h.type),n=i.filter(h=>!(h&1)),o=r[t.id]>>1;function l(h){let a=[];for(let f=0;fi===s),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(ti).find(i=>i.field==this);return(e?.create||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:i=>(i.values[e]=this.create(i),1),update:(i,s)=>{let n=i.values[e],o=this.updateF(n,s);return this.compareF(n,o)?0:(i.values[e]=o,1)},reconfigure:(i,s)=>{let n=i.facet(ti),o=s.facet(ti),l;return(l=n.find(h=>h.field==this))&&l!=o.find(h=>h.field==this)?(i.values[e]=l.create(i),1):s.config.address[this.id]!=null?(i.values[e]=s.field(this),0):(i.values[e]=this.create(i),1)}}}init(t){return[this,ti.of({field:this,create:t})]}get extension(){return this}}const Xt={lowest:4,low:3,default:2,high:1,highest:0};function Ce(r){return t=>new Ar(t,r)}const Cr={highest:Ce(Xt.highest),high:Ce(Xt.high),default:Ce(Xt.default),low:Ce(Xt.low),lowest:Ce(Xt.lowest)};class Ar{constructor(t,e){this.inner=t,this.prec=e}get extension(){return this}}class Li{of(t){return new ps(this,t)}reconfigure(t){return Li.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class ps{constructor(t,e){this.compartment=t,this.inner=e}get extension(){return this}}class Si{constructor(t,e,i,s,n,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=s,this.staticValues=n,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let s=[],n=Object.create(null),o=new Map;for(let c of hl(t,e,o))c instanceof se?s.push(c):(n[c.facet.id]||(n[c.facet.id]=[])).push(c);let l=Object.create(null),h=[],a=[];for(let c of s)l[c.id]=a.length<<1,a.push(d=>c.slot(d));let f=i?.config.facets;for(let c in n){let d=n[c],p=d[0].facet,g=f&&f[c]||[];if(d.every(m=>m.type==0))if(l[p.id]=h.length<<1|1,qs(g,d))h.push(i.facet(p));else{let m=p.combine(d.map(b=>b.value));h.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=h.length<<1|1,h.push(m.value)):(l[m.id]=a.length<<1,a.push(b=>m.dynamicSlot(b)));l[p.id]=a.length<<1,a.push(m=>ll(m,p,d))}}let u=a.map(c=>c(l));return new Si(t,o,u,l,h,n)}}function hl(r,t,e){let i=[[],[],[],[],[]],s=new Map;function n(o,l){let h=s.get(o);if(h!=null){if(h<=l)return;let a=i[h].indexOf(o);a>-1&&i[h].splice(a,1),o instanceof ps&&e.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let a of o)n(a,l);else if(o instanceof ps){if(e.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let a=t.get(o.compartment)||o.inner;e.set(o.compartment,a),n(a,l)}else if(o instanceof Ar)n(o.inner,o.prec);else if(o instanceof se)i[l].push(o),o.provides&&n(o.provides,l);else if(o instanceof pi)i[l].push(o),o.facet.extensions&&n(o.facet.extensions,Xt.default);else{let a=o.extension;if(!a)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(a==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);n(a,l)}}return n(r,Xt.default),i.reduce((o,l)=>o.concat(l))}function Re(r,t){if(t&1)return 2;let e=t>>1,i=r.status[e];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;r.status[e]=4;let s=r.computeSlot(r,r.config.dynamicSlots[e]);return r.status[e]=2|s}function vi(r,t){return t&1?r.config.staticValues[t>>1]:r.values[t>>1]}const Or=M.define(),gs=M.define({combine:r=>r.some(t=>t),static:!0}),Tr=M.define({combine:r=>r.length?r[0]:void 0,static:!0}),Mr=M.define(),Pr=M.define(),Dr=M.define(),Br=M.define({combine:r=>r.length?r[0]:!1});class ke{constructor(t,e){this.type=t,this.value=e}static define(){return new al}}class al{of(t){return new ke(this,t)}}class fl{constructor(t){this.map=t}of(t){return new U(this,t)}}class U{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return e===void 0?void 0:e==this.value?this:new U(this.type,e)}is(t){return this.type==t}static define(t={}){return new fl(t.map||(e=>e))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let s of t){let n=s.map(e);n&&i.push(n)}return i}}U.reconfigure=U.define();U.appendConfig=U.define();class tt{constructor(t,e,i,s,n,o){this.startState=t,this.changes=e,this.selection=i,this.effects=s,this.annotations=n,this.scrollIntoView=o,this._doc=null,this._state=null,i&&vr(i,e.newLength),n.some(l=>l.type==tt.time)||(this.annotations=n.concat(tt.time.of(Date.now())))}static create(t,e,i,s,n,o){return new tt(t,e,i,s,n,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(tt.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&e[t.length]=="."))}}tt.time=ke.define();tt.userEvent=ke.define();tt.addToHistory=ke.define();tt.remote=ke.define();function ul(r,t){let e=[];for(let i=0,s=0;;){let n,o;if(i=r[i]))n=r[i++],o=r[i++];else if(s=0;s--){let n=i[s](r);n instanceof tt?r=n:Array.isArray(n)&&n.length==1&&n[0]instanceof tt?r=n[0]:r=Er(t,he(n),!1)}return r}function dl(r){let t=r.startState,e=t.facet(Dr),i=r;for(let s=e.length-1;s>=0;s--){let n=e[s](r);n&&Object.keys(n).length&&(i=Rr(i,ms(t,n,r.changes.newLength),!0))}return i==r?r:tt.create(t,r.changes,r.selection,i.effects,i.annotations,i.scrollIntoView)}const pl=[];function he(r){return r==null?pl:Array.isArray(r)?r:[r]}var Rt=(function(r){return r[r.Word=0]="Word",r[r.Space=1]="Space",r[r.Other=2]="Other",r})(Rt||(Rt={}));const gl=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let bs;try{bs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function ml(r){if(bs)return bs.test(r);for(let t=0;t"€"&&(e.toUpperCase()!=e.toLowerCase()||gl.test(e)))return!0}return!1}function bl(r){return t=>{if(!/\S/.test(t))return Rt.Space;if(ml(t))return Rt.Word;for(let e=0;e-1)return Rt.Word;return Rt.Other}}class I{constructor(t,e,i,s,n,o){this.config=t,this.doc=e,this.selection=i,this.values=s,this.status=t.statusTemplate.slice(),this.computeSlot=n,o&&(o._state=this);for(let l=0;ls.set(a,h)),e=null),s.set(l.value.compartment,l.value.extension)):l.is(U.reconfigure)?(e=null,i=l.value):l.is(U.appendConfig)&&(e=null,i=he(i).concat(l.value));let n;e?n=t.startState.values.slice():(e=Si.resolve(i,s,this),n=new I(e,this.doc,this.selection,e.dynamicSlots.map(()=>null),(h,a)=>a.reconfigure(h,this),null).values);let o=t.startState.facet(gs)?t.newSelection:t.newSelection.asSingle();new I(e,t.newDoc,o,n,(l,h)=>h.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:k.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),s=this.changes(i.changes),n=[i.range],o=he(i.effects);for(let l=1;lo.spec.fromJSON(l,h)))}}return I.create({doc:t.doc,selection:k.fromJSON(t.selection),extensions:e.extensions?s.concat([e.extensions]):s})}static create(t={}){let e=Si.resolve(t.extensions||[],new Map),i=t.doc instanceof B?t.doc:B.of((t.doc||"").split(e.staticFacet(I.lineSeparator)||fs)),s=t.selection?t.selection instanceof k?t.selection:k.single(t.selection.anchor,t.selection.head):k.single(0);return vr(s,i.length),e.staticFacet(gs)||(s=s.asSingle()),new I(e,i,s,e.dynamicSlots.map(()=>null),(n,o)=>o.create(n),null)}get tabSize(){return this.facet(I.tabSize)}get lineBreak(){return this.facet(I.lineSeparator)||` +`}get readOnly(){return this.facet(Br)}phrase(t,...e){for(let i of this.facet(I.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let n=+(s||1);return!n||n>e.length?i:e[n-1]})),t}languageDataAt(t,e,i=-1){let s=[];for(let n of this.facet(Or))for(let o of n(this,e,i))Object.prototype.hasOwnProperty.call(o,t)&&s.push(o[t]);return s}charCategorizer(t){let e=this.languageDataAt("wordChars",t);return bl(e.length?e[0]:"")}wordAt(t){let{text:e,from:i,length:s}=this.doc.lineAt(t),n=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let h=At(e,o,!1);if(n(e.slice(h,o))!=Rt.Word)break;o=h}for(;lr.length?r[0]:4});I.lineSeparator=Tr;I.readOnly=Br;I.phrases=M.define({compare(r,t){let e=Object.keys(r),i=Object.keys(t);return e.length==i.length&&e.every(s=>r[s]==t[s])}});I.languageData=Or;I.changeFilter=Mr;I.transactionFilter=Pr;I.transactionExtender=Dr;Li.reconfigure=U.define();class Zt{eq(t){return this==t}range(t,e=t){return Fe.create(t,e,this)}}Zt.prototype.startSide=Zt.prototype.endSide=0;Zt.prototype.point=!1;Zt.prototype.mapMode=at.TrackDel;function js(r,t){return r==t||r.constructor==t.constructor&&r.eq(t)}class Fe{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new Fe(t,e,i)}}function xs(r,t){return r.from-t.from||r.value.startSide-t.value.startSide}class Qs{constructor(t,e,i,s){this.from=t,this.to=e,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,s=0){let n=i?this.to:this.from;for(let o=s,l=n.length;;){if(o==l)return o;let h=o+l>>1,a=n[h]-t||(i?this.value[h].endSide:this.value[h].startSide)-e;if(h==o)return a>=0?o:l;a>=0?l=h:o=h+1}}between(t,e,i,s){for(let n=this.findIndex(e,-1e9,!0),o=this.findIndex(i,1e9,!1,n);nd||c==d&&a.startSide>0&&a.endSide<=0)continue;(d-c||a.endSide-a.startSide)<0||(o<0&&(o=c),a.point&&(l=Math.max(l,d-c)),i.push(a),s.push(c-o),n.push(d-o))}return{mapped:i.length?new Qs(s,n,i,l):null,pos:o}}}class N{constructor(t,e,i,s){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=s}static create(t,e,i,s){return new N(t,e,i,s)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:s=0,filterTo:n=this.length}=t,o=t.filter;if(e.length==0&&!o)return this;if(i&&(e=e.slice().sort(xs)),this.isEmpty)return e.length?N.of(e):this;let l=new Nr(this,null,-1).goto(0),h=0,a=[],f=new Ci;for(;l.value||h=0){let u=e[h++];f.addInner(u.from,u.to,u.value)||a.push(u)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||nl.to||n=n&&t<=n+o.length&&o.between(n,t-n,e-n,i)===!1)return}this.nextLayer.between(t,e,i)}}iter(t=0){return He.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return He.from(t).goto(e)}static compare(t,e,i,s,n=-1){let o=t.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=n),l=e.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=n),h=vn(o,l,i),a=new Ae(o,h,n),f=new Ae(l,h,n);i.iterGaps((u,c,d)=>Cn(a,u,f,c,d,s)),i.empty&&i.length==0&&Cn(a,0,f,0,0,s)}static eq(t,e,i=0,s){s==null&&(s=999999999);let n=t.filter(f=>!f.isEmpty&&e.indexOf(f)<0),o=e.filter(f=>!f.isEmpty&&t.indexOf(f)<0);if(n.length!=o.length)return!1;if(!n.length)return!0;let l=vn(n,o),h=new Ae(n,l,0).goto(i),a=new Ae(o,l,0).goto(i);for(;;){if(h.to!=a.to||!ws(h.active,a.active)||h.point&&(!a.point||!js(h.point,a.point)))return!1;if(h.to>s)return!0;h.next(),a.next()}}static spans(t,e,i,s,n=-1){let o=new Ae(t,null,n).goto(e),l=e,h=o.openStart;for(;;){let a=Math.min(o.to,i);if(o.point){let f=o.activeForPoint(o.to),u=o.pointFroml&&(s.span(l,a,o.active,h),h=o.openEnd(a));if(o.to>i)return h+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,e=!1){let i=new Ci;for(let s of t instanceof Fe?[t]:e?xl(t):t)i.add(s.from,s.to,s.value);return i.finish()}static join(t){if(!t.length)return N.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let s=t[i];s!=N.empty;s=s.nextLayer)e=new N(s.chunkPos,s.chunk,e,Math.max(s.maxPoint,e.maxPoint));return e}}N.empty=new N([],[],null,-1);function xl(r){if(r.length>1)for(let t=r[0],e=1;e0)return r.slice().sort(xs);t=i}return r}N.empty.nextLayer=N.empty;class Ci{finishChunk(t){this.chunks.push(new Qs(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Ci)).add(t,e,i)}addInner(t,e,i){let s=t-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(N.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let e=N.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function vn(r,t,e){let i=new Map;for(let n of r)for(let o=0;o=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new Nr(o,e,i,n));return s.length==1?s[0]:new He(s)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let i=this.heap.length>>1;i>=0;i--)Ui(this.heap,i);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let i=this.heap.length>>1;i>=0;i--)Ui(this.heap,i);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Ui(this.heap,0)}}}function Ui(r,t){for(let e=r[t];;){let i=(t<<1)+1;if(i>=r.length)break;let s=r[i];if(i+1=0&&(s=r[i+1],i++),e.compare(s)<0)break;r[i]=e,r[t]=s,t=i}}class Ae{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=He.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){ei(this.active,t),ei(this.activeTo,t),ei(this.activeRank,t),this.minActive=An(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:s,rank:n}=this.cursor;for(;e0;)e++;ii(this.active,e,i),ii(this.activeTo,e,s),ii(this.activeRank,e,n),t&&ii(t,e,this.cursor.from),this.minActive=An(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>t){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&ei(i,s)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let n=this.cursor.value;if(!n.point)this.addActive(i),this.cursor.next();else if(e&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function Cn(r,t,e,i,s,n){r.goto(t),e.goto(i);let o=i+s,l=i,h=i-t,a=!!n.boundChange;for(let f=!1;;){let u=r.to+h-e.to,c=u||r.endSide-e.endSide,d=c<0?r.to+h:e.to,p=Math.min(d,o);if(r.point||e.point?(r.point&&e.point&&js(r.point,e.point)&&ws(r.activeForPoint(r.to),e.activeForPoint(e.to))||n.comparePoint(l,p,r.point,e.point),f=!1):(f&&n.boundChange(l),p>l&&!ws(r.active,e.active)&&n.compareRange(l,p,r.active,e.active),a&&po)break;l=d,c<=0&&r.next(),c>=0&&e.next()}}function ws(r,t){if(r.length!=t.length)return!1;for(let e=0;e=t;i--)r[i+1]=r[i];r[t]=e}function An(r,t){let e=-1,i=1e9;for(let s=0;s=t)return s;if(s==r.length)break;n+=r.charCodeAt(s)==9?e-n%e:1,s=At(r,s)}return r.length}const ys="ͼ",On=typeof Symbol>"u"?"__"+ys:Symbol.for(ys),ks=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Tn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class de{constructor(t,e){this.rules=[];let{finish:i}=e||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function n(o,l,h,a){let f=[],u=/^@(\w+)\b/.exec(o[0]),c=u&&u[1]=="keyframes";if(u&&l==null)return h.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))n(d.split(/,\s*/).map(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,h);else if(p&&typeof p=="object"){if(!u)throw new RangeError("The value of a property ("+d+") should be a primitive value.");n(s(d),p,f,c)}else p!=null&&f.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(f.length||c)&&h.push((i&&!u&&!a?o.map(i):o).join(", ")+" {"+f.join(" ")+"}")}for(let o in t)n(s(o),t[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let t=Tn[On]||1;return Tn[On]=t+1,ys+t.toString(36)}static mount(t,e,i){let s=t[ks],n=i&&i.nonce;s?n&&s.setNonce(n):s=new yl(t,n),s.mount(Array.isArray(e)?e:[e],t)}}let Mn=new Map;class yl{constructor(t,e){let i=t.ownerDocument||t,s=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&s.CSSStyleSheet){let n=Mn.get(i);if(n)return t[ks]=n;this.sheet=new s.CSSStyleSheet,Mn.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[ks]=this}mount(t,e){let i=this.sheet,s=0,n=0;for(let o=0;o-1&&(this.modules.splice(h,1),n--,h=-1),h==-1){if(this.modules.splice(n++,0,l),i)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},kl=typeof navigator<"u"&&/Mac/.test(navigator.platform),Sl=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var J=0;J<10;J++)qt[48+J]=qt[96+J]=String(J);for(var J=1;J<=24;J++)qt[J+111]="F"+J;for(var J=65;J<=90;J++)qt[J]=String.fromCharCode(J+32),Ve[J]=String.fromCharCode(J);for(var Gi in qt)Ve.hasOwnProperty(Gi)||(Ve[Gi]=qt[Gi]);function vl(r){var t=kl&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||Sl&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",e=!t&&r.key||(r.shiftKey?Ve:qt)[r.keyCode]||r.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}let it=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ss=typeof document<"u"?document:{documentElement:{style:{}}};const vs=/Edge\/(\d+)/.exec(it.userAgent),Ir=/MSIE \d/.test(it.userAgent),Cs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(it.userAgent),Wi=!!(Ir||Cs||vs),Pn=!Wi&&/gecko\/(\d+)/i.test(it.userAgent),Yi=!Wi&&/Chrome\/(\d+)/.exec(it.userAgent),Dn="webkitFontSmoothing"in Ss.documentElement.style,As=!Wi&&/Apple Computer/.test(it.vendor),Bn=As&&(/Mobile\/\w+/.test(it.userAgent)||it.maxTouchPoints>2);var w={mac:Bn||/Mac/.test(it.platform),windows:/Win/.test(it.platform),linux:/Linux|X11/.test(it.platform),ie:Wi,ie_version:Ir?Ss.documentMode||6:Cs?+Cs[1]:vs?+vs[1]:0,gecko:Pn,gecko_version:Pn?+(/Firefox\/(\d+)/.exec(it.userAgent)||[0,0])[1]:0,chrome:!!Yi,chrome_version:Yi?+Yi[1]:0,ios:Bn,android:/Android\b/.test(it.userAgent),webkit:Dn,webkit_version:Dn?+(/\bAppleWebKit\/(\d+)/.exec(it.userAgent)||[0,0])[1]:0,safari:As,safari_version:As?+(/\bVersion\/(\d+(\.\d+)?)/.exec(it.userAgent)||[0,0])[1]:0,tabSize:Ss.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Us(r,t){for(let e in r)e=="class"&&t.class?t.class+=" "+r.class:e=="style"&&t.style?t.style+=";"+r.style:t[e]=r[e];return t}const Ai=Object.create(null);function Gs(r,t,e){if(r==t)return!0;r||(r=Ai),t||(t=Ai);let i=Object.keys(r),s=Object.keys(t);if(i.length-0!=s.length-0)return!1;for(let n of i)if(n!=e&&(s.indexOf(n)==-1||r[n]!==t[n]))return!1;return!0}function Cl(r,t){for(let e=r.attributes.length-1;e>=0;e--){let i=r.attributes[e].name;t[i]==null&&r.removeAttribute(i)}for(let e in t){let i=t[e];e=="style"?r.style.cssText=i:r.getAttribute(e)!=i&&r.setAttribute(e,i)}}function Rn(r,t,e){let i=!1;if(t)for(let s in t)e&&s in e||(i=!0,s=="style"?r.style.cssText="":r.removeAttribute(s));if(e)for(let s in e)t&&t[s]==e[s]||(i=!0,s=="style"?r.style.cssText=e[s]:r.setAttribute(s,e[s]));return i}function Al(r){let t=Object.create(null);for(let e=0;e0?3e8:-4e8:e>0?1e8:-1e8,new te(t,e,e,i,t.widget||null,!1)}static replace(t){let e=!!t.block,i,s;if(t.isBlockGap)i=-5e8,s=4e8;else{let{start:n,end:o}=Lr(t,e);i=(n?e?-3e8:-1:5e8)-1,s=(o?e?2e8:1:-6e8)+1}return new te(t,i,s,e,t.widget||null,!0)}static line(t){return new je(t)}static set(t,e=!1){return N.of(t,e)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}et.none=N.empty;class qe extends et{constructor(t){let{start:e,end:i}=Lr(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Us(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||Ai}eq(t){return this==t||t instanceof qe&&this.tagName==t.tagName&&Gs(this.attrs,t.attrs)}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}qe.prototype.point=!1;class je extends et{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof je&&this.spec.class==t.spec.class&&Gs(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}je.prototype.mapMode=at.TrackBefore;je.prototype.point=!0;class te extends et{constructor(t,e,i,s,n,o){super(e,i,n,t),this.block=s,this.isReplace=o,this.mapMode=s?e<=0?at.TrackBefore:at.TrackAfter:at.TrackDel}get type(){return this.startSide!=this.endSide?pt.WidgetRange:this.startSide<=0?pt.WidgetBefore:pt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof te&&Ol(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}te.prototype.point=!0;function Lr(r,t=!1){let{inclusiveStart:e,inclusiveEnd:i}=r;return e==null&&(e=r.inclusive),i==null&&(i=r.inclusive),{start:e??t,end:i??t}}function Ol(r,t){return r==t||!!(r&&t&&r.compare(t))}function ae(r,t,e,i=0){let s=e.length-1;s>=0&&e[s]+i>=r?e[s]=Math.max(e[s],t):e.push(r,t)}class ze extends Zt{constructor(t,e,i){super(),this.tagName=t,this.attributes=e,this.rank=i}eq(t){return t==this||t instanceof ze&&this.tagName==t.tagName&&Gs(this.attributes,t.attributes)}static create(t){return new ze(t.tagName,t.attributes||Ai,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,e=!1){return N.of(t,e)}}ze.prototype.startSide=ze.prototype.endSide=-1;function Ke(r){let t;return r.nodeType==11?t=r.getSelection?r:r.ownerDocument:t=r,t.getSelection()}function Os(r,t){return t?r==t||r.contains(t.nodeType!=1?t.parentNode:t):!1}function Ee(r,t){if(!t.anchorNode)return!1;try{return Os(r,t.anchorNode)}catch{return!1}}function gi(r){return r.nodeType==3?$e(r,0,r.nodeValue.length).getClientRects():r.nodeType==1?r.getClientRects():[]}function Ne(r,t,e,i){return e?En(r,t,e,i,-1)||En(r,t,e,i,1):!1}function jt(r){for(var t=0;;t++)if(r=r.previousSibling,!r)return t}function Oi(r){return r.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(r.nodeName)}function En(r,t,e,i,s){for(;;){if(r==e&&t==i)return!0;if(t==(s<0?0:It(r))){if(r.nodeName=="DIV")return!1;let n=r.parentNode;if(!n||n.nodeType!=1)return!1;t=jt(r)+(s<0?0:1),r=n}else if(r.nodeType==1){if(r=r.childNodes[t+(s<0?-1:0)],r.nodeType==1&&r.contentEditable=="false")return!1;t=s<0?It(r):0}else return!1}}function It(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Ti(r,t){let{left:e,right:i}=r;if(e==i)return r;let s=t?e:i;return{left:s,right:s,top:r.top,bottom:r.bottom}}function Tl(r){let t=r.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:r.innerWidth,top:0,bottom:r.innerHeight}}function Wr(r,t){let e=t.width/r.offsetWidth,i=t.height/r.offsetHeight;return(e>.995&&e<1.005||!isFinite(e)||Math.abs(t.width-r.offsetWidth)<1)&&(e=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-r.offsetHeight)<1)&&(i=1),{scaleX:e,scaleY:i}}function Ml(r,t,e,i,s,n,o,l){let h=r.ownerDocument,a=h.defaultView||window;for(let f=r,u=!1;f&&!u;)if(f.nodeType==1){let c,d=f==h.body,p=1,g=1;if(d)c=Tl(a);else{if(/^(fixed|sticky)$/.test(getComputedStyle(f).position)&&(u=!0),f.scrollHeight<=f.clientHeight&&f.scrollWidth<=f.clientWidth){f=f.assignedSlot||f.parentNode;continue}let y=f.getBoundingClientRect();({scaleX:p,scaleY:g}=Wr(f,y)),c={left:y.left,right:y.left+f.clientWidth*p,top:y.top,bottom:y.top+f.clientHeight*g}}let m=0,b=0;if(s=="nearest")t.top0&&t.bottom>c.bottom+b&&(b=t.bottom-c.bottom+o)):t.bottom>c.bottom-o&&(b=t.bottom-c.bottom+o,e<0&&t.top-b0&&t.right>c.right+m&&(m=t.right-c.right+n)):t.right>c.right-n&&(m=t.right-c.right+n,e<0&&t.leftc.bottom||t.leftc.right)&&(t={left:Math.max(t.left,c.left),right:Math.min(t.right,c.right),top:Math.max(t.top,c.top),bottom:Math.min(t.bottom,c.bottom)}),f=f.assignedSlot||f.parentNode}else if(f.nodeType==11)f=f.host;else break}function Fr(r,t=!0){let e=r.ownerDocument,i=null,s=null;for(let n=r.parentNode;n&&!(n==e.body||(!t||i)&&s);)if(n.nodeType==1)!s&&n.scrollHeight>n.clientHeight&&(s=n),t&&!i&&n.scrollWidth>n.clientWidth&&(i=n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;return{x:i,y:s}}class Pl{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?It(e):0),i,Math.min(t.focusOffset,i?It(i):0))}set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s}}let Yt=null;w.safari&&w.safari_version>=26&&(Yt=!1);function Hr(r){if(r.setActive)return r.setActive();if(Yt)return r.focus(Yt);let t=[];for(let e=r;e&&(t.push(e,e.scrollTop,e.scrollLeft),e!=e.ownerDocument);e=e.parentNode);if(r.focus(Yt==null?{get preventScroll(){return Yt={preventScroll:!0},!0}}:void 0),!Yt){Yt=!1;for(let e=0;eMath.max(0,r.document.documentElement.scrollHeight-r.innerHeight-4):r.scrollTop>Math.max(1,r.scrollHeight-r.clientHeight-4)}function zr(r,t){for(let e=r,i=t;;){if(e.nodeType==3&&i>0)return{node:e,offset:i};if(e.nodeType==1&&i>0){if(e.contentEditable=="false")return null;e=e.childNodes[i-1],i=It(e)}else if(e.parentNode&&!Oi(e))i=jt(e),e=e.parentNode;else return null}}function Kr(r,t){for(let e=r,i=t;;){if(e.nodeType==3&&i=e){if(l.level==i)return o;(n<0||(s!=0?s<0?l.frome:t[n].level>l.level))&&(n=o)}}if(n<0)throw new RangeError("Index out of range");return n}}function jr(r,t){if(r.length!=t.length)return!1;for(let e=0;e=0;g-=3)if(kt[g+1]==-d){let m=kt[g+2],b=m&2?s:m&4?m&1?n:s:0;b&&(L[u]=L[kt[g]]=b),l=g;break}}else{if(kt.length==189)break;kt[l++]=u,kt[l++]=c,kt[l++]=h}else if((p=L[u])==2||p==1){let g=p==s;h=g?0:1;for(let m=l-3;m>=0;m-=3){let b=kt[m+2];if(b&2)break;if(g)kt[m+2]|=2;else{if(b&4)break;kt[m+2]|=4}}}}}function Wl(r,t,e,i){for(let s=0,n=i;s<=e.length;s++){let o=s?e[s-1].to:r,l=sh;)p==m&&(p=e[--g].from,m=g?e[g-1].to:r),L[--p]=d;h=f}else n=a,h++}}}function Ms(r,t,e,i,s,n,o){let l=i%2?2:1;if(i%2==s%2)for(let h=t,a=0;hh&&o.push(new Ot(h,g.from,d));let m=g.direction==ee!=!(d%2);Ps(r,m?i+1:i,s,g.inner,g.from,g.to,o),h=g.to}p=g.to}else{if(p==e||(f?L[p]!=l:L[p]==l))break;p++}c?Ms(r,h,p,i+1,s,c,o):ht;){let f=!0,u=!1;if(!a||h>n[a-1].to){let g=L[h-1];g!=l&&(f=!1,u=g==16)}let c=!f&&l==1?[]:null,d=f?i:i+1,p=h;t:for(;;)if(a&&p==n[a-1].to){if(u)break t;let g=n[--a];if(!f)for(let m=g.from,b=a;;){if(m==t)break t;if(b&&n[b-1].to==m)m=n[--b].from;else{if(L[m-1]==l)break t;break}}if(c)c.push(g);else{g.toL.length;)L[L.length]=256;let i=[],s=t==ee?0:1;return Ps(r,s,s,e,0,r.length,i),i}function Qr(r){return[new Ot(0,r,0)]}let Ur="";function Hl(r,t,e,i,s){var n;let o=i.head-r.from,l=Ot.find(t,o,(n=i.bidiLevel)!==null&&n!==void 0?n:-1,i.assoc),h=t[l],a=h.side(s,e);if(o==a){let c=l+=s?1:-1;if(c<0||c>=t.length)return null;h=t[l=c],o=h.side(!s,e),a=h.side(s,e)}let f=At(r.text,o,h.forward(s,e));(fh.to)&&(f=a),Ur=r.text.slice(Math.min(o,f),Math.max(o,f));let u=l==(s?t.length-1:0)?null:t[l+(s?1:-1)];return u&&f==a&&u.level+(s?0:1)r.some(t=>t)}),zl=M.define({combine:r=>r.some(t=>t)}),eo=M.define();class ue{constructor(t,e,i,s,n,o=!1){this.range=t,this.y=e,this.x=i,this.yMargin=s,this.xMargin=n,this.isSnapshot=o}map(t){return t.empty?this:new ue(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new ue(k.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const si=U.define({map:(r,t)=>r.map(t)}),io=U.define();function Tt(r,t,e){let i=r.facet(_r);i.length?i[0](t):window.onerror&&window.onerror(String(t),e,void 0,void 0,t)||(e?console.error(e+":",t):console.error(t))}const Bt=M.define({combine:r=>r.length?r[0]:!0});let Kl=0;const oe=M.define({combine(r){return r.filter((t,e)=>{for(let i=0;i{let h=[];return o&&h.push(Hi.of(a=>{let f=a.plugin(l);return f?o(f):et.none})),n&&h.push(n(l)),h})}static fromClass(t,e){return pe.define((i,s)=>new t(i,s),e)}}class Xi{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(i){if(Tt(e.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(e){Tt(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(!((e=this.value)===null||e===void 0)&&e.destroy)try{this.value.destroy()}catch(i){Tt(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const so=M.define(),Js=M.define(),Hi=M.define(),no=M.define(),Zs=M.define(),Qe=M.define(),ro=M.define();function In(r,t){let e=r.state.facet(ro);if(!e.length)return e;let i=e.map(n=>n instanceof Function?n(r):n),s=[];return N.spans(i,t.from,t.to,{point(){},span(n,o,l,h){let a=n-t.from,f=o-t.from,u=s;for(let c=l.length-1;c>=0;c--,h--){let d=l[c].spec.bidiIsolate,p;if(d==null&&(d=Vl(t.text,a,f)),h>0&&u.length&&(p=u[u.length-1]).to==a&&p.direction==d)p.to=f,u=p.inner;else{let g={from:a,to:f,direction:d,inner:[]};u.push(g),u=g.inner}}}}),s}const oo=M.define();function lo(r){let t=0,e=0,i=0,s=0;for(let n of r.state.facet(oo)){let o=n(r);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(e=Math.max(e,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:t,right:e,top:i,bottom:s}}const Te=M.define();class ct{constructor(t,e,i,s){this.fromA=t,this.toA=e,this.fromB=i,this.toB=s}join(t){return new ct(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let s=t[e-1];if(!(s.fromA>i.toA)){if(s.toAs.push(new ct(n,o,l,h))),this.changedRanges=s}static create(t,e,i){return new Mi(t,e,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const $l=[];class q{constructor(t,e,i=0){this.dom=t,this.length=e,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return $l}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&Cl(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,e=this.posAtStart){let i=e;for(let s of this.children){if(s==t)return i;i+=s.length+s.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,e,i){return null}domPosFor(t,e){let i=jt(this.dom),s=this.length?t>0:e>0;return new mt(this.parent.dom,i+(s?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof zi)return t;return null}static get(t){return t.cmTile}}class Vi extends q{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let e=this.dom,i=null,s,n=t?.node==e?t:null,o=0;for(let l of this.children){if(l.sync(t),o+=l.length+l.breakAfter,s=i?i.nextSibling:e.firstChild,n&&s!=l.dom&&(n.written=!0),l.dom.parentNode==e)for(;s&&s!=l.dom;)s=Ln(s);else e.insertBefore(l.dom,s);i=l.dom}for(s=i?i.nextSibling:e.firstChild,n&&s&&(n.written=!0);s;)s=Ln(s);this.length=o}}function Ln(r){let t=r.nextSibling;return r.parentNode.removeChild(r),t}class zi extends Vi{constructor(t,e){super(e),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let e=q.get(t);if(e&&this.owns(e))return e;t=t.parentNode}}blockTiles(t){for(let e=[],i=this,s=0,n=0;;)if(s==i.children.length){if(!e.length)return;i=i.parent,i.breakAfter&&n++,s=e.pop()}else{let o=i.children[s++];if(o instanceof Nt)e.push(s),i=o,s=0;else{let l=n+o.length,h=t(o,n);if(h!==void 0)return h;n=l+o.breakAfter}}}resolveBlock(t,e){let i,s=-1,n,o=-1;if(this.blockTiles((l,h)=>{let a=h+l.length;if(t>=h&&t<=a){if(l.isWidget()&&e>=-1&&e<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ht||t==h&&(e>1?l.length:l.covers(-1)))&&(!n||!l.isWidget()&&n.isWidget())&&(n=l,o=t-h)}}),!i&&!n)throw new Error("No tile at position "+t);return i&&e<0||!n?{tile:i,offset:s}:{tile:n,offset:o}}}class Nt extends Vi{constructor(t,e){super(t),this.wrapper=e}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,e){let i=new Nt(e||document.createElement(t.tagName),t);return e||(i.flags|=4),i}}class ge extends Vi{constructor(t,e){super(t),this.attrs=e}isLine(){return!0}static start(t,e,i){let s=new ge(e||document.createElement("div"),t);return(!e||!i)&&(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(t,e,i){let s=null,n=-1,o=null,l=-1;function h(f,u){for(let c=0,d=0;c=u&&(p.isComposite()?h(p,u-d):(!o||o.isHidden&&(e>0&&!(o.flags&32)||i&&jl(o,p)))&&(g>u||p.flags&32&&e<=1)?(o=p,l=u-d):(d=-1)&&(s=p,n=u-d)),d=g}}h(this,t);let a=(e<0?s:o)||s||o;return a?{tile:a,offset:a==s?n:l}:null}coordsIn(t,e,i){let s=this.resolveInline(t,e,!0);return s?s.tile.coordsIn(Math.max(0,s.offset),e,i):ql(this)}domIn(t,e){let i=this.resolveInline(t,e);if(i){let{tile:s,offset:n}=i;if(this.dom.contains(s.dom))return s.isText()?new mt(s.dom,Math.min(s.dom.nodeValue.length,n)):s.domPosFor(n,s.flags&16?1:s.flags&32?-1:e);let o=i.tile.parent,l=!1;for(let h of o.children){if(l)return new mt(h.dom,0);h==i.tile&&(l=!0)}}return new mt(this.dom,0)}}function ql(r){let t=r.dom.lastChild;if(!t)return r.dom.getBoundingClientRect();let e=gi(t);return e[e.length-1]||null}function jl(r,t){let e=r.coordsIn(0,1),i=t.coordsIn(0,1);return e&&i&&i.tops&&(t=s);let n=t,o=t,l=0;t==0&&e<0||t==s&&e>=0?w.chrome||w.gecko||(t?(n--,l=1):o=0)?0:h.length-1];return w.safari&&!l&&a.width==0&&(a=Array.prototype.find.call(h,f=>f.width)||a),i==null?a:Ti(a,(l?l>0:e<0)==i)}static of(t,e){let i=new _t(e||document.createTextNode(t),t);return e||(i.flags|=2),i}}class ie extends q{constructor(t,e,i,s){super(t,e,s),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,e){return this.coordsInWidget(t,e,!1)}coordsInWidget(t,e,i){let s=this.widget.coordsAt(this.dom,t,e);if(s)return s;if(i)return Ti(this.dom.getBoundingClientRect(),this.length?t==0:e<=0);{let n=this.dom.getClientRects(),o=null;if(!n.length)return null;let l=this.flags&16?!0:this.flags&32?!1:t>0;for(let h=l?n.length-1:0;o=n[h],!(t>0?h==0:h==n.length-1||o.top0==i)}}class Ql{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,e,i){let{tile:s,index:n,beforeBreak:o,parents:l}=this;for(;t||e>0;)if(s.isComposite())if(o){if(!t)break;i&&i.break(),t--,o=!1}else if(n==s.children.length){if(!t&&!l.length)break;i&&i.leave(s),o=!!s.breakAfter,{tile:s,index:n}=l.pop(),n++}else{let h=s.children[n],a=h.breakAfter;(e>0?h.length<=t:h.length=0;l--){let h=e.marks[l],a=s.lastChild;if(a instanceof rt&&a.mark.eq(h.mark))a.dom!=h.dom&&a.setDOM(_i(h.dom)),s=a;else{if(this.cache.reused.get(h)){let u=q.get(h.dom);u&&u.setDOM(_i(h.dom))}let f=rt.of(h.mark,h.dom);s.append(f),s=f}this.cache.reused.set(h,2)}let n=q.get(t.text);n&&this.cache.reused.set(n,2);let o=new _t(t.text,t.text.nodeValue);o.flags|=8,this.pos=t.range.toB,s.append(o)}addInlineWidget(t,e,i){let s=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);s||this.flushBuffer();let n=this.ensureMarks(e,i);!s&&!(t.flags&16)&&n.append(this.getBuffer(1)),n.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,e,i){this.flushBuffer(),this.ensureMarks(e,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let e=this.afterWidget||this.lastBlock;e.length+=t,this.pos+=t}addLineStart(t,e){var i;t||(t=ho);let s=ge.start(t,e||((i=this.cache.find(ge))===null||i===void 0?void 0:i.dom),!!e);this.getBlockPos().append(this.lastBlock=this.curLine=s)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,e){var i;let s=this.curLine;for(let n=t.length-1;n>=0;n--){let o=t[n],l;if(e>0&&(l=s.lastChild)&&l instanceof rt&&l.mark.eq(o))s=l,e--;else{let h=rt.of(o,(i=this.cache.find(rt,a=>a.mark.eq(o)))===null||i===void 0?void 0:i.dom);s.append(h),s=h,e=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!Wn(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(w.ios&&Wn(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Ji,0,32)||new ie(Ji.toDOM(),0,Ji,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let e=t.rank*102+t.value.rank,i=new Ul(t.from,t.to,t.value,e),s=this.wrappers.length;for(;s>0&&(this.wrappers[s-1].rank-i.rank||this.wrappers[s-1].to-i.to)<0;)s--;this.wrappers.splice(s,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let e=this.root;for(let i of this.wrappers){let s=e.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||t===void 0?void 0:t.dom);e.append(n),e=n}}return e}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let e=2|(t<0?16:32),i=this.cache.find(Pi,void 0,1);return i&&(i.flags=e),i||new Pi(e)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Yl{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:s,lineBreak:n,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=s;let l=this.textOff=Math.min(t,s.length);return n?null:s.slice(0,l)}let e=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,e);return this.textOff=e,i}}const Di=[ie,ge,_t,rt,Pi,Nt,zi];for(let r=0;r[]),this.index=Di.map(()=>0),this.reused=new Map}add(t){let e=t.constructor.bucket,i=this.buckets[e];i.length<6?i.push(t):i[this.index[e]=(this.index[e]+1)%6]=t}find(t,e,i=2){let s=t.bucket,n=this.buckets[s],o=this.index[s];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(t,e){let i=e&&this.getCompositionContext(e.text);for(let s=0,n=0,o=0;;){let l=os){let a=h-s;this.preserve(a,!o,!l),s=h,n+=a}if(!l)break;e&&l.fromA<=e.range.fromA&&l.toA>=e.range.toA?(this.forward(l.fromA,e.range.fromA,e.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(h-l);else{let a=h>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof rt&&s.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?s.length&&(s.length=n=0):o instanceof rt&&(s.shift(),n=Math.min(n,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,e){let i=null,s=this.builder,n=-1,o=N.spans(this.decorations,t,e,{point:(l,h,a,f,u,c)=>{if(a instanceof te){if(this.disallowBlockEffectsFor[c]){if(a.block)throw new RangeError("Block decorations may not be specified via plugins");if(h>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(n=f.length,u>f.length)s.continueWidget(h-l);else{let d=a.widget||(a.block?me.block:me.inline),p=Jl(a),g=this.cache.findWidget(d,h-l,p)||ie.of(d,this.view,h-l,p);a.block?(a.startSide>0&&s.addLineStartIfNotCovered(i),s.addBlockWidget(g)):(s.ensureLine(i),s.addInlineWidget(g,f,u))}i=null}else i=Zl(i,a);h>l&&this.text.skip(h-l)},span:(l,h,a,f)=>{for(let u=l;u-1&&(this.openWidget=o>n),this.openWidget||s.addLineStartIfNotCovered(i),this.openMarks=o}forward(t,e,i=1){e-t<=10?this.old.advance(e-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(e-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let e=[],i=null;for(let s=t.parentNode;;s=s.parentNode){let n=q.get(s);if(s==this.view.contentDOM)break;n instanceof rt?e.push(n):n?.isLine()?i=n:n instanceof Nt||(s.nodeName=="DIV"&&!i&&s!=this.view.contentDOM?i=new ge(s,ho):i||e.push(rt.of(new qe({tagName:s.nodeName.toLowerCase(),attributes:Al(s)}),s)))}return{line:i,marks:e}}}function Wn(r,t){let e=i=>{for(let s of i.children)if((t?s.isText():s.length)||e(s))return!0;return!1};return e(r)}function Jl(r){let t=r.isReplace?(r.startSide<0?64:0)|(r.endSide>0?128:0):r.startSide>0?32:16;return r.block&&(t|=256),t}const ho={class:"cm-line"};function Zl(r,t){let e=t.spec.attributes,i=t.spec.class;return!e&&!i||(r||(r={class:"cm-line"}),e&&Us(e,r),i&&(r.class+=" "+i)),r}function th(r){let t=[];for(let e=r.parents.length;e>1;e--){let i=e==r.parents.length?r.tile:r.parents[e].tile;i instanceof rt&&t.push(i.mark)}return t}function _i(r){let t=q.get(r);return t&&t.setDOM(r.cloneNode()),r}class me extends Fi{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}me.inline=new me("span");me.block=new me("div");const Ji=new class extends Fi{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Fn{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=et.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new zi(t,t.contentDOM),this.updateInner([new ct(0,0,0,t.state.doc.length)],null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:f,toA:u})=>uthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((e=this.domChanged)===null||e===void 0)&&e.newSel?s=this.domChanged.newSel.head:!ah(t.changes,this.hasComposition)&&!t.selectionSet&&(s=t.state.selection.main.head));let n=s>-1?ih(this.view,t.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:f,to:u}=this.hasComposition;i=new ct(f,u,t.changes.mapPos(f,-1),t.changes.mapPos(u,1)).addToSet(i.slice())}this.hasComposition=n?{from:n.range.fromB,to:n.range.toB}:null,(w.ie||w.chrome)&&!n&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let h=rh(o,this.decorations,t.changes);h.length&&(i=ct.extendWithRanges(i,h));let a=lh(l,this.blockWrappers,t.changes);return a.length&&(i=ct.extendWithRanges(i,a)),n&&!i.some(f=>f.fromA<=n.range.fromA&&f.toA>=n.range.toA)&&(i=n.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,n),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(e||t.length){let o=this.tile,l=new _l(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);e&&q.get(e.text)&&l.cache.reused.set(q.get(e.text),2),this.tile=l.run(t,e),Bs(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let n=w.chrome||w.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(n),n&&(n.written||i.selectionRange.focusNode!=n.node||!this.tile.dom.contains(n.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to-1)&&Ee(i,this.view.observer.selectionRange)&&!(s&&i.contains(s));if(!(n||e||o))return;let l=this.forceSelection;this.forceSelection=!1;let h=this.view.state.selection.main,a,f;if(h.empty?f=a=this.inlineDOMNearPos(h.anchor,h.assoc||1):(f=this.inlineDOMNearPos(h.head,h.head==h.from?1:-1),a=this.inlineDOMNearPos(h.anchor,h.anchor==h.from?1:-1)),w.gecko&&h.empty&&!this.hasComposition&&eh(a)){let c=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(c,a.node.childNodes[a.offset]||null)),a=f=new mt(c,0),l=!0}let u=this.view.observer.selectionRange;(l||!u.focusNode||(!Ne(a.node,a.offset,u.anchorNode,u.anchorOffset)||!Ne(f.node,f.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,h))&&(this.view.observer.ignore(()=>{w.android&&w.chrome&&i.contains(u.focusNode)&&hh(u.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let c=Ke(this.view.root);if(c)if(h.empty){if(w.gecko){let d=sh(a.node,a.offset);if(d&&d!=3){let p=(d==1?zr:Kr)(a.node,a.offset);p&&(a=new mt(p.node,p.offset))}}c.collapse(a.node,a.offset),h.bidiLevel!=null&&c.caretBidiLevel!==void 0&&(c.caretBidiLevel=h.bidiLevel)}else if(c.extend){c.collapse(a.node,a.offset);try{c.extend(f.node,f.offset)}catch{}}else{let d=document.createRange();h.anchor>h.head&&([a,f]=[f,a]),d.setEnd(f.node,f.offset),d.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(d)}o&&this.view.root.activeElement==i&&(i.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(a,f)),this.impreciseAnchor=a.precise?null:new mt(u.anchorNode,u.anchorOffset),this.impreciseHead=f.precise?null:new mt(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&Ne(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=Ke(t.root),{anchorNode:s,anchorOffset:n}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let o=this.lineAt(e.head,e.assoc);if(!o)return;let l=o.posAtStart;if(e.head==l||e.head==l+o.length)return;let h=this.coordsAt(e.head,-1),a=this.coordsAt(e.head,1);if(!h||!a||h.bottom>a.top)return;let f=this.domAtPos(e.head+e.assoc,e.assoc);i.collapse(f.node,f.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let u=t.observer.selectionRange;t.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=e.from&&i.collapse(s,n)}posFromDOM(t,e){let i=this.tile.nearest(t);if(!i)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let s=i.posAtStart;if(i.isComposite()){let n;if(t==i.dom)n=i.dom.childNodes[e];else{let o=It(t)==0?0:e==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?o=-1:o=1),t=l}o<0?n=t:n=t.nextSibling}if(n==i.dom.firstChild)return s;for(;n&&!q.get(n);)n=n.nextSibling;if(!n)return s+i.length;for(let o=0,l=s;;o++){let h=i.children[o];if(h.dom==n)return l;l+=h.length+h.breakAfter}}else return i.isText()?t==i.dom?s+e:s+(e?i.length:0):s}domAtPos(t,e){let{tile:i,offset:s}=this.tile.resolveBlock(t,e);return i.isWidget()?i.domPosFor(s,e):i.domIn(s,e)}inlineDOMNearPos(t,e){let i,s=-1,n=!1,o,l=-1,h=!1;return this.tile.blockTiles((a,f)=>{if(a.isWidget()){if(a.flags&32&&f>=t)return!0;a.flags&16&&(n=!0)}else{let u=f+a.length;if(f<=t&&(i=a,s=t-f,n=u=t&&!o&&(o=a,l=t-f,h=f>t),f>t&&o)return!0}}),!i&&!o?this.domAtPos(t,e):(n&&o?i=null:h&&i&&(o=null),i&&e<0||!o?i.domIn(s,e):o.domIn(l,e))}coordsAt(t,e,i){let{tile:s,offset:n}=this.tile.resolveBlock(t,e);return s.isWidget()?s.widget instanceof Zi?null:s.coordsInWidget(n,e,!0):s.coordsIn(n,e,i)}lineAt(t,e){let{tile:i}=this.tile.resolveBlock(t,e);return i.isLine()?i:null}coordsForChar(t){let{tile:e,offset:i}=this.tile.resolveBlock(t,1);if(!e.isLine())return null;function s(n,o){if(n.isComposite())for(let l of n.children){if(l.length>=o){let h=s(l,o);if(h)return h}if(o-=l.length,o<0)break}else if(n.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,h=this.view.textDirection==G.LTR,a=0,f=(u,c,d)=>{for(let p=0;ps);p++){let g=u.children[p],m=c+g.length,b=g.dom.getBoundingClientRect(),{height:y}=b;if(d&&!p&&(a+=b.top-d.top),g instanceof Nt)m>i&&f(g,c,b);else if(c>=i&&(a>0&&e.push(-a),e.push(y+a),a=0,o)){let v=g.dom.lastChild,E=v?gi(v):[];if(E.length){let T=E[E.length-1],C=h?T.right-b.left:b.right-T.left;C>l&&(l=C,this.minWidth=n,this.minWidthFrom=c,this.minWidthTo=m)}}d&&p==u.children.length-1&&(a+=d.bottom-b.bottom),c=m+g.breakAfter}};return f(this.tile,0,null),e}textDirectionAt(t){let{tile:e}=this.tile.resolveBlock(t,1);return getComputedStyle(e.dom).direction=="rtl"?G.RTL:G.LTR}measureTextSize(){let t=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,h;for(let a of o.children){if(!a.isText()||/[^ -~]/.test(a.text))return;let f=gi(a.dom);if(f.length!=1)return;l+=f[0].width,h=f[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:h}}});if(t)return t;let e=document.createElement("div"),i,s,n;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(e);let o=gi(e.firstChild)[0];i=e.getBoundingClientRect().height,s=o&&o.width?o.width/27:7,n=o&&o.height?o.height:i,e.remove()}),{lineHeight:i,charWidth:s,textHeight:n}}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,s=0;;s++){let n=s==e.viewports.length?null:e.viewports[s],o=n?n.from-1:this.view.state.doc.length;if(o>i){let l=(e.lineBlockAt(o).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(et.replace({widget:new Zi(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!n)break;i=n.to+1}return et.set(t)}updateDeco(){let t=1,e=this.view.state.facet(Hi).map(n=>(this.dynamicDecorationMap[t++]=typeof n=="function")?n(this.view):n),i=!1,s=this.view.state.facet(Zs).map((n,o)=>{let l=typeof n=="function";return l&&(i=!0),l?n(this.view):n});for(s.length&&(this.dynamicDecorationMap[t++]=i,e.push(N.join(s))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof n=="function"?n(this.view):n)}scrollIntoView(t){if(t.isSnapshot){let a=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=a.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let a of this.view.state.facet(eo))try{if(a(this.view,t.range,t))return!0}catch(f){Tt(this.view.state,f,"scroll handler")}let{range:e}=t,i=this.coordsAt(e.head,e.assoc||(e.head>e.anchor?-1:1)),s;if(!i)return;!e.empty&&(s=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let n=lo(this.view),o={left:i.left-n.left,top:i.top-n.top,right:i.right+n.right,bottom:i.bottom+n.bottom},{offsetWidth:l,offsetHeight:h}=this.view.scrollDOM;if(Ml(this.view.scrollDOM,o,e.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(e);return e(this.tile.resolveBlock(t,1).tile)}destroy(){Bs(this.tile)}}function Bs(r,t){let e=t?.get(r);if(e!=1){e==null&&r.destroy();for(let i of r.children)Bs(i,t)}}function eh(r){return r.node.nodeType==1&&r.node.firstChild&&(r.offset==0||r.node.childNodes[r.offset-1].contentEditable=="false")&&(r.offset==r.node.childNodes.length||r.node.childNodes[r.offset].contentEditable=="false")}function ao(r,t){let e=r.observer.selectionRange;if(!e.focusNode)return null;let i=zr(e.focusNode,e.focusOffset),s=Kr(e.focusNode,e.focusOffset),n=i||s;if(s&&i&&s.node!=i.node){let l=q.get(s.node);if(!l||l.isText()&&l.text!=s.node.nodeValue)n=s;else if(r.docView.lastCompositionAfterCursor){let h=q.get(i.node);!h||h.isText()&&h.text!=i.node.nodeValue||(n=s)}}if(r.docView.lastCompositionAfterCursor=n!=i,!n)return null;let o=t-n.offset;return{from:o,to:o+n.node.nodeValue.length,node:n.node}}function ih(r,t,e){let i=ao(r,e);if(!i)return null;let{node:s,from:n,to:o}=i,l=s.nodeValue;if(/[\n\r]/.test(l)||r.state.doc.sliceString(i.from,i.to)!=l)return null;let h=t.invertedDesc;return{range:new ct(h.mapPos(n),h.mapPos(o),n,o),text:s}}function sh(r,t){return r.nodeType!=1?0:(t&&r.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(e=!0)}),e}class Zi extends Fi{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function fh(r,t,e=1){let i=r.charCategorizer(t),s=r.doc.lineAt(t),n=t-s.from;if(s.length==0)return k.cursor(t);n==0?e=1:n==s.length&&(e=-1);let o=n,l=n;e<0?o=At(s.text,n,!1):l=At(s.text,n);let h=i(s.text.slice(o,l));for(;o>0;){let a=At(s.text,o,!1);if(i(s.text.slice(a,o))!=h)break;o=a}for(;lr.defaultLineHeight*1.5){let l=r.viewState.heightOracle.textHeight,h=Math.floor((s-e.top-(r.defaultLineHeight-l)*.5)/l);n+=h*r.viewState.heightOracle.lineLength}let o=r.state.sliceDoc(e.from,e.to);return e.from+wl(o,n,r.state.tabSize)}function ch(r,t,e){let i=r.lineBlockAt(t);if(Array.isArray(i.type)){let s;for(let n of i.type){if(n.from>t)break;if(!(n.tot)return n;(!s||n.type==pt.Text&&(s.type!=n.type||(e<0?n.fromt)))&&(s=n)}}return s||i}return i}function dh(r,t,e,i){let s=ch(r,t.head,t.assoc||-1),n=!i||s.type!=pt.Text||!(r.lineWrapping||s.widgetLineBreaks)?null:r.coordsAtPos(t.assoc<0&&t.head>s.from?t.head-1:t.head);if(n){let o=r.dom.getBoundingClientRect(),l=r.textDirectionAt(s.from),h=r.posAtCoords({x:e==(l==G.LTR)?o.right-1:o.left+1,y:(n.top+n.bottom)/2});if(h!=null)return k.cursor(h,e?-1:1)}return k.cursor(e?s.to:s.from,e?-1:1)}function Hn(r,t,e,i){let s=r.state.doc.lineAt(t.head),n=r.bidiSpans(s),o=r.textDirectionAt(s.from);for(let l=t,h=null;;){let a=Hl(s,n,o,l,e),f=Ur;if(!a){if(s.number==(e?r.state.doc.lines:1))return l;f=` +`,s=r.state.doc.line(s.number+(e?1:-1)),n=r.bidiSpans(s),a=r.visualLineSide(s,!e)}if(h){if(!h(f))return l}else{if(!i)return a;h=i(f)}l=a}}function ph(r,t,e){let i=r.state.charCategorizer(t),s=i(e);return n=>{let o=i(n);return s==Rt.Space&&(s=o),s==o}}function gh(r,t,e,i){let s=t.head,n=e?1:-1;if(s==(e?r.state.doc.length:0))return k.cursor(s,t.assoc);let o=t.goalColumn,l,h=r.contentDOM.getBoundingClientRect(),a=r.coordsAtPos(s,t.assoc||((t.empty?e:t.head==t.from)?1:-1)),f=r.documentTop;if(a)o==null&&(o=a.left-h.left),l=n<0?a.top:a.bottom;else{let p=r.viewState.lineBlockAt(s);o==null&&(o=Math.min(h.right-h.left,r.defaultCharacterWidth*(s-p.from))),l=(n<0?p.top:p.bottom)+f}let u=h.left+o,c=r.viewState.heightOracle.textHeight>>1,d=i??c;for(let p=0;;p+=c){let g=l+(d+p)*n,m=Rs(r,{x:u,y:g},!1,n);if(e?g>h.bottom:gl:y{if(t>n&&ts(r)),e.from,t.head>e.from?-1:1);return i==e.from?e:k.cursor(i,ir.viewState.docHeight)return new Ct(r.state.doc.length,-1);if(a=r.elementAtHeight(h),i==null)break;if(a.type==pt.Text){if(i<0?a.tor.viewport.to)break;let c=r.docView.coordsAt(i<0?a.from:a.to,i>0?-1:1);if(c&&(i<0?c.top<=h+n:c.bottom>=h+n))break}let u=r.viewState.heightOracle.textHeight/2;h=i>0?a.bottom+u:a.top-u}if(r.viewport.from>=a.to||r.viewport.to<=a.from){if(e)return null;if(a.type==pt.Text){let u=uh(r,s,a,o,l);return new Ct(u,u==a.from?1:-1)}}if(a.type!=pt.Text)return h<(a.top+a.bottom)/2?new Ct(a.from,1):new Ct(a.to,-1);let f=r.docView.lineAt(a.from,2);return(!f||f.length!=a.length)&&(f=r.docView.lineAt(a.from,-2)),new mh(r,o,l,r.textDirectionAt(a.from)).scanTile(f,a.from)}class mh{constructor(t,e,i,s){this.view=t,this.x=e,this.y=i,this.baseDir=s,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+s.from>1;e:if(o.has(g)){let b=s+Math.floor(Math.random()*p);for(let y=0;y1)){if(y.bottomthis.y)(!a||a.top>y.top)&&(a=y),v=-1;else{let E=y.left>this.x?this.x-y.left:y.right(p+p+g)/3)return this.y=h.bottom-1,this.scan(t,e,!0);if(a&&a.top<(p+g+g)/3)return this.y=a.top+1,this.scan(t,e,!0)}let d=(l?this.dirAt(t[f],1):this.baseDir)==G.LTR;return{i:f,after:this.x>(c.left+c.right)/2==d}}scanText(t,e){let i=[];for(let n=0;n{let o=i[n]-e,l=i[n+1]-e;return $e(t.dom,o,l).getClientRects()});return s.after?new Ct(i[s.i+1],-1):new Ct(i[s.i],1)}scanTile(t,e){if(!t.length)return new Ct(e,1);if(t.children.length==1){let l=t.children[0];if(l.isText())return this.scanText(l,e);if(l.isComposite())return this.scanTile(l,e)}let i=[e];for(let l=0,h=e;l{let h=t.children[l];return h.flags&48?null:(h.dom.nodeType==1?h.dom:$e(h.dom,0,h.length)).getClientRects()}),n=t.children[s.i],o=i[s.i];return n.isText()?this.scanText(n,o):n.isComposite()?this.scanTile(n,o):s.after?new Ct(i[s.i+1],-1):new Ct(o,1)}}const re="￿";class bh{constructor(t,e){this.points=t,this.view=e,this.text="",this.lineSeparator=e.state.facet(I.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=re}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let s=t;;){this.findPointBefore(i,s);let n=this.text.length;this.readNode(s);let o=q.get(s),l=s.nextSibling;if(l==e){o?.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let h=q.get(l);(o&&h?o.breakAfter:(o?o.breakAfter:Oi(s))||Oi(l)&&(s.nodeName!="BR"||o?.isWidget())&&this.text.length>n)&&!wh(l,e)&&this.lineBreak(),s=l}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let n=-1,o=1,l;if(this.lineSeparator?(n=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(e))&&(n=l.index,o=l[0].length),this.append(e.slice(i,n<0?e.length:n)),n<0)break;if(this.lineBreak(),o>1)for(let h of this.points)h.node==t&&h.pos>this.text.length&&(h.pos-=o-1);i=n+o}}readNode(t){let e=q.get(t),i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(xh(t,i.node,i.offset)?e:0))}}function xh(r,t,e){for(;;){if(!t||e-1;let{impreciseHead:n,impreciseAnchor:o}=t.docView,l=t.state.selection;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=uo(t.docView.tile,e,i,0))){let h=n||o?[]:Sh(t),a=new bh(h,t);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=vh(h,this.bounds.from)}else{let h=t.observer.selectionRange,a=n&&n.node==h.focusNode&&n.offset==h.focusOffset||!Os(t.contentDOM,h.focusNode)?l.main.head:t.docView.posFromDOM(h.focusNode,h.focusOffset),f=o&&o.node==h.anchorNode&&o.offset==h.anchorOffset||!Os(t.contentDOM,h.anchorNode)?l.main.anchor:t.docView.posFromDOM(h.anchorNode,h.anchorOffset),u=t.viewport;if((w.ios||w.chrome)&&a!=f&&Math.min(a,f)<=l.main.from&&Math.max(a,f)>=l.main.to&&(u.from>0||u.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(k.range(f,a));else if(t.lineWrapping&&f==a&&!(l.main.empty&&l.main.head==a)&&t.inputState.lastTouchTime>Date.now()-100){let c=t.coordsAtPos(a,-1),d=0;c&&(d=t.inputState.lastTouchY<=c.bottom?-1:1),this.newSel=k.create([k.cursor(a,d)])}else this.newSel=k.single(f,a)}}}function uo(r,t,e,i){if(r.isComposite()){let s=-1,n=-1,o=-1,l=-1;for(let h=0,a=i,f=i;he)return uo(u,t,e,a);if(c>=t&&s==-1&&(s=h,n=a),a>e&&u.dom.parentNode==r.dom){o=h,l=f;break}f=c,a=c+u.breakAfter}return{from:n,to:l<0?i+r.length:l,startDOM:(s?r.children[s-1].dom.nextSibling:null)||r.dom.firstChild,endDOM:o=0?r.children[o].dom:null}}else return r.isText()?{from:i,to:i+r.length,startDOM:r.dom,endDOM:r.dom.nextSibling}:null}function co(r,t){let e,{newSel:i}=t,{state:s}=r,n=s.selection.main,o=r.inputState.lastKeyTime>Date.now()-100?r.inputState.lastKeyCode:-1;if(t.bounds){let{from:l,to:h}=t.bounds,a=n.from,f=null;(o===8||w.android&&t.text.length=l&&n.to<=h&&(t.typeOver||u!=t.text)&&u.slice(0,n.from-l)==t.text.slice(0,n.from-l)&&u.slice(n.to-l)==t.text.slice(c=t.text.length-(u.length-(n.to-l)))?e={from:n.from,to:n.to,insert:B.of(t.text.slice(n.from-l,c).split(re))}:(d=po(u,t.text,a-l,f))&&(w.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==re+re&&d.toB--,e={from:l+d.from,to:l+d.toA,insert:B.of(t.text.slice(d.from,d.toB).split(re))})}else i&&(!r.hasFocus&&s.facet(Bt)||Bi(i,n))&&(i=null);if(!e&&!i)return!1;if((w.mac||w.android)&&e&&e.from==e.to&&e.from==n.head-1&&/^\. ?$/.test(e.insert.toString())&&r.contentDOM.getAttribute("autocorrect")=="off"?(i&&e.insert.length==2&&(i=k.single(i.main.anchor-1,i.main.head-1)),e={from:e.from,to:e.to,insert:B.of([e.insert.toString().replace("."," ")])}):s.doc.lineAt(n.from).toDate.now()-50?e={from:n.from,to:n.to,insert:s.toText(r.inputState.insertingText)}:w.chrome&&e&&e.from==e.to&&e.from==n.head&&e.insert.toString()==` + `&&r.lineWrapping&&(i&&(i=k.single(i.main.anchor-1,i.main.head-1)),e={from:n.from,to:n.to,insert:B.of([" "])}),e)return tn(r,e,i,o);if(i&&!Bi(i,n)){let l=!1,h="select";return r.inputState.lastSelectionTime>Date.now()-50&&(r.inputState.lastSelectionOrigin=="select"&&(l=!0),h=r.inputState.lastSelectionOrigin,h=="select.pointer"&&(i=fo(s.facet(Qe).map(a=>a(r)),i))),r.dispatch({selection:i,scrollIntoView:l,userEvent:h}),!0}else return!1}function tn(r,t,e,i=-1){if(w.ios&&r.inputState.flushIOSKey(t))return!0;let s=r.state.selection.main;if(w.android&&(t.to==s.to&&(t.from==s.from||t.from==s.from-1&&r.state.sliceDoc(t.from,s.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&fe(r.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||i==8&&t.insert.lengths.head)&&fe(r.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&fe(r.contentDOM,"Delete",46)))return!0;let n=t.insert.toString();r.inputState.composing>=0&&r.inputState.composing++;let o,l=()=>o||(o=kh(r,t,e));return r.state.facet(Jr).some(h=>h(r,t.from,t.to,n,l))||r.dispatch(l()),!0}function kh(r,t,e){let i,s=r.state,n=s.selection.main,o=-1;if(t.from==t.to&&t.fromn.to){let h=t.fromu(r)),a,h);t.from==f&&(o=f)}if(o>-1)i={changes:t,selection:k.cursor(t.from+t.insert.length,-1)};else if(t.from>=n.from&&t.to<=n.to&&t.to-t.from>=(n.to-n.from)/3&&(!e||e.main.empty&&e.main.from==t.from+t.insert.length)&&r.inputState.composing<0){let h=n.fromt.to?s.sliceDoc(t.to,n.to):"";i=s.replaceSelection(r.state.toText(h+t.insert.sliceString(0,void 0,r.state.lineBreak)+a))}else{let h=s.changes(t),a=e&&e.main.to<=h.newLength?e.main:void 0;if(s.selection.ranges.length>1&&(r.inputState.composing>=0||r.inputState.compositionPendingChange)&&t.to<=n.to+10&&t.to>=n.to-10){let f=r.state.sliceDoc(t.from,t.to),u,c=e&&ao(r,e.main.head);if(c){let p=t.insert.length-(t.to-t.from);u={from:c.from,to:c.to-p}}else u=r.state.doc.lineAt(n.head);let d=n.to-t.to;i=s.changeByRange(p=>{if(p.from==n.from&&p.to==n.to)return{changes:h,range:a||p.map(h)};let g=p.to-d,m=g-f.length;if(r.state.sliceDoc(m,g)!=f||g>=u.from&&m<=u.to)return{range:p};let b=s.changes({from:m,to:g,insert:t.insert}),y=p.to-n.to;return{changes:b,range:a?k.range(Math.max(0,a.anchor+y),Math.max(0,a.head+y)):p.map(b)}})}else i={changes:h,selection:a&&s.selection.replaceRange(a)}}let l="input.type";return(r.composing||r.inputState.compositionPendingChange&&r.inputState.compositionEndedAt>Date.now()-50)&&(r.inputState.compositionPendingChange=!1,l+=".compose",r.inputState.compositionFirstChange&&(l+=".start",r.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:l,scrollIntoView:!0})}function po(r,t,e,i){let s=Math.min(r.length,t.length),n=0;for(;n0&&l>0&&r.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let h=Math.max(0,n-Math.min(o,l));e-=o+h-n}if(o=o?n-e:0;n-=h,l=n+(l-o),o=n}else if(l=l?n-e:0;n-=h,o=n+(o-l),l=n}return{from:n,toA:o,toB:l}}function Sh(r){let t=[];if(r.root.activeElement!=r.contentDOM)return t;let{anchorNode:e,anchorOffset:i,focusNode:s,focusOffset:n}=r.observer.selectionRange;return e&&(t.push(new Vn(e,i)),(s!=e||n!=i)&&t.push(new Vn(s,n))),t}function vh(r,t){if(r.length==0)return null;let e=r[0].pos,i=r.length==2?r[1].pos:e;return e>-1&&i>-1?k.single(e+t,i+t):null}function Bi(r,t){return t.head==r.main.head&&t.anchor==r.main.anchor}class Ch{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,w.safari&&t.contentDOM.addEventListener("input",()=>null),w.gecko&&Vh(t.contentDOM.ownerDocument)}handleEvent(t){!Eh(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,e){let i=this.handlers[t];if(i){for(let s of i.observers)s(this.view,e);for(let s of i.handlers){if(e.defaultPrevented)break;if(s(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=Oh(t),i=this.handlers,s=this.view.contentDOM;for(let n in e)if(n!="scroll"){let o=!e[n].handlers.length,l=i[n];l&&o!=!l.handlers.length&&(s.removeEventListener(n,this.handleEvent),l=null),l||s.addEventListener(n,this.handleEvent,{passive:o})}for(let n in i)n!="scroll"&&!e[n]&&s.removeEventListener(n,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&mo.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),w.android&&w.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(w.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(go.some(e=>e.keyCode==t.keyCode)&&!t.ctrlKey||Th.indexOf(t.key)>-1&&t.ctrlKey)){let e={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return e.shiftKey&&w.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&Ah(this.view.win)&&(e.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:e},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let e=this.pendingIOSKey;return!e||e.key=="Enter"&&t&&t.from0?!0:w.safari&&!w.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Ah(r){return r.visualViewport?r.visualViewport.height*r.visualViewport.scale/r.document.documentElement.clientHeight<.85:!1}function zn(r,t){return(e,i)=>{try{return t.call(r,i,e)}catch(s){Tt(e.state,s)}}}function Oh(r){let t=Object.create(null);function e(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of r){let s=i.spec,n=s&&s.plugin.domEventHandlers,o=s&&s.plugin.domEventObservers;if(n)for(let l in n){let h=n[l];h&&e(l).handlers.push(zn(i.value,h))}if(o)for(let l in o){let h=o[l];h&&e(l).observers.push(zn(i.value,h))}}for(let i in bt)e(i).handlers.push(bt[i]);for(let i in nt)e(i).observers.push(nt[i]);return t}const go=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Th="dthko",mo=[16,17,18,20,91,92,224,225],ni=6;function ri(r){return Math.max(0,r)*.7+8}function Mh(r,t){return Math.max(Math.abs(r.clientX-t.clientX),Math.abs(r.clientY-t.clientY))}class Ph{constructor(t,e,i,s){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=Fr(t.contentDOM),this.atoms=t.state.facet(Qe).map(o=>o(t));let n=t.contentDOM.ownerDocument;n.addEventListener("mousemove",this.move=this.move.bind(this)),n.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(I.allowMultipleSelections)&&Dh(t,e),this.dragging=Rh(t,e)&&wo(e)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Mh(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let e=0,i=0,s=0,n=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:n,bottom:l}=this.scrollParents.y.getBoundingClientRect());let h=lo(this.view);t.clientX-h.left<=s+ni?e=-ri(s-t.clientX):t.clientX+h.right>=o-ni&&(e=ri(t.clientX-o)),t.clientY-h.top<=n+ni?i=-ri(n-t.clientY):t.clientY+h.bottom>=l-ni&&(i=ri(t.clientY-l)),this.setScrollSpeed(e,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:e}=this,i=fo(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(e.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Dh(r,t){let e=r.state.facet(Gr);return e.length?e[0](t):w.mac?t.metaKey:t.ctrlKey}function Bh(r,t){let e=r.state.facet(Yr);return e.length?e[0](t):w.mac?!t.altKey:!t.ctrlKey}function Rh(r,t){let{main:e}=r.state.selection;if(e.empty)return!1;let i=Ke(r.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let n=0;n=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function Eh(r,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target,i;e!=r.contentDOM;e=e.parentNode)if(!e||e.nodeType==11||(i=q.get(e))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const bt=Object.create(null),nt=Object.create(null),bo=w.ie&&w.ie_version<15||w.ios&&w.webkit_version<604;function Nh(r){let t=r.dom.parentNode;if(!t)return;let e=t.appendChild(document.createElement("textarea"));e.style.cssText="position: fixed; left: -10000px; top: 10px",e.focus(),setTimeout(()=>{r.focus(),e.remove(),xo(r,e.value)},50)}function Ki(r,t,e){for(let i of r.facet(t))e=i(e,r);return e}function xo(r,t){t=Ki(r.state,Xs,t);let{state:e}=r,i,s=1,n=e.toText(t),o=n.lines==e.selection.ranges.length;if(Es!=null&&e.selection.ranges.every(h=>h.empty)&&Es==n.toString()){let h=-1;i=e.changeByRange(a=>{let f=e.doc.lineAt(a.from);if(f.from==h)return{range:a};h=f.from;let u=e.toText((o?n.line(s++).text:t)+e.lineBreak);return{changes:{from:f.from,insert:u},range:k.cursor(a.from+u.length)}})}else o?i=e.changeByRange(h=>{let a=n.line(s++);return{changes:{from:h.from,to:h.to,insert:a.text},range:k.cursor(h.from+a.length)}}):i=e.replaceSelection(n);r.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}nt.scroll=r=>{let t=r.inputState;t.lastScrollTop=r.scrollDOM.scrollTop,t.lastScrollLeft=r.scrollDOM.scrollLeft,w.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};nt.wheel=nt.mousewheel=r=>{r.inputState.lastWheelEvent=Date.now()};bt.keydown=(r,t)=>(r.inputState.setSelectionOrigin("select"),t.keyCode==27&&r.inputState.tabFocusMode!=0&&(r.inputState.tabFocusMode=Date.now()+2e3),!1);nt.touchstart=(r,t)=>{let e=r.inputState,i=t.targetTouches[0];e.touchActive=!0,e.lastTouchTime=Date.now(),i&&(e.lastTouchX=i.clientX,e.lastTouchY=i.clientY),e.setSelectionOrigin("select.pointer")};nt.touchmove=r=>{r.inputState.setSelectionOrigin("select.pointer")};nt.touchend=(r,t)=>{r.inputState.touchActive=!1};bt.mousedown=(r,t)=>{if(r.observer.flush(),r.inputState.lastTouchTime>Date.now()-2e3)return!1;let e=null;for(let i of r.state.facet(Xr))if(e=i(r,t),e)break;if(!e&&t.button==0&&(e=Lh(r,t)),e){let i=!r.hasFocus;r.inputState.startMouseSelection(new Ph(r,t,e,i)),i&&r.observer.ignore(()=>{Hr(r.contentDOM);let n=r.root.activeElement;n&&!n.contains(r.contentDOM)&&n.blur()});let s=r.inputState.mouseSelection;if(s)return s.start(t),s.dragging===!1}else r.inputState.setSelectionOrigin("select.pointer");return!1};function Kn(r,t,e,i){if(i==1)return k.cursor(t,e);if(i==2)return fh(r.state,t,e);{let s=r.docView.lineAt(t,e),n=r.state.doc.lineAt(s?s.posAtEnd:t),o=s?s.posAtStart:n.from,l=s?s.posAtEnd:n.to;return lDate.now()-400&&Math.abs(t.clientX-r.clientX)<2&&Math.abs(t.clientY-r.clientY)<2?(qn+1)%3:1}function Lh(r,t){let e=r.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=wo(t),s=r.state.selection;return{update(n){n.docChanged&&(e.pos=n.changes.mapPos(e.pos),s=s.map(n.changes))},get(n,o,l){let h=r.posAndSideAtCoords({x:n.clientX,y:n.clientY},!1),a,f=Kn(r,h.pos,h.assoc,i);if(e.pos!=h.pos&&!o){let u=Kn(r,e.pos,e.assoc,i),c=Math.min(u.from,f.from),d=Math.max(u.to,f.to);f=c1&&(a=Wh(s,h.pos))?a:l?s.addRange(f):k.create([f])}}}function Wh(r,t){for(let e=0;e=t)return k.create(r.ranges.slice(0,e).concat(r.ranges.slice(e+1)),r.mainIndex==e?0:r.mainIndex-(r.mainIndex>e?1:0))}return null}bt.dragstart=(r,t)=>{let{selection:{main:e}}=r.state;if(t.target.draggable){let s=r.docView.tile.nearest(t.target);if(s&&s.isWidget()){let n=s.posAtStart,o=n+s.length;(n>=e.to||o<=e.from)&&(e=k.undirectionalRange(n,o))}}let{inputState:i}=r;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=e,t.dataTransfer&&(t.dataTransfer.setData("Text",Ki(r.state,_s,r.state.sliceDoc(e.from,e.to))),t.dataTransfer.effectAllowed="copyMove"),!1};bt.dragend=r=>(r.inputState.draggedContent=null,!1);function Qn(r,t,e,i){if(e=Ki(r.state,Xs,e),!e)return;let s=r.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:n}=r.inputState,o=i&&n&&Bh(r,t)?{from:n.from,to:n.to}:null,l={from:s,insert:e},h=r.state.changes(o?[o,l]:l);r.focus(),r.dispatch({changes:h,selection:{anchor:h.mapPos(s,-1),head:h.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),r.inputState.draggedContent=null}bt.drop=(r,t)=>{if(!t.dataTransfer)return!1;if(r.state.readOnly)return!0;let e=t.dataTransfer.files;if(e&&e.length){let i=Array(e.length),s=0,n=()=>{++s==e.length&&Qn(r,t,i.filter(o=>o!=null).join(r.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),n()},l.readAsText(e[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Qn(r,t,i,!0),!0}return!1};bt.paste=(r,t)=>{if(r.state.readOnly)return!0;r.observer.flush();let e=bo?null:t.clipboardData;return e?(xo(r,e.getData("text/plain")||e.getData("text/uri-list")),!0):(Nh(r),!1)};function Fh(r,t){let e=r.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),r.focus()},50)}function Hh(r){let t=[],e=[],i=!1;for(let s of r.selection.ranges)s.empty||(t.push(r.sliceDoc(s.from,s.to)),e.push(s));if(!t.length){let s=-1;for(let{from:n}of r.selection.ranges){let o=r.doc.lineAt(n);o.number>s&&(t.push(o.text),e.push({from:o.from,to:Math.min(r.doc.length,o.to+1)})),s=o.number}i=!0}return{text:Ki(r,_s,t.join(r.lineBreak)),ranges:e,linewise:i}}let Es=null;bt.copy=bt.cut=(r,t)=>{if(!Ee(r.contentDOM,r.observer.selectionRange))return!1;let{text:e,ranges:i,linewise:s}=Hh(r.state);if(!e&&!s)return!1;Es=s?e:null,t.type=="cut"&&!r.state.readOnly&&r.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let n=bo?null:t.clipboardData;return n?(n.clearData(),n.setData("text/plain",e),!0):(Fh(r,e),!1)};const yo=ke.define();function ko(r,t){let e=[];for(let i of r.facet(Zr)){let s=i(r,t);s&&e.push(s)}return e.length?r.update({effects:e,annotations:yo.of(!0)}):null}function So(r){setTimeout(()=>{let t=r.hasFocus;if(t!=r.inputState.notifiedFocused){let e=ko(r.state,t);e?r.dispatch(e):r.update([])}},10)}nt.focus=r=>{r.inputState.lastFocusTime=Date.now(),!r.scrollDOM.scrollTop&&(r.inputState.lastScrollTop||r.inputState.lastScrollLeft)&&(r.scrollDOM.scrollTop=r.inputState.lastScrollTop,r.scrollDOM.scrollLeft=r.inputState.lastScrollLeft),So(r)};nt.blur=r=>{r.observer.clearSelectionRange(),So(r)};nt.compositionstart=nt.compositionupdate=r=>{r.observer.editContext||(r.inputState.compositionFirstChange==null&&(r.inputState.compositionFirstChange=!0),r.inputState.composing<0&&(r.inputState.composing=0))};nt.compositionend=r=>{r.observer.editContext||(r.inputState.composing=-1,r.inputState.compositionEndedAt=Date.now(),r.inputState.compositionPendingKey=!0,r.inputState.compositionPendingChange=r.observer.pendingRecords().length>0,r.inputState.compositionFirstChange=null,w.chrome&&w.android?r.observer.flushSoon():r.inputState.compositionPendingChange?Promise.resolve().then(()=>r.observer.flush()):setTimeout(()=>{r.inputState.composing<0&&r.docView.hasComposition&&r.update([])},50))};nt.contextmenu=r=>{r.inputState.lastContextMenu=Date.now()};bt.beforeinput=(r,t)=>{var e,i;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(r.inputState.insertingText=t.data,r.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&r.observer.editContext){let n=(e=t.dataTransfer)===null||e===void 0?void 0:e.getData("text/plain"),o=t.getTargetRanges();if(n&&o.length){let l=o[0],h=r.posAtDOM(l.startContainer,l.startOffset),a=r.posAtDOM(l.endContainer,l.endOffset);return tn(r,{from:h,to:a,insert:r.state.toText(n)},null),!0}}let s;if(w.chrome&&w.android&&(s=go.find(n=>n.inputType==t.inputType))&&(r.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let n=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>n+10&&r.hasFocus&&(r.contentDOM.blur(),r.focus())},100)}return w.ios&&t.inputType=="deleteContentForward"&&r.observer.flushSoon(),w.safari&&t.inputType=="insertText"&&r.inputState.composing>=0&&setTimeout(()=>nt.compositionend(r,t),20),!1};const Un=new Set;function Vh(r){Un.has(r)||(Un.add(r),r.addEventListener("copy",()=>{}),r.addEventListener("cut",()=>{}))}const Gn=["pre-wrap","normal","pre-line","break-spaces"];let be=!1;function Yn(){be=!1}class zh{constructor(t){this.lineWrapping=t,this.doc=B.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Gn.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,h=Math.abs(e-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=e,this.charWidth=i,this.textHeight=s,this.lineLength=n,h){this.heightSamples={};for(let a=0;a0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>mi&&(be=!0),this.height=t)}replace(t,e,i){return st.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,s){let n=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:h,toA:a,fromB:f,toB:u}=s[l],c=n.lineAt(h,F.ByPosNoHeight,i.setDoc(e),0,0),d=c.to>=a?c:n.lineAt(a,F.ByPosNoHeight,i,0,0);for(u+=d.to-a,a=d.to;l>0&&c.from<=s[l-1].toA;)h=s[l-1].fromA,f=s[l-1].fromB,l--,hn*2){let l=t[e-1];l.break?t.splice(--e,1,l.left,null,l.right):t.splice(--e,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(n>s*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,n-=l.size}else break;else if(s=n&&o(this.lineAt(0,F.ByPos,i,s,n))}setMeasuredHeight(t){let e=t.heights[t.index++];e<0?(this.spaceAbove=-e,e=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(e)}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ht extends vo{constructor(t,e,i){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,e){return new gt(e,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,e,i){let s=i[0];return i.length==1&&(s instanceof ht||s instanceof _&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof _?s=new ht(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):st.of(i)}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more?this.setMeasuredHeight(s):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class _ extends st{constructor(t){super(t,0)}heightMetrics(t,e){let i=t.doc.lineAt(e).number,s=t.doc.lineAt(e+this.length).number,n=s-i+1,o,l=0;if(t.lineWrapping){let h=Math.min(this.height,t.lineHeight*n);o=h/n,this.length>n+1&&(l=(this.height-h)/(this.length-n-1))}else o=this.height/n;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(t,e,i,s){let{firstLine:n,lastLine:o,perLine:l,perChar:h}=this.heightMetrics(e,s);if(e.lineWrapping){let a=s+(t0){let n=i[i.length-1];n instanceof _?i[i.length-1]=new _(n.length+s):i.push(null,new _(s-1))}if(t>0){let n=i[0];n instanceof _?i[0]=new _(t+n.length):i.unshift(new _(t-1),null)}return st.of(i)}decomposeLeft(t,e){e.push(new _(t-1),null)}decomposeRight(t,e){e.push(null,new _(this.length-t-1))}updateHeight(t,e=0,i=!1,s){let n=e+this.length;if(s&&s.from<=e+this.length&&s.more){let o=[],l=Math.max(e,s.from),h=-1;for(s.from>e&&o.push(new _(s.from-e-1).updateHeight(t,e));l<=n&&s.more;){let f=t.doc.lineAt(l).length;o.length&&o.push(null);let u=s.heights[s.index++],c=0;u<0&&(c=-u,u=s.heights[s.index++]),h==-1?h=u:Math.abs(u-h)>=mi&&(h=-2);let d=new ht(f,u,c);d.outdated=!1,o.push(d),l+=f+1}l<=n&&o.push(null,new _(n-l).updateHeight(t,l));let a=st.of(o);return(h<0||Math.abs(a.height-this.height)>=mi||Math.abs(h-this.heightMetrics(t,e).perLine)>=mi)&&(be=!0),Ri(this,a)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class qh extends st{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,e,i,s){let n=i+this.left.height;return tl))return a;let f=e==F.ByPosNoHeight?F.ByPosNoHeight:F.ByPos;return h?a.join(this.right.lineAt(l,f,i,o,l)):this.left.lineAt(l,f,i,s,n).join(a)}forEachLine(t,e,i,s,n,o){let l=s+this.left.height,h=n+this.left.length+this.break;if(this.break)t=h&&this.right.forEachLine(t,e,i,l,h,o);else{let a=this.lineAt(h,F.ByPos,i,s,n);t=t&&a.from<=e&&o(a),e>a.to&&this.right.forEachLine(a.to+1,e,i,l,h,o)}}replace(t,e,i){let s=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));let n=[];t>0&&this.decomposeLeft(t,n);let o=n.length;for(let l of i)n.push(l);if(t>0&&Xn(n,o-1),e=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,s=i+this.break;if(t>=s)return this.right.decomposeRight(t-s,e);t2*e.size||e.size>2*t.size?st.of(this.break?[t,null,e]:[t,e]):(this.left=Ri(this.left,t),this.right=Ri(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,s){let{left:n,right:o}=this,l=e+n.length+this.break,h=null;return s&&s.from<=e+n.length&&s.more?h=n=n.updateHeight(t,e,i,s):n.updateHeight(t,e,i),s&&s.from<=l+o.length&&s.more?h=o=o.updateHeight(t,l,i,s):o.updateHeight(t,l,i),h?this.balanced(n,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Xn(r,t){let e,i;r[t]==null&&(e=r[t-1])instanceof _&&(i=r[t+1])instanceof _&&r.splice(t-1,3,new _(e.length+1+i.length))}const jh=5;class en{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let i=Math.min(e,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof ht?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new ht(i-this.pos,-1,0)),this.writtenTo=i,e>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=jh)&&this.addLineDeco(s,n,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new ht(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,e){let i=new _(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof ht)return t;let e=new ht(0,-1,0);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,t),s.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(e instanceof ht)&&!this.isCovered?this.nodes.push(new ht(0,-1,0)):(this.writtenTof.clientHeight||f.scrollWidth>f.clientWidth)&&u.overflow!="visible"){let c=f.getBoundingClientRect();n=Math.max(n,c.left),o=Math.min(o,c.right),l=Math.max(l,c.top),h=Math.min(a==r.parentNode?s.innerHeight:h,c.bottom)}a=u.position=="absolute"||u.position=="fixed"?f.offsetParent:f.parentNode}else if(a.nodeType==11)a=a.host;else break;return{left:n-e.left,right:Math.max(n,o)-e.left,top:l-(e.top+t),bottom:Math.max(l,h)-(e.top+t)}}function Yh(r){let t=r.getBoundingClientRect(),e=r.ownerDocument.defaultView||window;return t.left0&&t.top0}function Xh(r,t){let e=r.getBoundingClientRect();return{left:0,right:e.right-e.left,top:t,bottom:e.bottom-(e.top+t)}}class es{constructor(t,e,i,s){this.from=t,this.to=e,this.size=i,this.displaySize=s}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;itypeof s!="function"&&s.class=="cm-lineWrapping");this.heightOracle=new zh(i),this.stateDeco=Zn(e),this.heightMap=st.empty().applyChanges(this.stateDeco,B.empty,this.heightOracle.setDoc(e.doc),[new ct(0,0,0,e.doc.length)]);for(let s=0;s<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());s++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=et.set(this.lineGaps.map(s=>s.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let s=i?e.head:e.anchor;if(!t.some(({from:n,to:o})=>s>=n&&s<=o)){let{from:n,to:o}=this.lineBlockAt(s);t.push(new oi(n,o))}}return this.viewports=t.sort((i,s)=>i.from-s.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Jn:new sn(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(Me(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=Zn(this.state);let s=t.changedRanges,n=ct.extendWithRanges(s,Qh(i,this.stateDeco,t?t.changes:Y.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Yn(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),n),(this.heightMap.height!=o||be)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let h=n.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.headh.to)||!this.viewportIsAppropriate(h))&&(h=this.getViewport(0,e));let a=h.from!=this.viewport.from||h.to!=this.viewport.to;this.viewport=h,t.flags|=this.updateForViewport(),(a||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(zl)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,e=t.contentDOM,i=window.getComputedStyle(e),s=this.heightOracle,n=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?G.RTL:G.LTR;let o=this.heightOracle.mustRefreshForWrapping(n)||this.mustMeasureContent==="refresh",l=e.getBoundingClientRect(),h=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let a=0,f=0;if(l.width&&l.height){let{scaleX:T,scaleY:C}=Wr(e,l);(T>.005&&Math.abs(this.scaleX-T)>.005||C>.005&&Math.abs(this.scaleY-C)>.005)&&(this.scaleX=T,this.scaleY=C,a|=16,o=h=!0)}let u=(parseInt(i.paddingTop)||0)*this.scaleY,c=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=c)&&(this.paddingTop=u,this.paddingBottom=c,a|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(s.lineWrapping&&(h=!0),this.editorWidth=t.scrollDOM.clientWidth,a|=16);let d=Fr(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=Vr(this.scrollParent||t.win);let g=(this.printing?Xh:Gh)(e,this.paddingTop),m=g.top-this.pixelViewport.top,b=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(h=!0)),!this.inView&&!this.scrollTarget&&!Yh(t.dom))return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,a|=16),h){let T=t.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(T)&&(o=!0),o||s.lineWrapping&&Math.abs(v-this.contentDOMWidth)>s.charWidth){let{lineHeight:C,charWidth:S,textHeight:H}=t.docView.measureTextSize();o=C>0&&s.refresh(n,C,S,H,Math.max(5,v/S),T),o&&(t.docView.minWidth=0,a|=16)}m>0&&b>0?f=Math.max(m,b):m<0&&b<0&&(f=Math.min(m,b)),Yn();for(let C of this.viewports){let S=C.from==this.viewport.from?T:t.docView.measureVisibleLineHeights(C);this.heightMap=(o?st.empty().applyChanges(this.stateDeco,B.empty,this.heightOracle,[new ct(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new Kh(C.from,S))}be&&(a|=2)}let E=!this.viewportIsAppropriate(this.viewport,f)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return E&&(a&2&&(a|=this.updateScaler()),this.viewport=this.getViewport(f,this.scrollTarget),a|=this.updateForViewport()),(a&2||E)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),a|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),a}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),s=this.heightMap,n=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,h=new oi(s.lineAt(o-i*1e3,F.ByHeight,n,0,0).from,s.lineAt(l+(1-i)*1e3,F.ByHeight,n,0,0).to);if(e){let{head:a}=e.range;if(ah.to){let f=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),u=s.lineAt(a,F.ByPos,n,0,0),c;e.y=="center"?c=(u.top+u.bottom)/2-f/2:e.y=="start"||e.y=="nearest"&&a=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&n>1,o=s<<1;if(this.defaultTextDirection!=G.LTR&&!i)return[];let l=[],h=(f,u,c,d)=>{if(u-ff&&bb.from>=c.from&&b.to<=c.to&&Math.abs(b.from-f)b.fromy));if(!m){if(uv.from<=u&&v.to>=u)){let v=e.moveToLineBoundary(k.cursor(u),!1,!0).head;v>f&&(u=v)}let b=this.gapSize(c,f,u,d),y=i||b<2e6?b:2e6;m=new es(f,u,b,y)}l.push(m)},a=f=>{if(f.length2e6)for(let C of t)C.from>=f.from&&C.fromf.from&&h(f.from,d,f,u),pe.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let i=[];N.spans(e,this.viewport.from,this.viewport.to,{span(n,o){i.push({from:n,to:o})},point(){}},20);let s=0;if(i.length!=this.visibleRanges.length)s=12;else for(let n=0;n=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||Me(this.heightMap.lineAt(t,F.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||Me(this.heightMap.lineAt(this.scaler.fromDOM(t),F.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return Me(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class oi{constructor(t,e){this.from=t,this.to=e}}function Jh(r,t,e){let i=[],s=r,n=0;return N.spans(e,r,t,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),n+=o-s),s=l}},20),s=1)return t[t.length-1].to;let i=Math.floor(r*e);for(let s=0;;s++){let{from:n,to:o}=t[s],l=o-n;if(i<=l)return n+i;i-=l}}function hi(r,t){let e=0;for(let{from:i,to:s}of r.ranges){if(t<=s){e+=t-i;break}e+=s-i}return e/r.total}function Zh(r,t){for(let e of r)if(t(e))return e}const Jn={toDOM(r){return r},fromDOM(r){return r},scale:1,eq(r){return r==this}};function Zn(r){let t=r.facet(Hi).filter(i=>typeof i!="function"),e=r.facet(Zs).filter(i=>typeof i!="function");return e.length&&t.push(N.join(e)),t}class sn{constructor(t,e,i){let s=0,n=0,o=0;this.viewports=i.map(({from:l,to:h})=>{let a=e.lineAt(l,F.ByPos,t,0,0).top,f=e.lineAt(h,F.ByPos,t,0,0).bottom;return s+=f-a,{from:l,to:h,top:a,bottom:f,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(e.height-s);for(let l of this.viewports)l.domTop=o+(l.top-n)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),n=l.bottom}toDOM(t){for(let e=0,i=0,s=0;;e++){let n=ee.from==t.viewports[i].from&&e.to==t.viewports[i].to):!1}}function Me(r,t){if(t.scale==1)return r;let e=t.toDOM(r.top),i=t.toDOM(r.bottom);return new gt(r.from,r.length,e,i-e,Array.isArray(r._content)?r._content.map(s=>Me(s,t)):r._content)}const ai=M.define({combine:r=>r.join(" ")}),Ns=M.define({combine:r=>r.indexOf(!0)>-1}),Is=de.newName(),Co=de.newName(),Ao=de.newName(),Oo={"&light":"."+Co,"&dark":"."+Ao};function Ls(r,t,e){return new de(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return r;if(!e||!e[s])throw new RangeError(`Unsupported selector: ${s}`);return e[s]}):r+" "+i}})}const ta=Ls("."+Is,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},".cm-panels-top":{top:"0"},".cm-panels-bottom":{bottom:"0"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Oo),ea={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},is=w.ie&&w.ie_version<=11;class ia{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new Pl,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let i of e)this.queue.push(i);(w.ie&&w.ie_version<=11||w.ios&&t.composing)&&e.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&w.android&&t.constructor.EDIT_CONTEXT!==!1&&!(w.chrome&&w.chrome_version<126)&&(this.editContext=new na(t),t.state.facet(Bt)&&(t.contentDOM.editContext=this.editContext.editContext)),is&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var e;((e=this.view.docView)===null||e===void 0?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(Bt)?i.root.activeElement!=this.dom:!Ee(this.dom,s))return;let n=s.anchorNode&&i.docView.tile.nearest(s.anchorNode);if(n&&n.isWidget()&&n.widget.ignoreEvent(t)){e||(this.selectionChanged=!1);return}(w.ie&&w.ie_version<=11||w.android&&w.chrome)&&!i.state.selection.main.empty&&s.focusNode&&Ne(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=Ke(t.root);if(!e)return!1;let i=w.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&sa(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let s=Ee(this.dom,i);return s&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let n=this.delayedAndroidKey;n&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=n.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&n.force&&fe(this.dom,n.key,n.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,s=!1;for(let n of t){let o=this.readMutation(n);o&&(o.typeOver&&(s=!0),e==-1?{from:e,to:i}=o:(e=Math.min(o.from,e),i=Math.max(o.to,i)))}return{from:e,to:i,typeOver:s}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),s=this.selectionChanged&&Ee(this.dom,this.selectionRange);if(t<0&&!s)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let n=new yh(this.view,t,e,i);return this.view.docView.domChanged={newSel:n.newSel?n.newSel.main:null},n}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,s=co(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!Bi(this.view.state.selection,e.newSel.main))&&this.view.update([]),s}readMutation(t){let e=this.view.docView.tile.nearest(t.target);if(!e||e.isWidget())return null;if(e.markDirty(t.type=="attributes"),t.type=="childList"){let i=tr(e,t.previousSibling||t.target.previousSibling,-1),s=tr(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:s?e.posBefore(s):e.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(Bt)!=t.state.facet(Bt)&&(t.view.contentDOM.editContext=t.state.facet(Bt)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(e=this.gapIntersection)===null||e===void 0||e.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function tr(r,t,e){for(;t;){let i=q.get(t);if(i&&i.parent==r)return i;let s=t.parentNode;t=s!=r.dom?s:e>0?t.nextSibling:t.previousSibling}return null}function er(r,t){let e=t.startContainer,i=t.startOffset,s=t.endContainer,n=t.endOffset,o=r.docView.domAtPos(r.state.selection.main.anchor,1);return Ne(o.node,o.offset,s,n)&&([e,i,s,n]=[s,n,e,i]),{anchorNode:e,anchorOffset:i,focusNode:s,focusOffset:n}}function sa(r,t){if(t.getComposedRanges){let s=t.getComposedRanges(r.root)[0];if(s)return er(r,s)}let e=null;function i(s){s.preventDefault(),s.stopImmediatePropagation(),e=s.getTargetRanges()[0]}return r.contentDOM.addEventListener("beforeinput",i,!0),r.dom.ownerDocument.execCommand("indent"),r.contentDOM.removeEventListener("beforeinput",i,!0),e?er(r,e):null}class na{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let s=t.state.selection.main,{anchor:n,head:o}=s,l=this.toEditorPos(i.updateRangeStart),h=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let a=h-l>i.text.length;l==this.from&&nthis.to&&(h=n);let f=po(t.state.sliceDoc(l,h),i.text,(a?s.from:s.to)-l,a?"end":null);if(!f){let c=k.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Bi(c,s)||t.dispatch({selection:c,userEvent:"select"});return}let u={from:f.from+l,to:f.toA+l,insert:B.of(i.text.slice(f.from,f.toB).split(` +`))};if((w.mac||w.android)&&u.from==o-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(u={from:l,to:h,insert:B.of([i.text.replace("."," ")])}),this.pendingContextChange=u,!t.state.readOnly){let c=this.to-this.from+(u.to-u.from+u.insert.length);tn(t,u,k.single(this.toEditorPos(i.selectionStart,c),this.toEditorPos(i.selectionEnd,c)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),u.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(e.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(e.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let s=[],n=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let s=[];for(let n of i.getTextFormats()){let o=n.underlineStyle,l=n.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let h=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);if(h{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)e.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let s=Ke(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,s=this.pendingContextChange;return t.changes.iterChanges((n,o,l,h,a)=>{if(i)return;let f=a.length-(o-n);if(s&&o>=s.to)if(s.from==n&&s.to==o&&s.insert.eq(a)){s=this.pendingContextChange=null,e+=f,this.to+=f;return}else s=null,this.revertPending(t.state);if(n+=e,o+=e,o<=this.from)this.from+=f,this.to+=f;else if(nthis.to||this.to-this.from+a.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(n),this.toContextPos(o),a.toString()),this.to+=f}e+=f}),s&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),s=this.toContextPos(e.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to1e4*3)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class D{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(s=>s.forEach(n=>i(n,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=t.root||Dl(t.parent)||document,this.viewState=new _n(this,t.state||I.create(t)),t.scrollTo&&t.scrollTo.is(si)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(oe).map(s=>new Xi(s));for(let s of this.plugins)s.update(this);this.observer=new ia(this),this.inputState=new Ch(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Fn(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((e=document.fonts)===null||e===void 0)&&e.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let e=t.length==1&&t[0]instanceof tt?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,s,n=this.state;for(let c of t){if(c.startState!=n)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");n=c.state}if(this.destroyed){this.viewState.state=n;return}let o=this.hasFocus,l=0,h=null;t.some(c=>c.annotation(yo))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,h=ko(n,o),h||(l=1));let a=this.observer.delayedAndroidKey,f=null;if(a?(this.observer.clearDelayedAndroidKey(),f=this.observer.readChange(),(f&&!this.state.doc.eq(n.doc)||!this.state.selection.eq(n.selection))&&(f=null)):this.observer.clear(),n.facet(I.phrases)!=this.state.facet(I.phrases))return this.setState(n);s=Mi.create(this,n,t),s.flags|=l;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let c of t){if(u&&(u=u.map(c.changes)),c.scrollIntoView){let{main:d}=c.state.selection,{x:p,y:g}=this.state.facet(D.cursorScrollMargin);u=new ue(d.empty?d:k.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",g,p)}for(let d of c.effects)d.is(si)&&(u=d.value.clip(this.state))}this.viewState.update(s,u),this.bidiCache=Ei.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),e=this.docView.update(s),this.state.facet(Te)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(c=>c.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(ai)!=s.state.facet(ai)&&(this.viewState.mustMeasureContent=!0),(e||i||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),e&&this.docViewUpdate(),!s.empty)for(let c of this.state.facet(Ds))try{c(s)}catch(d){Tt(this.state,d,"update listener")}(h||f)&&Promise.resolve().then(()=>{h&&this.state==h.startState&&this.dispatch(h),f&&!co(this,f)&&a.force&&fe(this.contentDOM,a.key,a.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new _n(this,t),this.plugins=t.facet(oe).map(i=>new Xi(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Fn(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(oe),i=t.state.facet(oe);if(e!=i){let s=[];for(let n of i){let o=e.indexOf(n);if(o<0)s.push(new Xi(n));else{let l=this.plugins[o];l.mustUpdate=t,s.push(l)}}for(let n of this.plugins)n.mustUpdate!=t&&n.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=t;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.viewState.scrollParent,s=this.viewState.getScrollOffset(),{scrollAnchorPos:n,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Vr(i||this.win))n=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);n=d.from,o=d.top}this.updateState=1;let h=this.viewState.measure();if(!h&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];h&4||([this.measureRequests,a]=[a,this.measureRequests]);let f=a.map(d=>{try{return d.read(this)}catch(p){return Tt(this.state,p),ir}}),u=Mi.create(this,this.state,[]),c=!1;u.flags|=h,e?e.flags|=h:e=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),c=this.docView.update(u),c&&this.docViewUpdate());for(let d=0;d1||p<-1)&&!(w.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){s=s+p,i?i.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let l of this.state.facet(Ds))l(e)}get themeClasses(){return Is+" "+(this.state.facet(Ns)?Ao:Co)+" "+this.state.facet(ai)}updateAttrs(){let t=sr(this,so,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Bt)?"true":"false",class:"cm-content",style:`${w.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),sr(this,Js,e);let i=this.observer.ignore(()=>{let s=Rn(this.contentDOM,this.contentAttrs,e),n=Rn(this.dom,this.editorAttrs,t);return s||n});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let s of i.effects)if(s.is(D.announce)){e&&(this.announceDOM.textContent=""),e=!1;let n=this.announceDOM.appendChild(document.createElement("div"));n.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Te);let t=this.state.facet(D.cspNonce);de.mount(this.root,this.styleModules.concat(ta).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let e=0;ei.plugin==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return ts(this,t,Hn(this,t,e,i))}moveByGroup(t,e){return ts(this,t,Hn(this,t,e,i=>ph(this,t.head,i)))}visualLineSide(t,e){let i=this.bidiSpans(t),s=this.textDirectionAt(t.from),n=i[e?i.length-1:0];return k.cursor(n.side(e,s)+t.from,n.forward(!e,s)?1:-1)}moveToLineBoundary(t,e,i=!0){return dh(this,t,e,i)}moveVertically(t,e,i){return ts(this,t,gh(this,t,e,i))}domAtPos(t,e=1){return this.docView.domAtPos(t,e)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){this.readMeasured();let i=Rs(this,t,e);return i&&i.pos}posAndSideAtCoords(t,e=!0){return this.readMeasured(),Rs(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.state.doc.lineAt(t),s=this.bidiSpans(i),n=s[Ot.find(s,t-i.from,-1,e)];return this.docView.coordsAt(t,e,n.dir==G.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(to)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>ra)return Qr(t.length);let e=this.textDirectionAt(t.from),i;for(let n of this.bidiCache)if(n.from==t.from&&n.dir==e&&(n.fresh||jr(n.isolates,i=In(this,t))))return n.order;i||(i=In(this,t));let s=Fl(t.text,e,i);return this.bidiCache.push(new Ei(t.from,t.to,e,i,!0,s)),s}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||w.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Hr(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){var i,s,n,o;return si.of(new ue(typeof t=="number"?k.cursor(t):t,(i=e.y)!==null&&i!==void 0?i:"nearest",(s=e.x)!==null&&s!==void 0?s:"nearest",(n=e.yMargin)!==null&&n!==void 0?n:5,(o=e.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return si.of(new ue(k.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return pe.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return pe.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=de.newName(),s=[ai.of(i),Te.of(Ls(`.${i}`,t))];return e&&e.dark&&s.push(Ns.of(!0)),s}static baseTheme(t){return Cr.lowest(Te.of(Ls("."+Is,t,Oo)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),s=i&&q.get(i)||q.get(t);return((e=s?.root)===null||e===void 0?void 0:e.view)||null}}D.styleModule=Te;D.inputHandler=Jr;D.clipboardInputFilter=Xs;D.clipboardOutputFilter=_s;D.scrollHandler=eo;D.focusChangeEffect=Zr;D.perLineTextDirection=to;D.exceptionSink=_r;D.updateListener=Ds;D.editable=Bt;D.mouseSelectionStyle=Xr;D.dragMovesSelection=Yr;D.clickAddsSelectionRange=Gr;D.decorations=Hi;D.blockWrappers=no;D.outerDecorations=Zs;D.atomicRanges=Qe;D.bidiIsolatedRanges=ro;D.cursorScrollMargin=M.define({combine:r=>{let t=5,e=5;for(let i of r)typeof i=="number"?t=e=i:{x:t,y:e}=i;return{x:t,y:e}}});D.scrollMargins=oo;D.darkTheme=Ns;D.cspNonce=M.define({combine:r=>r.length?r[0]:""});D.contentAttributes=Js;D.editorAttributes=so;D.lineWrapping=D.contentAttributes.of({class:"cm-lineWrapping"});D.announce=U.define();const ra=4096,ir={};class Ei{constructor(t,e,i,s,n,o){this.from=t,this.to=e,this.dir=i,this.isolates=s,this.fresh=n,this.order=o}static update(t,e){if(e.empty&&!t.some(n=>n.fresh))return t;let i=[],s=t.length?t[t.length-1].dir:G.LTR;for(let n=Math.max(0,t.length-10);n=0;s--){let n=i[s],o=typeof n=="function"?n(r):n;o&&Us(o,e)}return e}const oa=w.mac?"mac":w.windows?"win":w.linux?"linux":"key";function la(r,t){const e=r.split(/-(?!$)/);let i=e[e.length-1];i=="Space"&&(i=" ");let s,n,o,l;for(let h=0;hi.concat(s),[]))),e}let Vt=null;const ua=4e3;function ca(r,t=oa){let e=Object.create(null),i=Object.create(null),s=(o,l)=>{let h=i[o];if(h==null)i[o]=l;else if(h!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},n=(o,l,h,a,f)=>{var u,c;let d=e[o]||(e[o]=Object.create(null)),p=l.split(/ (?!$)/).map(b=>la(b,t));for(let b=1;b{let E=Vt={view:v,prefix:y,scope:o};return setTimeout(()=>{Vt==E&&(Vt=null)},ua),!0}]})}let g=p.join(" ");s(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((c=(u=d._any)===null||u===void 0?void 0:u.run)===null||c===void 0?void 0:c.slice())||[]});h&&m.run.push(h),a&&(m.preventDefault=!0),f&&(m.stopPropagation=!0)};for(let o of r){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let a of l){let f=e[a]||(e[a]=Object.create(null));f._any||(f._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:u}=o;for(let c in f)f[c].run.push(d=>u(d,Ws))}let h=o[t]||o.key;if(h)for(let a of l)n(a,h,o.run,o.preventDefault,o.stopPropagation),o.shift&&n(a,"Shift-"+h,o.shift,o.preventDefault,o.stopPropagation)}return e}let Ws=null;function da(r,t,e,i){Ws=t;let s=vl(t),n=rl(s,0),o=ol(n)==s.length&&s!=" ",l="",h=!1,a=!1,f=!1;Vt&&Vt.view==e&&Vt.scope==i&&(l=Vt.prefix+" ",mo.indexOf(t.keyCode)<0&&(a=!0,Vt=null));let u=new Set,c=m=>{if(m){for(let b of m.run)if(!u.has(b)&&(u.add(b),b(e)))return m.stopPropagation&&(f=!0),!0;m.preventDefault&&(m.stopPropagation&&(f=!0),a=!0)}return!1},d=r[i],p,g;return d&&(c(d[l+fi(s,t,!o)])?h=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(w.windows&&t.ctrlKey&&t.altKey)&&!(w.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=qt[t.keyCode])&&p!=s?(c(d[l+fi(p,t,!0)])||t.shiftKey&&(g=Ve[t.keyCode])!=s&&g!=p&&c(d[l+fi(g,t,!1)]))&&(h=!0):o&&t.shiftKey&&c(d[l+fi(s,t,!0)])&&(h=!0),!h&&c(d._any)&&(h=!0)),a&&(h=!0),h&&f&&t.stopPropagation(),Ws=null,h}class xe extends Zt{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}xe.prototype.elementClass="";xe.prototype.toDOM=void 0;xe.prototype.mapMode=at.TrackBefore;xe.prototype.startSide=xe.prototype.endSide=-1;xe.prototype.point=!0;var ss;const Pe=new R;function pa(r){return M.define({combine:r?t=>t.concat(r):void 0})}const ga=new R;class Mt{constructor(t,e,i=[],s=""){this.data=t,this.name=s,I.prototype.hasOwnProperty("tree")||Object.defineProperty(I.prototype,"tree",{get(){return Fs(this)}}),this.parser=e,this.extension=[ye.of(this),I.languageData.of((n,o,l)=>{let h=rr(n,o,l),a=h.type.prop(Pe);if(!a)return[];let f=n.facet(a),u=h.type.prop(ga);if(u){let c=h.resolve(o-h.from,l);for(let d of u)if(d.test(c,n)){let p=n.facet(d.facet);return d.type=="replace"?p:p.concat(f)}}return f})].concat(i)}isActiveAt(t,e,i=-1){return rr(t,e,i).type.prop(Pe)==this.data}findRegions(t){let e=t.facet(ye);if(e?.data==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],s=(n,o)=>{if(n.prop(Pe)==this.data){i.push({from:o,to:o+n.length});return}let l=n.prop(R.mounted);if(l){if(l.tree.prop(Pe)==this.data){if(l.overlay)for(let h of l.overlay)i.push({from:h.from+o,to:h.to+o});else i.push({from:o,to:o+n.length});return}else if(l.overlay){let h=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>h)return}}for(let h=0;hi.isTop?e:void 0)]}),t.name)}configure(t,e){return new Ni(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Fs(r){let t=r.field(Mt.state,!1);return t?t.tree:Q.empty}class ma{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let Oe=null;class Ii{constructor(t,e,i=[],s,n,o,l,h){this.parser=t,this.state=e,this.fragments=i,this.tree=s,this.treeLen=n,this.viewport=o,this.skipped=l,this.scheduleOn=h,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new Ii(t,e,[],Q.empty,0,i,[],null)}startParse(){return this.parser.startParse(new ma(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=Q.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let s=Date.now()+t;t=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(Jt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=Oe;Oe=this;try{return t()}finally{Oe=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=or(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:s,treeLen:n,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let h=[];if(t.iterChangedRanges((a,f,u,c)=>h.push({fromA:a,toA:f,fromB:u,toB:c})),i=Jt.applyChanges(i,h),s=Q.empty,n=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let a of this.skipped){let f=t.mapPos(a.from,1),u=t.mapPos(a.to,-1);ft.from&&(this.fragments=or(this.fragments,s,n),this.skipped.splice(i--,1))}return this.skipped.length>=e?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends pr{createParse(e,i,s){let n=s[0].from,o=s[s.length-1].to;return{parsedPos:n,advance(){let h=Oe;if(h){for(let a of s)h.tempSkipped.push(a);t&&(h.scheduleOn=h.scheduleOn?Promise.all([h.scheduleOn,t]):t)}return this.parsedPos=o,new Q(ot.none,[],[],o-n)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return Oe}}function or(r,t,e){return Jt.applyChanges(r,[{fromA:t,toA:e,fromB:t,toB:e}])}class we{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new we(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Ii.create(t.facet(ye).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new we(i)}}Mt.state=se.define({create:we.init,update(r,t){for(let e of t.effects)if(e.is(Mt.setState))return e.value;return t.startState.facet(ye)!=t.state.facet(ye)?we.init(t.state):r.apply(t)}});let To=r=>{let t=setTimeout(()=>r(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(To=r=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(r,{timeout:400})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const ns=typeof navigator<"u"&&(!((ss=navigator.scheduling)===null||ss===void 0)&&ss.isInputPending)?()=>navigator.scheduling.isInputPending():null,ba=pe.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Mt.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Mt.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=To(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnds+1e3,h=n.context.work(()=>ns&&ns()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-e,(h||this.chunkBudget<=0)&&(n.context.takeTree(),this.view.dispatch({effects:Mt.setState.of(new we(n.context))})),this.chunkBudget>0&&!(h&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(n.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>Tt(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ye=M.define({combine(r){return r.length?r[0]:null},enables:r=>[Mt.state,ba,D.contentAttributes.compute([r],t=>{let e=t.facet(r);return e&&e.name?{"data-language":e.name}:{}})]});class xa{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const wa=new R;function lr({except:r,units:t=1}={}){return e=>{let i=r&&r.test(e.textAfter);return e.baseIndent+(i?0:t*e.unit)}}const ya=new R;function ka(r){let t=r.firstChild,e=r.lastChild;return t&&t.to-1||(ar.push(r),console.warn(t))}function Ca(r,t){let e=[];for(let l of t.split(" ")){let h=[];for(let a of l.split(".")){let f=r[a]||A[a];f?typeof f=="function"?h.length?h=h.map(f):rs(a,`Modifier ${a} used at start of tag`):h.length?rs(a,`Tag ${a} used as modifier`):h=Array.isArray(f)?f:[f]:rs(a,`Unknown highlighting tag ${a}`)}for(let a of h)e.push(a)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),s=i+" "+e.map(l=>l.id),n=fr[s];if(n)return n.id;let o=fr[s]=ot.define({id:hr.length,name:i,props:[gr({[i]:e})]});return hr.push(o),o.id}G.RTL,G.LTR;const Aa=Ni.define({name:"json",parser:_o.configure({props:[wa.add({Object:lr({except:/^\s*\}/}),Array:lr({except:/^\s*\]/})}),ya.add({"Object Array":ka})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Pa(){return new xa(Aa)}export{D as E,I as a,Pa as j,aa as k}; diff --git a/src/runtime/operator/web_assets/assets/graph-CoDTrhFP.js b/src/runtime/operator/web_assets/assets/graph-CoDTrhFP.js new file mode 100644 index 0000000..d189a1b --- /dev/null +++ b/src/runtime/operator/web_assets/assets/graph-CoDTrhFP.js @@ -0,0 +1,7 @@ +function Hr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yn={exports:{}},st={};var _o;function Ma(){if(_o)return st;_o=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,r,i){var s=null;if(i!==void 0&&(s=""+i),r.key!==void 0&&(s=""+r.key),"key"in r){i={};for(var a in r)a!=="key"&&(i[a]=r[a])}else i=r;return r=i.ref,{$$typeof:e,type:o,key:s,ref:r!==void 0?r:null,props:i}}return st.Fragment=t,st.jsx=n,st.jsxs=n,st}var Eo;function Aa(){return Eo||(Eo=1,yn.exports=Ma()),yn.exports}var R=Aa(),xn={exports:{}},K={};var bo;function Ia(){if(bo)return K;bo=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),d=Symbol.iterator;function h(m){return m===null||typeof m!="object"?null:(m=d&&m[d]||m["@@iterator"],typeof m=="function"?m:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function y(m,E,B){this.props=m,this.context=E,this.refs=w,this.updater=B||g}y.prototype.isReactComponent={},y.prototype.setState=function(m,E){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,E,"setState")},y.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function C(){}C.prototype=y.prototype;function p(m,E,B){this.props=m,this.context=E,this.refs=w,this.updater=B||g}var v=p.prototype=new C;v.constructor=p,_(v,y.prototype),v.isPureReactComponent=!0;var A=Array.isArray;function S(){}var b={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function k(m,E,B){var L=B.ref;return{$$typeof:e,type:m,key:E,ref:L!==void 0?L:null,props:B}}function F(m,E){return k(m.type,E,m.props)}function z(m){return typeof m=="object"&&m!==null&&m.$$typeof===e}function V(m){var E={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(B){return E[B]})}var O=/\/+/g;function x(m,E){return typeof m=="object"&&m!==null&&m.key!=null?V(""+m.key):E.toString(36)}function M(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(S,S):(m.status="pending",m.then(function(E){m.status==="pending"&&(m.status="fulfilled",m.value=E)},function(E){m.status==="pending"&&(m.status="rejected",m.reason=E)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function N(m,E,B,L,Y){var W=typeof m;(W==="undefined"||W==="boolean")&&(m=null);var Z=!1;if(m===null)Z=!0;else switch(W){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(m.$$typeof){case e:case t:Z=!0;break;case l:return Z=m._init,N(Z(m._payload),E,B,L,Y)}}if(Z)return Y=Y(m),Z=L===""?"."+x(m,0):L,A(Y)?(B="",Z!=null&&(B=Z.replace(O,"$&/")+"/"),N(Y,E,B,"",function(J){return J})):Y!=null&&(z(Y)&&(Y=F(Y,B+(Y.key==null||m&&m.key===Y.key?"":(""+Y.key).replace(O,"$&/")+"/")+Z)),E.push(Y)),1;Z=0;var H=L===""?".":L+":";if(A(m))for(var X=0;X"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),wn.exports=ka(),wn.exports}function se(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n{}};function tn(){for(var e=0,t=arguments.length,n={},o;e=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}zt.prototype=tn.prototype={constructor:zt,on:function(e,t){var n=this._,o=$a(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i0)for(var n=new Array(r),o=0,r,i;o=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ao.hasOwnProperty(t)?{space:Ao[t],local:e}:e}function Ha(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Pn&&t.documentElement.namespaceURI===Pn?t.createElement(e):t.createElementNS(n,e)}}function za(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zr(e){var t=nn(e);return(t.local?za:Ha)(t)}function Oa(){}function Wn(e){return e==null?Oa:function(){return this.querySelector(e)}}function La(e){typeof e!="function"&&(e=Wn(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r=p&&(p=C+1);!(A=w[p])&&++p=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function lc(e){e||(e=fc);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,o=n.length,r=new Array(o),i=0;it?1:e>=t?0:NaN}function dc(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function hc(){return Array.from(this)}function gc(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Cc:typeof t=="function"?Mc:Nc)(e,t,n??"")):Je(this.node(),e)}function Je(e,t){return e.style.getPropertyValue(t)||jr(e).getComputedStyle(e,null).getPropertyValue(t)}function Ic(e){return function(){delete this[e]}}function Tc(e,t){return function(){this[e]=t}}function kc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Rc(e,t){return arguments.length>1?this.each((t==null?Ic:typeof t=="function"?kc:Tc)(e,t)):this.node()[e]}function Fr(e){return e.trim().split(/^|\s+/)}function qn(e){return e.classList||new Yr(e)}function Yr(e){this._node=e,this._names=Fr(e.getAttribute("class")||"")}Yr.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Xr(e,t){for(var n=qn(e),o=-1,r=t.length;++o=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function su(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n()=>e;function $n(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:u,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}$n.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function mu(e){return!e.ctrlKey&&!e.button}function yu(){return this.parentNode}function xu(e,t){return t??{x:e.x,y:e.y}}function wu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Kr(){var e=mu,t=yu,n=xu,o=wu,r={},i=tn("start","drag","end"),s=0,a,u,c,l,f=0;function d(v){v.on("mousedown.drag",h).filter(o).on("touchstart.drag",w).on("touchmove.drag",y,pu).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,A){if(!(l||!e.call(this,v,A))){var S=p(this,t.call(this,v,A),v,A,"mouse");S&&(le(v.view).on("mousemove.drag",g,ht).on("mouseup.drag",_,ht),Gr(v.view),vn(v),c=!1,a=v.clientX,u=v.clientY,S("start",v))}}function g(v){if(Ke(v),!c){var A=v.clientX-a,S=v.clientY-u;c=A*A+S*S>f}r.mouse("drag",v)}function _(v){le(v.view).on("mousemove.drag mouseup.drag",null),Ur(v.view,c),Ke(v),r.mouse("end",v)}function w(v,A){if(e.call(this,v,A)){var S=v.changedTouches,b=t.call(this,v,A),T=S.length,k,F;for(k=0;k>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?It(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?It(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_u.exec(e))?new ue(t[1],t[2],t[3],1):(t=Eu.exec(e))?new ue(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bu.exec(e))?It(t[1],t[2],t[3],t[4]):(t=Su.exec(e))?It(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Cu.exec(e))?Do(t[1],t[2]/100,t[3]/100,1):(t=Nu.exec(e))?Do(t[1],t[2]/100,t[3]/100,t[4]):Io.hasOwnProperty(e)?Ro(Io[e]):e==="transparent"?new ue(NaN,NaN,NaN,0):null}function Ro(e){return new ue(e>>16&255,e>>8&255,e&255,1)}function It(e,t,n,o){return o<=0&&(e=t=n=NaN),new ue(e,t,n,o)}function Iu(e){return e instanceof bt||(e=Fe(e)),e?(e=e.rgb(),new ue(e.r,e.g,e.b,e.opacity)):new ue}function Dn(e,t,n,o){return arguments.length===1?Iu(e):new ue(e,t,n,o??1)}function ue(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Gn(ue,Dn,Qr(bt,{brighter(e){return e=e==null?Ft:Math.pow(Ft,e),new ue(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gt:Math.pow(gt,e),new ue(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ue(Ve(this.r),Ve(this.g),Ve(this.b),Yt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Po,formatHex:Po,formatHex8:Tu,formatRgb:$o,toString:$o}));function Po(){return`#${Be(this.r)}${Be(this.g)}${Be(this.b)}`}function Tu(){return`#${Be(this.r)}${Be(this.g)}${Be(this.b)}${Be((isNaN(this.opacity)?1:this.opacity)*255)}`}function $o(){const e=Yt(this.opacity);return`${e===1?"rgb(":"rgba("}${Ve(this.r)}, ${Ve(this.g)}, ${Ve(this.b)}${e===1?")":`, ${e})`}`}function Yt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ve(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Be(e){return e=Ve(e),(e<16?"0":"")+e.toString(16)}function Do(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ge(e,t,n,o)}function Jr(e){if(e instanceof ge)return new ge(e.h,e.s,e.l,e.opacity);if(e instanceof bt||(e=Fe(e)),!e)return new ge;if(e instanceof ge)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,u=(i+r)/2;return a?(t===i?s=(n-o)/a+(n0&&u<1?0:s,new ge(s,a,u,e.opacity)}function ku(e,t,n,o){return arguments.length===1?Jr(e):new ge(e,t,n,o??1)}function ge(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Gn(ge,ku,Qr(bt,{brighter(e){return e=e==null?Ft:Math.pow(Ft,e),new ge(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gt:Math.pow(gt,e),new ge(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new ue(_n(e>=240?e-240:e+120,r,o),_n(e,r,o),_n(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new ge(Ho(this.h),Tt(this.s),Tt(this.l),Yt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Yt(this.opacity);return`${e===1?"hsl(":"hsla("}${Ho(this.h)}, ${Tt(this.s)*100}%, ${Tt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ho(e){return e=(e||0)%360,e<0?e+360:e}function Tt(e){return Math.max(0,Math.min(1,e||0))}function _n(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Un=e=>()=>e;function Ru(e,t){return function(n){return e+n*t}}function Pu(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function $u(e){return(e=+e)==1?ei:function(t,n){return n-t?Pu(t,n,e):Un(isNaN(t)?n:t)}}function ei(e,t){var n=t-e;return n?Ru(e,n):Un(isNaN(e)?t:e)}const Xt=(function e(t){var n=$u(t);function o(r,i){var s=n((r=Dn(r)).r,(i=Dn(i)).r),a=n(r.g,i.g),u=n(r.b,i.b),c=ei(r.opacity,i.opacity);return function(l){return r.r=s(l),r.g=a(l),r.b=u(l),r.opacity=c(l),r+""}}return o.gamma=e,o})(1);function Du(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;rn&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,u.push({i:s,x:_e(o,r)})),n=En.lastIndex;return n180?l+=360:l-c>180&&(c+=360),d.push({i:f.push(r(f)+"rotate(",null,o)-2,x:_e(c,l)})):l&&f.push(r(f)+"rotate("+l+o)}function a(c,l,f,d){c!==l?d.push({i:f.push(r(f)+"skewX(",null,o)-2,x:_e(c,l)}):l&&f.push(r(f)+"skewX("+l+o)}function u(c,l,f,d,h,g){if(c!==f||l!==d){var _=h.push(r(h)+"scale(",null,",",null,")");g.push({i:_-4,x:_e(c,f)},{i:_-2,x:_e(l,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(c,l){var f=[],d=[];return c=e(c),l=e(l),i(c.translateX,c.translateY,l.translateX,l.translateY,f,d),s(c.rotate,l.rotate,f,d),a(c.skewX,l.skewX,f,d),u(c.scaleX,c.scaleY,l.scaleX,l.scaleY,f,d),c=l=null,function(h){for(var g=-1,_=d.length,w;++g<_;)f[(w=d[g]).i]=w.x(h);return f.join("")}}}var Yu=oi(ju,"px, ","px)","deg)"),Xu=oi(Fu,", ",")",")"),Zu=1e-12;function Oo(e){return((e=Math.exp(e))+1/e)/2}function Wu(e){return((e=Math.exp(e))-1/e)/2}function qu(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ot=(function e(t,n,o){function r(i,s){var a=i[0],u=i[1],c=i[2],l=s[0],f=s[1],d=s[2],h=l-a,g=f-u,_=h*h+g*g,w,y;if(_=0&&e._call.call(void 0,t),e=e._next;--et}function Lo(){Ye=(Wt=mt.now())+on,et=ut=0;try{Uu()}finally{et=0,Qu(),Ye=0}}function Ku(){var e=mt.now(),t=e-Wt;t>ri&&(on-=t,Wt=e)}function Qu(){for(var e,t=Zt,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Zt=n);lt=e,On(o)}function On(e){if(!et){ut&&(ut=clearTimeout(ut));var t=e-Ye;t>24?(e<1/0&&(ut=setTimeout(Lo,e-mt.now()-on)),at&&(at=clearInterval(at))):(at||(Wt=mt.now(),at=setInterval(Ku,ri)),et=1,ii(Lo))}}function Bo(e,t,n){var o=new qt;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Ju=tn("start","end","cancel","interrupt"),el=[],ai=0,Vo=1,Ln=2,Lt=3,jo=4,Bn=5,Bt=6;function rn(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;tl(e,n,{name:t,index:o,group:r,on:Ju,tween:el,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ai})}function Qn(e,t){var n=xe(e,t);if(n.state>ai)throw new Error("too late; already scheduled");return n}function be(e,t){var n=xe(e,t);if(n.state>Lt)throw new Error("too late; already running");return n}function xe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function tl(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=si(i,0,n.time);function i(c){n.state=Vo,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var l,f,d,h;if(n.state!==Vo)return u();for(l in o)if(h=o[l],h.name===n.name){if(h.state===Lt)return Bo(s);h.state===jo?(h.state=Bt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[l]):+lLn&&o.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function kl(e,t,n){var o,r,i=Tl(t)?Qn:be;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function Rl(e,t){var n=this._id;return arguments.length<2?xe(this.node(),n).on.on(e):this.each(kl(n,e,t))}function Pl(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $l(){return this.on("end.remove",Pl(this._id))}function Dl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wn(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s()=>e;function af(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Te(e,t,n){this.k=e,this.x=t,this.y=n}Te.prototype={constructor:Te,scale:function(e){return e===1?this:new Te(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Te(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var sn=new Te(1,0,0);fi.prototype=Te.prototype;function fi(e){for(;!e.__zoom;)if(!(e=e.parentNode))return sn;return e.__zoom}function bn(e){e.stopImmediatePropagation()}function ct(e){e.preventDefault(),e.stopImmediatePropagation()}function cf(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function uf(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Fo(){return this.__zoom||sn}function lf(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ff(){return navigator.maxTouchPoints||"ontouchstart"in this}function df(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function di(){var e=cf,t=uf,n=df,o=lf,r=ff,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,u=Ot,c=tn("start","zoom","end"),l,f,d,h=500,g=150,_=0,w=10;function y(x){x.property("__zoom",Fo).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",F).filter(r).on("touchstart.zoom",z).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(x,M,N,I){var $=x.selection?x.selection():x;$.property("__zoom",Fo),x!==$?A(x,M,N,I):$.interrupt().each(function(){S(this,arguments).event(I).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},y.scaleBy=function(x,M,N,I){y.scaleTo(x,function(){var $=this.__zoom.k,P=typeof M=="function"?M.apply(this,arguments):M;return $*P},N,I)},y.scaleTo=function(x,M,N,I){y.transform(x,function(){var $=t.apply(this,arguments),P=this.__zoom,j=N==null?v($):typeof N=="function"?N.apply(this,arguments):N,m=P.invert(j),E=typeof M=="function"?M.apply(this,arguments):M;return n(p(C(P,E),j,m),$,s)},N,I)},y.translateBy=function(x,M,N,I){y.transform(x,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof N=="function"?N.apply(this,arguments):N),t.apply(this,arguments),s)},null,I)},y.translateTo=function(x,M,N,I,$){y.transform(x,function(){var P=t.apply(this,arguments),j=this.__zoom,m=I==null?v(P):typeof I=="function"?I.apply(this,arguments):I;return n(sn.translate(m[0],m[1]).scale(j.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof N=="function"?-N.apply(this,arguments):-N),P,s)},I,$)};function C(x,M){return M=Math.max(i[0],Math.min(i[1],M)),M===x.k?x:new Te(M,x.x,x.y)}function p(x,M,N){var I=M[0]-N[0]*x.k,$=M[1]-N[1]*x.k;return I===x.x&&$===x.y?x:new Te(x.k,I,$)}function v(x){return[(+x[0][0]+ +x[1][0])/2,(+x[0][1]+ +x[1][1])/2]}function A(x,M,N,I){x.on("start.zoom",function(){S(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(I).end()}).tween("zoom",function(){var $=this,P=arguments,j=S($,P).event(I),m=t.apply($,P),E=N==null?v(m):typeof N=="function"?N.apply($,P):N,B=Math.max(m[1][0]-m[0][0],m[1][1]-m[0][1]),L=$.__zoom,Y=typeof M=="function"?M.apply($,P):M,W=u(L.invert(E).concat(B/L.k),Y.invert(E).concat(B/Y.k));return function(Z){if(Z===1)Z=Y;else{var H=W(Z),X=B/H[2];Z=new Te(X,E[0]-H[0]*X,E[1]-H[1]*X)}j.zoom(null,Z)}})}function S(x,M,N){return!N&&x.__zooming||new b(x,M)}function b(x,M){this.that=x,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(x,M),this.taps=0}b.prototype={event:function(x){return x&&(this.sourceEvent=x),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(x,M){return this.mouse&&x!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&x!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&x!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(x){var M=le(this.that).datum();c.call(x,this.that,new af(x,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:c}),M)}};function T(x,...M){if(!e.apply(this,arguments))return;var N=S(this,M).event(x),I=this.__zoom,$=Math.max(i[0],Math.min(i[1],I.k*Math.pow(2,o.apply(this,arguments)))),P=he(x);if(N.wheel)(N.mouse[0][0]!==P[0]||N.mouse[0][1]!==P[1])&&(N.mouse[1]=I.invert(N.mouse[0]=P)),clearTimeout(N.wheel);else{if(I.k===$)return;N.mouse=[P,I.invert(P)],Vt(this),N.start()}ct(x),N.wheel=setTimeout(j,g),N.zoom("mouse",n(p(C(I,$),N.mouse[0],N.mouse[1]),N.extent,s));function j(){N.wheel=null,N.end()}}function k(x,...M){if(d||!e.apply(this,arguments))return;var N=x.currentTarget,I=S(this,M,!0).event(x),$=le(x.view).on("mousemove.zoom",E,!0).on("mouseup.zoom",B,!0),P=he(x,N),j=x.clientX,m=x.clientY;Gr(x.view),bn(x),I.mouse=[P,this.__zoom.invert(P)],Vt(this),I.start();function E(L){if(ct(L),!I.moved){var Y=L.clientX-j,W=L.clientY-m;I.moved=Y*Y+W*W>_}I.event(L).zoom("mouse",n(p(I.that.__zoom,I.mouse[0]=he(L,N),I.mouse[1]),I.extent,s))}function B(L){$.on("mousemove.zoom mouseup.zoom",null),Ur(L.view,I.moved),ct(L),I.event(L).end()}}function F(x,...M){if(e.apply(this,arguments)){var N=this.__zoom,I=he(x.changedTouches?x.changedTouches[0]:x,this),$=N.invert(I),P=N.k*(x.shiftKey?.5:2),j=n(p(C(N,P),I,$),t.apply(this,M),s);ct(x),a>0?le(this).transition().duration(a).call(A,j,I,x):le(this).call(y.transform,j,I,x)}}function z(x,...M){if(e.apply(this,arguments)){var N=x.touches,I=N.length,$=S(this,M,x.changedTouches.length===I).event(x),P,j,m,E;for(bn(x),j=0;j`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},yt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],hi=["Enter"," ","Escape"],gi={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var tt;(function(e){e.Strict="strict",e.Loose="loose"})(tt||(tt={}));var je;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(je||(je={}));var xt;(function(e){e.Partial="partial",e.Full="full"})(xt||(xt={}));const pi={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var $e;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})($e||($e={}));var Gt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Gt||(Gt={}));var G;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(G||(G={}));const Yo={[G.Left]:G.Right,[G.Right]:G.Left,[G.Top]:G.Bottom,[G.Bottom]:G.Top};function mi(e){return e===null?null:e?"valid":"invalid"}const yi=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,hf=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),eo=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),St=(e,t=[0,0])=>{const{width:n,height:o}=Se(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},gf=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,r)=>{const i=typeof r=="string";let s=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(r):eo(r)?r:t.nodeLookup.get(r.id));const a=s?Ut(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return an(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return cn(n)},Ct=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=an(n,Ut(r)),o=!0)}),o?cn(n):{x:0,y:0,width:0,height:0}},to=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a=(t.x-n)/r,u=(t.y-o)/r,c=t.width/r,l=t.height/r,f=[];for(const d of e.values()){const{measured:h,selectable:g=!0,hidden:_=!1}=d;if(s&&!g||_)continue;const w=h.width??d.width??d.initialWidth??0,y=h.height??d.height??d.initialHeight??0,{x:C,y:p}=d.internals.positionAbsolute,v=_i(a,u,c,l,C,p,w,y),A=w*y,S=i&&v>0;(!d.internals.handleBounds||S||v>=A||d.dragging)&&f.push(d)}return f},pf=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function mf(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{let i;if(t?.includeHiddenNodes){const{width:s,height:a}=Se(r);i=s>0&&a>0}else i=!!(r.measured.width&&r.measured.height&&!r.hidden);i&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function yf({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return!0;const a=mf(e,s),u=Ct(a),c=oo(u,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(c,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0}function xi({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:u,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},l=s.origin??o;let f=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",ye.error005());else{const h=a.measured.width,g=a.measured.height;h&&g&&(f=[[u,c],[u+h,c+g]])}else a&&Ze(s.extent)&&(f=[[s.extent[0][0]+u,s.extent[0][1]+c],[s.extent[1][0]+u,s.extent[1][1]+c]]);const d=Ze(f)?Xe(t,f,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",ye.error015()),{position:{x:d.x-u+(s.measured.width??0)*l[0],y:d.y-c+(s.measured.height??0)*l[1]},positionAbsolute:d}}async function xf({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(d=>d.id)),s=[];for(const d of n){if(d.deletable===!1)continue;const h=i.has(d.id),g=!h&&d.parentId&&s.find(_=>_.id===d.parentId);(h||g)&&s.push(d)}const a=new Set(t.map(d=>d.id)),u=o.filter(d=>d.deletable!==!1),l=pf(s,u);for(const d of u)a.has(d.id)&&!l.find(g=>g.id===d.id)&&l.push(d);if(!r)return{edges:l,nodes:s};const f=await r({nodes:s,edges:l});return typeof f=="boolean"?f?{edges:l,nodes:s}:{edges:[],nodes:[]}:f}const nt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Xe=(e={x:0,y:0},t,n)=>({x:nt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:nt(e.y,t[0][1],t[1][1]-(n?.height??0))});function wi(e,t,n){const{width:o,height:r}=Se(n),{x:i,y:s}=n.internals.positionAbsolute;return Xe(e,[[i,s],[i+o,s+r]],t)}const Xo=(e,t,n)=>en?-nt(Math.abs(e-n),1,t)/t:0,no=(e,t,n=15,o=40)=>{const r=Xo(e.x,o,t.width-o)*n,i=Xo(e.y,o,t.height-o)*n;return[r,i]},an=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Vn=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),cn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),wt=(e,t=[0,0])=>{const{x:n,y:o}=eo(e)?e.internals.positionAbsolute:St(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Ut=(e,t=[0,0])=>{const{x:n,y:o}=eo(e)?e.internals.positionAbsolute:St(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},vi=(e,t)=>cn(an(Vn(e),Vn(t))),_i=(e,t,n,o,r,i,s,a)=>{const u=Math.max(0,Math.min(e+n,r+s)-Math.max(e,r)),c=Math.max(0,Math.min(t+o,i+a)-Math.max(t,i));return Math.ceil(u*c)},Kt=(e,t)=>_i(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Zo=e=>pe(e.width)&&pe(e.height)&&pe(e.x)&&pe(e.y),pe=e=>!isNaN(e)&&isFinite(e),Ei=(e,t)=>(n,o)=>{},Nt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Mt=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?Nt(a,s):a},ot=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function qe(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function wf(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=qe(e,n),r=qe(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=qe(e.top??e.y??0,n),r=qe(e.bottom??e.y??0,n),i=qe(e.left??e.x??0,t),s=qe(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function vf(e,t,n,o,r,i){const{x:s,y:a}=ot(e,[t,n,o]),{x:u,y:c}=ot({x:e.x+e.width,y:e.y+e.height},[t,n,o]),l=r-u,f=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(l),bottom:Math.floor(f)}}const oo=(e,t,n,o,r,i)=>{const s=wf(i,t,n),a=(t-s.x)/e.width,u=(n-s.y)/e.height,c=Math.min(a,u),l=nt(c,o,r),f=e.x+e.width/2,d=e.y+e.height/2,h=t/2-f*l,g=n/2-d*l,_=vf(e,h,g,l,t,n),w={left:Math.min(_.left-s.left,0),top:Math.min(_.top-s.top,0),right:Math.min(_.right-s.right,0),bottom:Math.min(_.bottom-s.bottom,0)};return{x:h-w.left+w.right,y:g-w.top+w.bottom,zoom:l}},vt=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Ze(e){return e!=null&&e!=="parent"}function Se(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function bi(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Si(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Wo(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function _f(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function Ef(e){return{...gi,...e||{}}}function dt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=me(e),a=Mt({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:u,y:c}=n?Nt(a,t):a;return{xSnapped:u,ySnapped:c,...a}}const ro=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ci=e=>e?.getRootNode?.()||window?.document,bf=["INPUT","SELECT","TEXTAREA"];function Ni(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:bf.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Mi=e=>"clientX"in e,me=(e,t)=>{const n=Mi(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},qo=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...ro(s)}})};function Ai({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const u=e*.125+r*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+o*.125,l=Math.abs(u-e),f=Math.abs(c-t);return[u,c,l,f]}function Pt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Go({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case G.Left:return[t-Pt(t-o,i),n];case G.Right:return[t+Pt(o-t,i),n];case G.Top:return[t,n-Pt(n-r,i)];case G.Bottom:return[t,n+Pt(r-n,i)]}}function Ii({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:o,targetY:r,targetPosition:i=G.Top,curvature:s=.25}){const[a,u]=Go({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[c,l]=Go({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[f,d,h,g]=Ai({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:l});return[`M${e},${t} C${a},${u} ${c},${l} ${o},${r}`,f,d,h,g]}function Ti({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n0}const Nf=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,Mf=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Af=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",ye.error006()),t;const o=n.getEdgeId||Nf;let r;return yi(e)?r={...e}:r={...e,id:o(e)},Mf(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function ki({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=Ti({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const Uo={[G.Left]:{x:-1,y:0},[G.Right]:{x:1,y:0},[G.Top]:{x:0,y:-1},[G.Bottom]:{x:0,y:1}},If=({source:e,sourcePosition:t=G.Bottom,target:n})=>t===G.Left||t===G.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Tf({source:e,sourcePosition:t=G.Bottom,target:n,targetPosition:o=G.Top,center:r,offset:i,stepPosition:s}){const a=Uo[t],u=Uo[o],c={x:e.x+a.x*i,y:e.y+a.y*i},l={x:n.x+u.x*i,y:n.y+u.y*i},f=If({source:c,sourcePosition:t,target:l}),d=f.x!==0?"x":"y",h=f[d];let g=[],_,w;const y={x:0,y:0},C={x:0,y:0},[,,p,v]=Ti({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*u[d]===-1){d==="x"?(_=r.x??c.x+(l.x-c.x)*s,w=r.y??(c.y+l.y)/2):(_=r.x??(c.x+l.x)/2,w=r.y??c.y+(l.y-c.y)*s);const T=[{x:_,y:c.y},{x:_,y:l.y}],k=[{x:c.x,y:w},{x:l.x,y:w}];a[d]===h?g=d==="x"?T:k:g=d==="x"?k:T}else{const T=[{x:c.x,y:l.y}],k=[{x:l.x,y:c.y}];if(d==="x"?g=a.x===h?k:T:g=a.y===h?T:k,t===o){const x=Math.abs(e[d]-n[d]);if(x<=i){const M=Math.min(i-1,i-x);a[d]===h?y[d]=(c[d]>e[d]?-1:1)*M:C[d]=(l[d]>n[d]?-1:1)*M}}if(t!==o){const x=d==="x"?"y":"x",M=a[d]===u[x],N=c[x]>l[x],I=c[x]=O?(_=(F.x+z.x)/2,w=g[0].y):(_=g[0].x,w=(F.y+z.y)/2)}const A={x:c.x+y.x,y:c.y+y.y},S={x:l.x+C.x,y:l.y+C.y};return[[e,...A.x!==g[0].x||A.y!==g[0].y?[A]:[],...g,...S.x!==g[g.length-1].x||S.y!==g[g.length-1].y?[S]:[],n],_,w,p,v]}function kf(e,t,n,o){const r=Math.min(Ko(e,t)/2,Ko(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.xn.id===t):e[0])||null}function Fn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function Pf(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(u=>{if(u&&typeof u=="object"){const c=Fn(u,t);i.has(c)||(s.push({id:c,color:u.color||n,...u}),i.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Ri=1e3,$f=10,io={nodeOrigin:[0,0],nodeExtent:yt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Df={...io,checkEquality:!0};function so(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function Hf(e,t,n){const o=so(io,n);for(const r of e.values())if(r.parentId)co(r,e,t,o);else{const i=St(r,o.nodeOrigin),s=Ze(r.extent)?r.extent:o.nodeExtent,a=Xe(i,s,Se(r));r.internals.positionAbsolute=a}}function zf(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function ao(e){return e==="manual"}function Yn(e,t,n,o={}){const r=so(Df,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!ao(r.zIndexMode)?Ri:0;let u=e.length>0,c=!1;t.clear(),n.clear();for(const l of e){let f=s.get(l.id);if(r.checkEquality&&l===f?.internals.userNode)t.set(l.id,f);else{const d=St(l,r.nodeOrigin),h=Ze(l.extent)?l.extent:r.nodeExtent,g=Xe(d,h,Se(l));f={...r.defaults,...l,measured:{width:l.measured?.width,height:l.measured?.height},internals:{positionAbsolute:g,handleBounds:zf(l,f),z:Pi(l,a,r.zIndexMode),userNode:l}},t.set(l.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(u=!1),l.parentId&&co(f,t,n,o,i),c||=l.selected??!1}return{nodesInitialized:u,hasSelectedNodes:c}}function Of(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function co(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:u}=so(io,o),c=e.parentId,l=t.get(c);if(!l){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Of(e,n),r&&!l.parentId&&l.internals.rootParentIndex===void 0&&u==="auto"&&(l.internals.rootParentIndex=++r.i,l.internals.z=l.internals.z+r.i*$f),r&&l.internals.rootParentIndex!==void 0&&(r.i=l.internals.rootParentIndex);const f=i&&!ao(u)?Ri:0,{x:d,y:h,z:g}=Lf(e,l,s,a,f,u),{positionAbsolute:_}=e.internals,w=d!==_.x||h!==_.y;(w||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:d,y:h}:_,z:g}})}function Pi(e,t,n){const o=pe(e.zIndex)?e.zIndex:0;return ao(n)?o:o+(e.selected?t:0)}function Lf(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,u=Se(e),c=St(e,n),l=Ze(e.extent)?Xe(c,e.extent,u):c;let f=Xe({x:s+l.x,y:a+l.y},o,u);e.extent==="parent"&&(f=wi(f,u,t));const d=Pi(e,r,i),h=t.internals.z??0;return{x:f.x,y:f.y,z:h>=d?h+1:d}}function uo(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const u=i.get(s.parentId)?.expandedRect??wt(a),c=vi(u,s.rect);i.set(s.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},u)=>{const c=a.internals.positionAbsolute,l=Se(a),f=a.origin??o,d=s.x0||h>0||w||y)&&(r.push({id:u,type:"position",position:{x:a.position.x-d+w,y:a.position.y-h+y}}),n.get(u)?.forEach(C=>{e.some(p=>p.id===C.id)||r.push({id:C.id,type:"position",position:{x:C.position.x+d,y:C.position.y+h}})})),(l.width0){const h=uo(d,t,n,r);c.push(...h)}return{changes:c,updatedInternals:u}}async function Vf({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function tr(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const u=o.get(s)||new Map;if(o.set(s,u.set(n,t)),i){s=`${r}-${e}-${i}`;const c=o.get(s)||new Map;o.set(s,c.set(n,t))}}function $i(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,u={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},c=`${r}-${s}--${i}-${a}`,l=`${i}-${a}--${r}-${s}`;tr("source",u,l,e,r,s),tr("target",u,c,e,i,a),t.set(o.id,o)}}function Di(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Di(n,t):!1}function nr(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function jf(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!Di(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function Sn({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const u=n.get(s)?.internals.userNode;u&&r.push({...u,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function Ff({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=Nt(i,t);return{x:s.x-i.x,y:s.y-i.y}}function Yf({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,u=!1,c={x:0,y:0},l=null,f=!1,d=null,h=!1,g=!1,_=null;function w({noDragClassName:C,handleSelector:p,domNode:v,isSelectable:A,nodeId:S,nodeClickDistance:b=0}){d=le(v);function T({x:V,y:O}){const{nodeLookup:x,nodeExtent:M,snapGrid:N,snapToGrid:I,nodeOrigin:$,onNodeDrag:P,onSelectionDrag:j,onError:m,updateNodePositions:E}=t();i={x:V,y:O};let B=!1;const L=a.size>1,Y=L&&M?Vn(Ct(a)):null,W=L&&I?Ff({dragItems:a,snapGrid:N,x:V,y:O}):null;for(const[Z,H]of a){if(!x.has(Z))continue;let X={x:V-H.distance.x,y:O-H.distance.y};I&&(X=W?{x:Math.round(X.x+W.x),y:Math.round(X.y+W.y)}:Nt(X,N));let J=null;if(L&&M&&!H.extent&&Y){const{positionAbsolute:U}=H.internals,ee=U.x-Y.x+M[0][0],ne=U.x+H.measured.width-Y.x2+M[1][0],re=U.y-Y.y+M[0][1],ce=U.y+H.measured.height-Y.y2+M[1][1];J=[[ee,re],[ne,ce]]}const{position:Q,positionAbsolute:q}=xi({nodeId:Z,nextPosition:X,nodeLookup:x,nodeExtent:J||M,nodeOrigin:$,onError:m});B=B||H.position.x!==Q.x||H.position.y!==Q.y,H.position=Q,H.internals.positionAbsolute=q}if(g=g||B,!!B&&(E(a,!0),_&&(o||P||!S&&j))){const[Z,H]=Sn({nodeId:S,dragItems:a,nodeLookup:x});o?.(_,a,Z,H),P?.(_,Z,H),S||j?.(_,H)}}async function k(){if(!l)return;const{transform:V,panBy:O,autoPanSpeed:x,autoPanOnNodeDrag:M}=t();if(!M){u=!1,cancelAnimationFrame(s);return}const[N,I]=no(c,l,x);(N!==0||I!==0)&&(i.x=(i.x??0)-N/V[2],i.y=(i.y??0)-I/V[2],await O({x:N,y:I})&&T(i)),s=requestAnimationFrame(k)}function F(V){const{nodeLookup:O,multiSelectionActive:x,nodesDraggable:M,transform:N,snapGrid:I,snapToGrid:$,selectNodesOnDrag:P,onNodeDragStart:j,onSelectionDragStart:m,unselectNodesAndEdges:E}=t();f=!0,(!P||!A)&&!x&&S&&(O.get(S)?.selected||E()),A&&P&&S&&e?.(S);const B=dt(V.sourceEvent,{transform:N,snapGrid:I,snapToGrid:$,containerBounds:l});if(i=B,a=jf(O,M,B,S),a.size>0&&(n||j||!S&&m)){const[L,Y]=Sn({nodeId:S,dragItems:a,nodeLookup:O});n?.(V.sourceEvent,a,L,Y),j?.(V.sourceEvent,L,Y),S||m?.(V.sourceEvent,Y)}}const z=Kr().clickDistance(b).on("start",V=>{const{domNode:O,nodeDragThreshold:x,transform:M,snapGrid:N,snapToGrid:I}=t();l=O?.getBoundingClientRect()||null,h=!1,g=!1,_=V.sourceEvent,x===0&&F(V),i=dt(V.sourceEvent,{transform:M,snapGrid:N,snapToGrid:I,containerBounds:l}),c=me(V.sourceEvent,l)}).on("drag",V=>{const{autoPanOnNodeDrag:O,transform:x,snapGrid:M,snapToGrid:N,nodeDragThreshold:I,nodeLookup:$}=t(),P=dt(V.sourceEvent,{transform:x,snapGrid:M,snapToGrid:N,containerBounds:l});if(_=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||S&&!$.has(S))&&(h=!0),!h){if(!u&&O&&f&&(u=!0,k()),!f){const j=me(V.sourceEvent,l),m=j.x-c.x,E=j.y-c.y;Math.sqrt(m*m+E*E)>I&&F(V)}(i.x!==P.xSnapped||i.y!==P.ySnapped)&&a&&f&&(c=me(V.sourceEvent,l),T(P))}}).on("end",V=>{if(!f||h){h&&a.size>0&&t().updateNodePositions(a,!1);return}if(u=!1,f=!1,cancelAnimationFrame(s),a.size>0){const{nodeLookup:O,updateNodePositions:x,onNodeDragStop:M,onSelectionDragStop:N}=t();if(g&&(x(a,!1),g=!1),r||M||!S&&N){const[I,$]=Sn({nodeId:S,dragItems:a,nodeLookup:O,dragging:!1});r?.(V.sourceEvent,a,I,$),M?.(V.sourceEvent,I,$),S||N?.(V.sourceEvent,$)}}}).filter(V=>{const O=V.target;return!V.button&&(!C||!nr(O,`.${C}`,v))&&(!p||nr(O,p,v))});d.call(z)}function y(){d?.on(".drag",null)}return{update:w,destroy:y}}function Xf(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Kt(r,wt(i))>0&&o.push(i);return o}const Zf=250;function Wf(e,t,n,o){let r=[],i=1/0;const s=Xf(e,n,t+Zf);for(const a of s){const u=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const c of u){if(o.nodeId===c.nodeId&&o.type===c.type&&o.id===c.id)continue;const{x:l,y:f}=We(a,c,c.position,!0),d=Math.sqrt(Math.pow(l-e.x,2)+Math.pow(f-e.y,2));d>t||(d1){const a=o.type==="source"?"target":"source";return r.find(u=>u.type===a)??r[0]}return r[0]}function Hi(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],u=(n?a?.find(c=>c.id===n):a?.[0])??null;return u&&i?{...u,...We(s,u,u.position,!0)}:u}function zi(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function qf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Oi=()=>!0;function Gf(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:u,lib:c,autoPanOnConnect:l,flowId:f,panBy:d,cancelConnection:h,onConnectStart:g,onConnect:_,onConnectEnd:w,isValidConnection:y=Oi,onReconnectEnd:C,updateConnection:p,getTransform:v,getFromHandle:A,autoPanSpeed:S,dragThreshold:b=1,handleDomNode:T}){const k=Ci(e.target);let F=0,z;const{x:V,y:O}=me(e),x=zi(i,T),M=a?.getBoundingClientRect();let N=!1;if(!M||!x)return;const I=Hi(r,x,o,u,t);if(!I)return;let $=me(e,M),P=!1,j=null,m=!1,E=null;function B(){if(!l||!M)return;const[Q,q]=no($,M,S);d({x:Q,y:q}),F=requestAnimationFrame(B)}const L={...I,nodeId:r,type:x,position:I.position},Y=u.get(r);let Z={inProgress:!0,isValid:null,from:We(Y,L,G.Left,!0),fromHandle:L,fromPosition:L.position,fromNode:Y,to:$,toHandle:null,toPosition:Yo[L.position],toNode:null,pointer:$};function H(){N=!0,p(Z),g?.(e,{nodeId:r,handleId:o,handleType:x})}b===0&&H();function X(Q){if(!N){const{x:ce,y:Ce}=me(Q),we=ce-V,ve=Ce-O;if(!(we*we+ve*ve>b*b))return;H()}if(!A()||!L){J(Q);return}const q=v();$=me(Q,M),z=Wf(Mt($,q,!1,[1,1]),n,u,L),P||(B(),P=!0);const U=Li(Q,{handle:z,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:y,doc:k,lib:c,flowId:f,nodeLookup:u});E=U.handleDomNode,j=U.connection,m=qf(!!z,U.isValid);const ee=u.get(r),ne=ee?We(ee,L,G.Left,!0):Z.from,re={...Z,from:ne,isValid:m,to:U.toHandle&&m?ot({x:U.toHandle.x,y:U.toHandle.y},q):$,toHandle:U.toHandle,toPosition:m&&U.toHandle?U.toHandle.position:Yo[L.position],toNode:U.toHandle?u.get(U.toHandle.nodeId):null,pointer:$};p(re),Z=re}function J(Q){if(!("touches"in Q&&Q.touches.length>0)){if(N){(z||E)&&j&&m&&_?.(j);const{inProgress:q,...U}=Z,ee={...U,toPosition:Z.toHandle?Z.toPosition:null};w?.(Q,ee),i&&C?.(Q,ee)}h(),cancelAnimationFrame(F),P=!1,m=!1,j=null,E=null,k.removeEventListener("mousemove",X),k.removeEventListener("mouseup",J),k.removeEventListener("touchmove",X),k.removeEventListener("touchend",J)}}k.addEventListener("mousemove",X),k.addEventListener("mouseup",J),k.addEventListener("touchmove",X),k.addEventListener("touchend",J)}function Li(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:u,isValidConnection:c=Oi,nodeLookup:l}){const f=i==="target",d=t?s.querySelector(`.${a}-flow__handle[data-id="${u}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:g}=me(e),_=s.elementFromPoint(h,g),w=_?.classList.contains(`${a}-flow__handle`)?_:d,y={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const C=zi(void 0,w),p=w.getAttribute("data-nodeid"),v=w.getAttribute("data-handleid"),A=w.classList.contains("connectable"),S=w.classList.contains("connectableend");if(!p||!C)return y;const b={source:f?p:o,sourceHandle:f?v:r,target:f?o:p,targetHandle:f?r:v};y.connection=b;const k=A&&S&&(n===tt.Strict?f&&C==="source"||!f&&C==="target":p!==o||v!==r);y.isValid=k&&c(b),y.toHandle=Hi(p,C,v,l,n,!0)}return y}const Xn={onPointerDown:Gf,isValid:Li};function Uf({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=le(e);function i({translateExtent:a,width:u,height:c,zoomStep:l=1,pannable:f=!0,zoomable:d=!0,inversePan:h=!1}){const g=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const v=n(),A=p.sourceEvent.ctrlKey&&vt()?10:1,S=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*l,b=v[2]*Math.pow(2,S*A);t.scaleTo(b)};let _=[0,0];const w=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(_=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},y=p=>{const v=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const A=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],S=[A[0]-_[0],A[1]-_[1]];_=A;const b=o()*Math.max(v[2],Math.log(v[2]))*(h?-1:1),T={x:v[0]-S[0]*b,y:v[1]-S[1]*b},k=[[0,0],[u,c]];t.setViewportConstrained({x:T.x,y:T.y,zoom:v[2]},k,a)},C=di().on("start",w).on("zoom",f?y:null).on("zoom.wheel",d?g:null);r.call(C,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:he}}const un=e=>({x:e.x,y:e.y,zoom:e.k}),Cn=({x:e,y:t,zoom:n})=>sn.translate(e,t).scale(n),Ge=(e,t)=>e.target.closest(`.${t}`),Bi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Kf=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Nn=(e,t=0,n=Kf,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Vi=e=>{const t=e.ctrlKey&&vt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Qf({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c}){return l=>{if(Ge(l,t))return l.ctrlKey&&l.preventDefault(),!1;l.preventDefault(),l.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(l.ctrlKey&&s){const w=he(l),y=Vi(l),C=f*Math.pow(2,y);o.scaleTo(n,C,w,l);return}const d=l.deltaMode===1?20:1;let h=r===je.Vertical?0:l.deltaX*d,g=r===je.Horizontal?0:l.deltaY*d;!vt()&&l.shiftKey&&r!==je.Vertical&&(h=l.deltaY*d,g=0),o.translateBy(n,-(h/f)*i,-(g/f)*i,{internal:!0});const _=un(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?u?.(l,_):(e.isPanScrolling=!0,a?.(l,_)),e.panScrollTimeout=setTimeout(()=>{c?.(l,_),e.isPanScrolling=!1},150)}}function Jf({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=Ge(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function ed({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=un(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function td({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Bi(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,un(i.transform))}}function nd({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Bi(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=un(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function od({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:u,lib:c,connectionInProgress:l}){return f=>{const d=e||t,h=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Ge(f,`${c}-flow__node`)||Ge(f,`${c}-flow__edge`)))return!0;if(!o&&!d&&!r&&!i&&!n||s||l&&!g||Ge(f,a)&&g||Ge(f,u)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!d&&!r&&!h&&g||!o&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(o)&&!o.includes(f.button)&&f.type==="mousedown")return!1;const _=Array.isArray(o)&&o.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||g)&&_}}function rd({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:u}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},l=e.getBoundingClientRect();let f=[[0,0],[l.width,l.height]];(typeof ResizeObserver<"u"?new ResizeObserver(O=>{const x=O[0];x&&(f=[[0,0],[x.contentRect.width,x.contentRect.height]])}):null)?.observe(e);const h=di().extent(()=>f).scaleExtent([t,n]).translateExtent(o),g=le(e).call(h);v({x:r.x,y:r.y,zoom:nt(r.zoom,t,n)},[[0,0],[l.width,l.height]],o);const _=g.on("wheel.zoom"),w=g.on("dblclick.zoom");h.wheelDelta(Vi);async function y(O,x){return g?new Promise(M=>{h?.interpolate(x?.interpolate==="linear"?ft:Ot).transform(Nn(g,x?.duration,x?.ease,()=>M(!0)),O)}):!1}function C({noWheelClassName:O,noPanClassName:x,onPaneContextMenu:M,userSelectionActive:N,panOnScroll:I,panOnDrag:$,panOnScrollMode:P,panOnScrollSpeed:j,preventScrolling:m,zoomOnPinch:E,zoomOnScroll:B,zoomOnDoubleClick:L,zoomActivationKeyPressed:Y,lib:W,onTransformChange:Z,connectionInProgress:H,paneClickDistance:X,selectionOnDrag:J}){N&&!c.isZoomingOrPanning&&p();const Q=I&&!Y&&!N;h.clickDistance(J?1/0:!pe(X)||X<0?0:X);const q=Q?Qf({zoomPanValues:c,noWheelClassName:O,d3Selection:g,d3Zoom:h,panOnScrollMode:P,panOnScrollSpeed:j,zoomOnPinch:E,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):Jf({noWheelClassName:O,preventScrolling:m,d3ZoomHandler:_});g.on("wheel.zoom",q,{passive:!1});const U=ed({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:s});h.on("start",U);const ee=td({zoomPanValues:c,panOnDrag:$,onPaneContextMenu:!!M,onPanZoom:i,onTransformChange:Z});h.on("zoom",ee);const ne=nd({zoomPanValues:c,panOnDrag:$,panOnScroll:I,onPaneContextMenu:M,onPanZoomEnd:a,onDraggingChange:u});h.on("end",ne);const re=od({zoomActivationKeyPressed:Y,panOnDrag:$,zoomOnScroll:B,panOnScroll:I,zoomOnDoubleClick:L,zoomOnPinch:E,userSelectionActive:N,noPanClassName:x,noWheelClassName:O,lib:W,connectionInProgress:H});h.filter(re),L?g.on("dblclick.zoom",w):g.on("dblclick.zoom",null)}function p(){h.on("zoom",null)}async function v(O,x,M){const N=Cn(O),I=h?.constrain()(N,x,M);return I&&await y(I),I}async function A(O,x){const M=Cn(O);return await y(M,x),M}function S(O){if(g){const x=Cn(O),M=g.property("__zoom");(M.k!==O.zoom||M.x!==O.x||M.y!==O.y)&&h?.transform(g,x,null,{sync:!0})}}function b(){const O=g?fi(g.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}async function T(O,x){return g?new Promise(M=>{h?.interpolate(x?.interpolate==="linear"?ft:Ot).scaleTo(Nn(g,x?.duration,x?.ease,()=>M(!0)),O)}):!1}async function k(O,x){return g?new Promise(M=>{h?.interpolate(x?.interpolate==="linear"?ft:Ot).scaleBy(Nn(g,x?.duration,x?.ease,()=>M(!0)),O)}):!1}function F(O){h?.scaleExtent(O)}function z(O){h?.translateExtent(O)}function V(O){const x=!pe(O)||O<0?0:O;h?.clickDistance(x)}return{update:C,destroy:p,setViewport:A,setViewportConstrained:v,getViewport:b,scaleTo:T,scaleBy:k,setScaleExtent:F,setTranslateExtent:z,syncViewport:S,setClickDistance:V}}var rt;(function(e){e.Line="line",e.Handle="handle"})(rt||(rt={}));function id({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,u=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(u[0]=u[0]*-1),a&&i&&(u[1]=u[1]*-1),u}function or(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function Re(e,t){return Math.max(0,t-e)}function Pe(e,t){return Math.max(0,e-t)}function $t(e,t,n){return Math.max(0,t-e,e-n)}function rr(e,t){return e?!t:t}function sd(e,t,n,o,r,i,s,a){let{affectsX:u,affectsY:c}=t;const{isHorizontal:l,isVertical:f}=t,d=l&&f,{xSnapped:h,ySnapped:g}=n,{minWidth:_,maxWidth:w,minHeight:y,maxHeight:C}=o,{x:p,y:v,width:A,height:S,aspectRatio:b}=e;let T=Math.floor(l?h-e.pointerX:0),k=Math.floor(f?g-e.pointerY:0);const F=A+(u?-T:T),z=S+(c?-k:k),V=-i[0]*A,O=-i[1]*S;let x=$t(F,_,w),M=$t(z,y,C);if(s){let $=0,P=0;u&&T<0?$=Re(p+T+V,s[0][0]):!u&&T>0&&($=Pe(p+F+V,s[1][0])),c&&k<0?P=Re(v+k+O,s[0][1]):!c&&k>0&&(P=Pe(v+z+O,s[1][1])),x=Math.max(x,$),M=Math.max(M,P)}if(a){let $=0,P=0;u&&T>0?$=Pe(p+T,a[0][0]):!u&&T<0&&($=Re(p+F,a[1][0])),c&&k>0?P=Pe(v+k,a[0][1]):!c&&k<0&&(P=Re(v+z,a[1][1])),x=Math.max(x,$),M=Math.max(M,P)}if(r){if(l){const $=$t(F/b,y,C)*b;if(x=Math.max(x,$),s){let P=0;!u&&!c||u&&!c&&d?P=Pe(v+O+F/b,s[1][1])*b:P=Re(v+O+(u?T:-T)/b,s[0][1])*b,x=Math.max(x,P)}if(a){let P=0;!u&&!c||u&&!c&&d?P=Re(v+F/b,a[1][1])*b:P=Pe(v+(u?T:-T)/b,a[0][1])*b,x=Math.max(x,P)}}if(f){const $=$t(z*b,_,w)/b;if(M=Math.max(M,$),s){let P=0;!u&&!c||c&&!u&&d?P=Pe(p+z*b+V,s[1][0])/b:P=Re(p+(c?k:-k)*b+V,s[0][0])/b,M=Math.max(M,P)}if(a){let P=0;!u&&!c||c&&!u&&d?P=Re(p+z*b,a[1][0])/b:P=Pe(p+(c?k:-k)*b,a[0][0])/b,M=Math.max(M,P)}}}k=k+(k<0?M:-M),T=T+(T<0?x:-x),r&&(d?F>z*b?k=(rr(u,c)?-T:T)/b:T=(rr(u,c)?-k:k)*b:l?(k=T/b,c=u):(T=k*b,u=c));const N=u?p+T:p,I=c?v+k:v;return{width:A+(u?-T:T),height:S+(c?-k:k),x:i[0]*T*(u?-1:1)+N,y:i[1]*k*(c?-1:1)+I}}const ji={width:0,height:0,x:0,y:0},ad={...ji,pointerX:0,pointerY:0,aspectRatio:1};function cd(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,u=n[1]*s;return[[o-a,r-u],[o+i-a,r+s-u]]}function ud({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=le(e);let s={controlDirection:or("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:l,keepAspectRatio:f,resizeDirection:d,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:w}){let y={...ji},C={...ad};s={boundaries:l,resizeDirection:d,keepAspectRatio:f,controlDirection:or(c)};let p,v=null,A=[],S,b,T,k=!1;const F=Kr().on("start",z=>{const{nodeLookup:V,transform:O,snapGrid:x,snapToGrid:M,nodeOrigin:N,paneDomNode:I}=n();if(p=V.get(t),!p)return;v=I?.getBoundingClientRect()??null;const{xSnapped:$,ySnapped:P}=dt(z.sourceEvent,{transform:O,snapGrid:x,snapToGrid:M,containerBounds:v});y={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},C={...y,pointerX:$,pointerY:P,aspectRatio:y.width/y.height},S=void 0,b=Ze(p.extent)?p.extent:void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(S=V.get(p.parentId)),S&&p.extent==="parent"&&(b=[[0,0],[S.measured.width,S.measured.height]]),A=[],T=void 0;for(const[j,m]of V)if(m.parentId===t&&(A.push({id:j,position:{...m.position},extent:m.extent}),m.extent==="parent"||m.expandParent)){const E=cd(m,p,m.origin??N);T?T=[[Math.min(E[0][0],T[0][0]),Math.min(E[0][1],T[0][1])],[Math.max(E[1][0],T[1][0]),Math.max(E[1][1],T[1][1])]]:T=E}h?.(z,{...y})}).on("drag",z=>{const{transform:V,snapGrid:O,snapToGrid:x,nodeOrigin:M}=n(),N=dt(z.sourceEvent,{transform:V,snapGrid:O,snapToGrid:x,containerBounds:v}),I=[];if(!p)return;const{x:$,y:P,width:j,height:m}=y,E={},B=p.origin??M,{width:L,height:Y,x:W,y:Z}=sd(C,s.controlDirection,N,s.boundaries,s.keepAspectRatio,B,b,T),H=L!==j,X=Y!==m,J=W!==$&&H,Q=Z!==P&&X;if(!J&&!Q&&!H&&!X)return;if((J||Q||B[0]===1||B[1]===1)&&(E.x=J?W:y.x,E.y=Q?Z:y.y,y.x=E.x,y.y=E.y,A.length>0)){const ne=W-$,re=Z-P;for(const ce of A)ce.position={x:ce.position.x-ne+B[0]*(L-j),y:ce.position.y-re+B[1]*(Y-m)},I.push(ce)}if((H||X)&&(E.width=H&&(!s.resizeDirection||s.resizeDirection==="horizontal")?L:y.width,E.height=X&&(!s.resizeDirection||s.resizeDirection==="vertical")?Y:y.height,y.width=E.width,y.height=E.height),S&&p.expandParent){const ne=B[0]*(E.width??0);E.x&&E.x{k&&(_?.(z,{...y}),r?.({...y}),k=!1)});i.call(F)}function u(){i.on(".drag",null)}return{update:a,destroy:u}}var Mn={exports:{}},An={},In={exports:{}},Tn={};var ir;function ld(){if(ir)return Tn;ir=1;var e=en();function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(f,d){var h=d(),g=o({inst:{value:h,getSnapshot:d}}),_=g[0].inst,w=g[1];return i(function(){_.value=h,_.getSnapshot=d,u(_)&&w({inst:_})},[f,h,d]),r(function(){return u(_)&&w({inst:_}),f(function(){u(_)&&w({inst:_})})},[f]),s(h),h}function u(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function c(f,d){return d()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Tn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,Tn}var sr;function fd(){return sr||(sr=1,In.exports=ld()),In.exports}var ar;function dd(){if(ar)return An;ar=1;var e=en(),t=fd();function n(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,u=e.useDebugValue;return An.useSyncExternalStoreWithSelector=function(c,l,f,d,h){var g=i(null);if(g.current===null){var _={hasValue:!1,value:null};g.current=_}else _=g.current;g=a(function(){function y(S){if(!C){if(C=!0,p=S,S=d(S),h!==void 0&&_.hasValue){var b=_.value;if(h(b,S))return v=b}return v=S}if(b=v,o(p,S))return b;var T=d(S);return h!==void 0&&h(b,T)?(p=S,b):(p=S,v=T)}var C=!1,p,v,A=f===void 0?null:f;return[function(){return y(l())},A===null?void 0:function(){return y(A())}]},[l,f,d,h]);var w=r(c,g[0],g[1]);return s(function(){_.hasValue=!0,_.value=w},[w]),u(w),w},An}var cr;function hd(){return cr||(cr=1,Mn.exports=dd()),Mn.exports}var gd=hd();const pd=Hr(gd),md={},ur=e=>{let t;const n=new Set,o=(l,f)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const h=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(g=>g(t,h))}},r=()=>t,u={setState:o,getState:r,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(md?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(o,r,u);return u},yd=e=>e?ur(e):ur,{useDebugValue:xd}=Ta,{useSyncExternalStoreWithSelector:wd}=pd,vd=e=>e;function Fi(e,t=vd,n){const o=wd(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return xd(o),o}const lr=(e,t)=>{const n=yd(e),o=(r,i=t)=>Fi(n,r,i);return Object.assign(o,n),o},_d=(e,t)=>e?lr(e,t):lr;function ie(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var Bg=Ra();const ln=D.createContext(null),Ed=ln.Provider,Yi=ye.error001("react");function te(e,t){const n=D.useContext(ln);if(n===null)throw new Error(Yi);return Fi(n,e,t)}function oe(){const e=D.useContext(ln);if(e===null)throw new Error(Yi);return D.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const fr={display:"none"},bd={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Xi="react-flow__node-desc",Zi="react-flow__edge-desc",Sd="react-flow__aria-live",Cd=e=>e.ariaLiveMessage,Nd=e=>e.ariaLabelConfig;function Md({rfId:e}){const t=te(Cd);return R.jsx("div",{id:`${Sd}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:bd,children:t})}function Ad({rfId:e,disableKeyboardA11y:t}){const n=te(Nd);return R.jsxs(R.Fragment,{children:[R.jsx("div",{id:`${Xi}-${e}`,style:fr,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),R.jsx("div",{id:`${Zi}-${e}`,style:fr,children:n["edge.a11yDescription.default"]}),!t&&R.jsx(Md,{rfId:e})]})}const fn=D.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return R.jsx("div",{className:se(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});fn.displayName="Panel";const dr="https://reactflow.dev?utm_source=attribution";function Id({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:R.jsx(fn,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${dr}`,children:R.jsx("a",{href:dr,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Td=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},Dt=e=>e.id;function kd(e,t){return ie(e.selectedNodes.map(Dt),t.selectedNodes.map(Dt))&&ie(e.selectedEdges.map(Dt),t.selectedEdges.map(Dt))}function Rd({onSelectionChange:e}){const t=oe(),{selectedNodes:n,selectedEdges:o}=te(Td,kd);return D.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const Pd=e=>!!e.onSelectionChangeHandlers;function $d({onSelectionChange:e}){const t=te(Pd);return e||t?R.jsx(Rd,{onSelectionChange:e}):null}const Wi=[0,0],Dd={x:0,y:0,zoom:1},Hd=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],hr=[...Hd,"rfId"],zd=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),gr={translateExtent:yt,nodeOrigin:Wi,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Od(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:u}=te(zd,ie),c=oe();D.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{l.current=gr,a()}),[]);const l=D.useRef(gr);return D.useEffect(()=>{for(const f of hr){const d=e[f],h=l.current[f];d!==h&&(typeof e[f]>"u"||(f==="nodes"?t(d):f==="edges"?n(d):f==="minZoom"?o(d):f==="maxZoom"?r(d):f==="translateExtent"?i(d):f==="nodeExtent"?s(d):f==="ariaLabelConfig"?c.setState({ariaLabelConfig:Ef(d)}):f==="fitView"?c.setState({fitViewQueued:d}):f==="fitViewOptions"?c.setState({fitViewOptions:d}):c.setState({[f]:d})))}l.current=e},hr.map(f=>e[f])),null}function pr(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Ld(e){const[t,n]=D.useState(e==="system"?null:e);return D.useEffect(()=>{if(e!=="system"){n(e);return}const o=pr(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:pr()?.matches?"dark":"light"}const mr=typeof document<"u"?document:null;function _t(e=null,t={target:mr,actInsideInputWithModifier:!0}){const[n,o]=D.useState(!1),r=D.useRef(!1),i=D.useRef(new Set([])),[s,a]=D.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` +`).replace(` + +`,` ++`).split(` +`)),l=c.reduce((f,d)=>f.concat(...d),[]);return[c,l]}return[[],[]]},[e]);return D.useEffect(()=>{const u=t?.target??mr,c=t?.actInsideInputWithModifier??!0;if(e!==null){const l=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!c)&&Ni(h))return!1;const _=xr(h.code,a);if(i.current.add(h[_]),yr(s,i.current,!1)){const w=h.composedPath?.()?.[0]||h.target,y=w?.nodeName==="BUTTON"||w?.nodeName==="A";t.preventDefault!==!1&&(r.current||!y)&&h.preventDefault(),o(!0)}},f=h=>{const g=xr(h.code,a);yr(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),r.current=!1},d=()=>{i.current.clear(),o(!1)};return u?.addEventListener("keydown",l),u?.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{u?.removeEventListener("keydown",l),u?.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,o]),n}function yr(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function xr(e,t){return t.includes(e)?"code":"key"}const Bd=()=>{const e=oe();return D.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),u=oo(t,o,r,i,s,n?.padding??.1);return a?(await a.setViewport(u,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:u}=s.getBoundingClientRect(),c={x:t.x-a,y:t.y-u},l=n.snapGrid??r,f=n.snapToGrid??i;return Mt(c,o,f,l)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),s=ot(t,n);return{x:s.x+r,y:s.y+i}}}),[])};function qi(e,t){const n=[],o=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of t){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const u of s)Vd(u,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Vd(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function jd(e,t){return qi(e,t)}function Fd(e,t){return qi(e,t)}function Le(e,t){return{id:e,type:"select",selected:t}}function Ue(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(Le(i.id,s)))}return o}function wr({items:e=[],lookup:t}){const n=[],o=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const s=t.get(i.id),a=s?.internals?.userNode??s;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)o.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function vr(e){return{id:e.id,type:"remove"}}const Yd=Ei();function Xd(e,t,n={}){return Af(e,t,{...n,onError:n.onError??Yd})}const _r=e=>hf(e),Zd=e=>yi(e);function Gi(e){return D.forwardRef(e)}const Ui=typeof window<"u"?D.useLayoutEffect:D.useEffect;function Er(e){const[t,n]=D.useState(BigInt(0)),[o]=D.useState(()=>Wd(()=>n(r=>r+BigInt(1))));return Ui(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function Wd(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Ki=D.createContext(null);function qd({children:e}){const t=oe(),n=D.useCallback(a=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:l,onNodesChange:f,nodeLookup:d,fitViewQueued:h,onNodesChangeMiddlewareMap:g}=t.getState();let _=u;for(const y of a)_=typeof y=="function"?y(_):y;let w=wr({items:_,lookup:d});for(const y of g.values())w=y(w);l&&c(_),w.length>0?f?.(w):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:C,setNodes:p}=t.getState();y&&p(C)})},[]),o=Er(n),r=D.useCallback(a=>{const{edges:u=[],setEdges:c,hasDefaultEdges:l,onEdgesChange:f,edgeLookup:d}=t.getState();let h=u;for(const g of a)h=typeof g=="function"?g(h):g;l?c(h):f&&f(wr({items:h,lookup:d}))},[]),i=Er(r),s=D.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return R.jsx(Ki.Provider,{value:s,children:e})}function Gd(){const e=D.useContext(Ki);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Ud=e=>!!e.panZoom;function lo(){const e=Bd(),t=oe(),n=Gd(),o=te(Ud),r=D.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),s=f=>{n.nodeQueue.push(f)},a=f=>{n.edgeQueue.push(f)},u=f=>{const{nodeLookup:d,nodeOrigin:h}=t.getState(),g=_r(f)?f:d.get(f.id),_=g.parentId?Si(g.position,g.measured,g.parentId,d,h):g.position,w={...g,position:_,width:g.measured?.width??g.width,height:g.measured?.height??g.height};return wt(w)},c=(f,d,h={replace:!1})=>{s(g=>g.map(_=>{if(_.id===f){const w=typeof d=="function"?d(_):d;return h.replace&&_r(w)?w:{..._,...w}}return _}))},l=(f,d,h={replace:!1})=>{a(g=>g.map(_=>{if(_.id===f){const w=typeof d=="function"?d(_):d;return h.replace&&Zd(w)?w:{..._,...w}}return _}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>i(f)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(d=>({...d}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:s,setEdges:a,addNodes:f=>{const d=Array.isArray(f)?f:[f];n.nodeQueue.push(h=>[...h,...d])},addEdges:f=>{const d=Array.isArray(f)?f:[f];n.edgeQueue.push(h=>[...h,...d])},toObject:()=>{const{nodes:f=[],edges:d=[],transform:h}=t.getState(),[g,_,w]=h;return{nodes:f.map(y=>({...y})),edges:d.map(y=>({...y})),viewport:{x:g,y:_,zoom:w}}},deleteElements:async({nodes:f=[],edges:d=[]})=>{const{nodes:h,edges:g,onNodesDelete:_,onEdgesDelete:w,triggerNodeChanges:y,triggerEdgeChanges:C,onDelete:p,onBeforeDelete:v}=t.getState(),{nodes:A,edges:S}=await xf({nodesToRemove:f,edgesToRemove:d,nodes:h,edges:g,onBeforeDelete:v}),b=S.length>0,T=A.length>0;if(b){const k=S.map(vr);w?.(S),C(k)}if(T){const k=A.map(vr);_?.(A),y(k)}return(T||b)&&p?.({nodes:A,edges:S}),{deletedNodes:A,deletedEdges:S}},getIntersectingNodes:(f,d=!0,h)=>{const g=Zo(f),_=g?f:u(f),w=h!==void 0;return _?(h||t.getState().nodes).filter(y=>{const C=t.getState().nodeLookup.get(y.id);if(C&&!g&&(y.id===f.id||!C.internals.positionAbsolute))return!1;const p=wt(w?y:C),v=Kt(p,_);return d&&v>0||v>=p.width*p.height||v>=_.width*_.height}):[]},isNodeIntersecting:(f,d,h=!0)=>{const _=Zo(f)?f:u(f);if(!_)return!1;const w=Kt(_,d);return h&&w>0||w>=d.width*d.height||w>=_.width*_.height},updateNode:c,updateNodeData:(f,d,h={replace:!1})=>{c(f,g=>{const _=typeof d=="function"?d(g):d;return h.replace?{...g,data:_}:{...g,data:{...g.data,..._}}},h)},updateEdge:l,updateEdgeData:(f,d,h={replace:!1})=>{l(f,g=>{const _=typeof d=="function"?d(g):d;return h.replace?{...g,data:_}:{...g,data:{...g.data,..._}}},h)},getNodesBounds:f=>{const{nodeLookup:d,nodeOrigin:h}=t.getState();return gf(f,{nodeLookup:d,nodeOrigin:h})},getHandleConnections:({type:f,id:d,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}-${f}${d?`-${d}`:""}`)?.values()??[]),getNodeConnections:({type:f,handleId:d,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}${f?d?`-${f}-${d}`:`-${f}`:""}`)?.values()??[]),fitView:async f=>{const d=t.getState().fitViewResolver??_f();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:d}),n.nodeQueue.push(h=>[...h]),d.promise}}},[]);return D.useMemo(()=>({...r,...e,viewportInitialized:o}),[o])}const br=e=>e.selected,Kd=typeof window<"u"?window:void 0;function Qd({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=oe(),{deleteElements:o}=lo(),r=_t(e,{actInsideInputWithModifier:!1}),i=_t(t,{target:Kd});D.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();o({nodes:a.filter(br),edges:s.filter(br)}),n.setState({nodesSelectionActive:!1})}},[r]),D.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Jd(e){const t=oe();D.useEffect(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const o=ro(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",ye.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const dn={position:"absolute",width:"100%",height:"100%",top:0,left:0},eh=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function th({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=je.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:l,maxZoom:f,zoomActivationKeyCode:d,preventScrolling:h=!0,children:g,noWheelClassName:_,noPanClassName:w,onViewportChange:y,isControlledViewport:C,paneClickDistance:p,selectionOnDrag:v}){const A=oe(),S=D.useRef(null),{userSelectionActive:b,lib:T,connectionInProgress:k}=te(eh,ie),F=_t(d),z=D.useRef();Jd(S);const V=D.useCallback(O=>{y?.({x:O[0],y:O[1],zoom:O[2]}),C||A.setState({transform:O})},[y,C]);return D.useEffect(()=>{if(S.current){z.current=rd({domNode:S.current,minZoom:l,maxZoom:f,translateExtent:c,viewport:u,onDraggingChange:N=>A.setState(I=>I.paneDragging===N?I:{paneDragging:N}),onPanZoomStart:(N,I)=>{const{onViewportChangeStart:$,onMoveStart:P}=A.getState();P?.(N,I),$?.(I)},onPanZoom:(N,I)=>{const{onViewportChange:$,onMove:P}=A.getState();P?.(N,I),$?.(I)},onPanZoomEnd:(N,I)=>{const{onViewportChangeEnd:$,onMoveEnd:P}=A.getState();P?.(N,I),$?.(I)}});const{x:O,y:x,zoom:M}=z.current.getViewport();return A.setState({panZoom:z.current,transform:[O,x,M],domNode:S.current.closest(".react-flow")}),()=>{z.current?.destroy()}}},[]),D.useEffect(()=>{z.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:F,preventScrolling:h,noPanClassName:w,userSelectionActive:b,noWheelClassName:_,lib:T,onTransformChange:V,connectionInProgress:k,selectionOnDrag:v,paneClickDistance:p})},[e,t,n,o,r,i,s,a,F,h,w,b,_,T,V,k,v,p]),R.jsx("div",{className:"react-flow__renderer",ref:S,style:dn,children:g})}const nh=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function oh(){const{userSelectionActive:e,userSelectionRect:t}=te(nh,ie);return e&&t?R.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const kn=(e,t)=>n=>{n.target===t.current&&e?.(n)},rh=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function ih({isSelecting:e,selectionKeyPressed:t,selectionMode:n=xt.Full,panOnDrag:o,autoPanOnSelection:r,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:a,onSelectionEnd:u,onPaneClick:c,onPaneContextMenu:l,onPaneScroll:f,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:g,children:_}){const w=D.useRef(0),y=oe(),{userSelectionActive:C,elementsSelectable:p,dragging:v,panBy:A,autoPanSpeed:S}=te(rh,ie),b=p&&(e||C),T=D.useRef(null),k=D.useRef(),F=D.useRef(new Set),z=D.useRef(new Set),V=D.useRef(!1),O=D.useRef(!1),x=D.useRef({x:0,y:0}),M=D.useRef(!1),N=H=>{if(O.current||V.current||y.getState().connection.inProgress){O.current=!1,V.current=!1;return}c?.(H),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},I=H=>{if(Array.isArray(o)&&o?.includes(2)){H.preventDefault();return}l?.(H)},$=f?H=>f(H):void 0,P=H=>{O.current&&(H.stopPropagation(),O.current=!1)},j=H=>{const{domNode:X,transform:J}=y.getState();if(k.current=X?.getBoundingClientRect(),!k.current)return;const Q=H.target===T.current;if(!Q&&!!H.target.closest(".nokey")||!e||!(s&&Q||t)||H.button!==0||!H.isPrimary)return;H.target?.setPointerCapture?.(H.pointerId),O.current=!1;const{x:ee,y:ne}=me(H.nativeEvent,k.current),re=Mt({x:ee,y:ne},J);y.setState({userSelectionRect:{width:0,height:0,startX:re.x,startY:re.y,x:ee,y:ne}}),Q||(H.stopPropagation(),H.preventDefault())};function m(H,X){const{userSelectionRect:J}=y.getState();if(!J)return;const{transform:Q,nodeLookup:q,edgeLookup:U,connectionLookup:ee,triggerNodeChanges:ne,triggerEdgeChanges:re,defaultEdgeOptions:ce}=y.getState(),Ce={x:J.startX,y:J.startY},{x:we,y:ve}=ot(Ce,Q),Ne={startX:Ce.x,startY:Ce.y,x:Hde.id)),z.current=new Set;const ze=ce?.selectable??!0;for(const de of F.current){const Me=ee.get(de);if(Me)for(const{edgeId:Ae}of Me.values()){const Oe=U.get(Ae);Oe&&(Oe.selectable??ze)&&z.current.add(Ae)}}if(!Wo(it,F.current)){const de=Ue(q,F.current,!0);ne(de)}if(!Wo(He,z.current)){const de=Ue(U,z.current);re(de)}y.setState({userSelectionRect:Ne,userSelectionActive:!0,nodesSelectionActive:!1})}function E(){if(!r||!k.current)return;const[H,X]=no(x.current,k.current,S);A({x:H,y:X}).then(J=>{if(!O.current||!J){w.current=requestAnimationFrame(E);return}const{x:Q,y:q}=x.current;m(Q,q),w.current=requestAnimationFrame(E)})}const B=()=>{cancelAnimationFrame(w.current),w.current=0,M.current=!1};D.useEffect(()=>()=>B(),[]);const L=H=>{const{userSelectionRect:X,transform:J,resetSelectedElements:Q}=y.getState();if(!k.current||!X)return;const{x:q,y:U}=me(H.nativeEvent,k.current);x.current={x:q,y:U};const ee=ot({x:X.startX,y:X.startY},J);if(!O.current){const ne=t?0:i;if(Math.hypot(q-ee.x,U-ee.y)<=ne)return;Q(),a?.(H)}O.current=!0,M.current||(E(),M.current=!0),m(q,U)},Y=H=>{if(!b){H.target===T.current&&y.getState().connection.inProgress&&(V.current=!0);return}H.button===0&&(H.target?.releasePointerCapture?.(H.pointerId),!C&&H.target===T.current&&y.getState().userSelectionRect&&N?.(H),y.setState({userSelectionActive:!1,userSelectionRect:null}),O.current&&(u?.(H),y.setState({nodesSelectionActive:F.current.size>0})),B())},W=H=>{H.target?.releasePointerCapture?.(H.pointerId),B()},Z=o===!0||Array.isArray(o)&&o.includes(0);return R.jsxs("div",{className:se(["react-flow__pane",{draggable:Z,dragging:v,selection:e}]),onClick:b?void 0:kn(N,T),onContextMenu:kn(I,T),onWheel:kn($,T),onPointerEnter:b?void 0:d,onPointerMove:b?L:h,onPointerUp:Y,onPointerCancel:b?W:void 0,onPointerDownCapture:b?j:void 0,onClickCapture:b?P:void 0,onPointerLeave:g,ref:T,style:dn,children:[_,R.jsx(oh,{})]})}function Zn({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:u}=t.getState(),c=a.get(e);if(!c){u?.("012",ye.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function Qi({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:s}){const a=oe(),[u,c]=D.useState(!1),l=D.useRef();return D.useEffect(()=>{if(!t)return l.current=Yf({getStoreItems:()=>a.getState(),onNodeMouseDown:f=>{Zn({id:f,store:a,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}}),()=>{l.current?.destroy(),l.current=void 0}},[t,a,e]),D.useEffect(()=>{t||!e.current||!l.current||l.current.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:s})},[n,o,t,i,e,r,s]),u}const sh=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Ji(){const e=oe();return D.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:u,nodeLookup:c,nodeOrigin:l}=e.getState(),f=new Map,d=sh(s),h=r?i[0]:5,g=r?i[1]:5,_=n.direction.x*h*n.factor,w=n.direction.y*g*n.factor;for(const[,y]of c){if(!d(y))continue;let C={x:y.internals.positionAbsolute.x+_,y:y.internals.positionAbsolute.y+w};r&&(C=Nt(C,i));const{position:p,positionAbsolute:v}=xi({nodeId:y.id,nextPosition:C,nodeLookup:c,nodeExtent:o,nodeOrigin:l,onError:a});y.position=p,y.internals.positionAbsolute=v,f.set(y.id,y)}u(f)},[])}const fo=D.createContext(null),ah=fo.Provider;fo.Consumer;const es=()=>D.useContext(fo),ch=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ts=D.createContext(null);function uh({children:e}){const t=te(ch,ie);return R.jsx(ts.Provider,{value:t,children:e})}function lh(){const e=D.useContext(ts);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const fh={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},dh=(e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:s}=o,{fromHandle:a,toHandle:u,isValid:c}=s;if(!a&&!r)return fh;const l=u?.nodeId===e&&u?.id===t&&u?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:l,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===tt.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:l&&c}};function hh({type:e="source",position:t=G.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:u,className:c,onMouseDown:l,onTouchStart:f,...d},h){const g=s||null,_=e==="target",w=oe(),y=es(),{connectOnClick:C,noPanClassName:p,rfId:v}=lh(),{connectingFrom:A,connectingTo:S,clickConnecting:b,isPossibleEndHandle:T,connectionInProcess:k,clickConnectionInProcess:F,valid:z}=te(dh(y,g,e),ie);y||w.getState().onError?.("010",ye.error010());const V=M=>{const{defaultEdgeOptions:N,onConnect:I,hasDefaultEdges:$}=w.getState(),P={...N,...M};if($){const{edges:j,setEdges:m,onError:E}=w.getState();m(Xd(P,j,{onError:E}))}I?.(P),a?.(P)},O=M=>{if(!y)return;const N=Mi(M.nativeEvent);if(r&&(N&&M.button===0||!N)){const I=w.getState();Xn.onPointerDown(M.nativeEvent,{handleDomNode:M.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:_,handleId:g,nodeId:y,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...$)=>w.getState().onConnectEnd?.(...$),updateConnection:I.updateConnection,onConnect:V,isValidConnection:n||((...$)=>w.getState().isValidConnection?.(...$)??!0),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}N?l?.(M):f?.(M)},x=M=>{const{onClickConnectStart:N,onClickConnectEnd:I,connectionClickStartHandle:$,connectionMode:P,isValidConnection:j,lib:m,rfId:E,nodeLookup:B,connection:L}=w.getState();if(!y||!$&&!r)return;if(!$){N?.(M.nativeEvent,{nodeId:y,handleId:g,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const Y=Ci(M.target),W=n||j,{connection:Z,isValid:H}=Xn.isValid(M.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:P,fromNodeId:$.nodeId,fromHandleId:$.id||null,fromType:$.type,isValidConnection:W,flowId:E,doc:Y,lib:m,nodeLookup:B});H&&Z&&V(Z);const X=structuredClone(L);delete X.inProgress,X.toPosition=X.toHandle?X.toHandle.position:null,I?.(M,X),w.setState({connectionClickStartHandle:null})};return R.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${v}-${y}-${g}-${e}`,className:se(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,c,{source:!_,target:_,connectable:o,connectablestart:r,connectableend:i,clickconnecting:b,connectingfrom:A,connectingto:S,valid:z,connectionindicator:o&&(!k||T)&&(k||F?i:r)}]),onMouseDown:O,onTouchStart:O,onClick:C?x:void 0,ref:h,...d,children:u})}const Qt=D.memo(Gi(hh));function gh({data:e,isConnectable:t,sourcePosition:n=G.Bottom}){return R.jsxs(R.Fragment,{children:[e?.label,R.jsx(Qt,{type:"source",position:n,isConnectable:t})]})}function ph({data:e,isConnectable:t,targetPosition:n=G.Top,sourcePosition:o=G.Bottom}){return R.jsxs(R.Fragment,{children:[R.jsx(Qt,{type:"target",position:n,isConnectable:t}),e?.label,R.jsx(Qt,{type:"source",position:o,isConnectable:t})]})}function mh(){return null}function yh({data:e,isConnectable:t,targetPosition:n=G.Top}){return R.jsxs(R.Fragment,{children:[R.jsx(Qt,{type:"target",position:n,isConnectable:t}),e?.label]})}const Jt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Sr={input:gh,default:ph,output:yh,group:mh};function xh(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const wh=e=>{const{width:t,height:n,x:o,y:r}=Ct(e.nodeLookup,{filter:i=>!!i.selected});return{width:pe(t)?t:null,height:pe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function vh({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=oe(),{width:r,height:i,transformString:s,userSelectionActive:a}=te(wh,ie),u=Ji(),c=D.useRef(null);D.useEffect(()=>{n||c.current?.focus({preventScroll:!0})},[n]);const l=!a&&r!==null&&i!==null;if(Qi({nodeRef:c,disabled:!l}),!l)return null;const f=e?h=>{const g=o.getState().nodes.filter(_=>_.selected);e(h,g)}:void 0,d=h=>{Object.prototype.hasOwnProperty.call(Jt,h.key)&&(h.preventDefault(),u({direction:Jt[h.key],factor:h.shiftKey?4:1}))};return R.jsx("div",{className:se(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:R.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:r,height:i}})})}const Cr=typeof window<"u"?window:void 0,_h=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ns({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:l,selectionMode:f,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:_,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:C,zoomOnPinch:p,panOnScroll:v,panOnScrollSpeed:A,panOnScrollMode:S,zoomOnDoubleClick:b,panOnDrag:T,autoPanOnSelection:k,defaultViewport:F,translateExtent:z,minZoom:V,maxZoom:O,preventScrolling:x,onSelectionContextMenu:M,noWheelClassName:N,noPanClassName:I,disableKeyboardA11y:$,onViewportChange:P,isControlledViewport:j}){const{nodesSelectionActive:m,userSelectionActive:E}=te(_h,ie),B=_t(c,{target:Cr}),L=_t(_,{target:Cr}),Y=L||T,W=L||v,Z=l&&Y!==!0,H=B||E||Z;return Qd({deleteKeyCode:u,multiSelectionKeyCode:g}),R.jsx(th,{onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:C,zoomOnPinch:p,panOnScroll:W,panOnScrollSpeed:A,panOnScrollMode:S,zoomOnDoubleClick:b,panOnDrag:!B&&Y,defaultViewport:F,translateExtent:z,minZoom:V,maxZoom:O,zoomActivationKeyCode:w,preventScrolling:x,noWheelClassName:N,noPanClassName:I,onViewportChange:P,isControlledViewport:j,paneClickDistance:a,selectionOnDrag:Z,children:R.jsxs(ih,{onSelectionStart:d,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:Y,autoPanOnSelection:k,isSelecting:!!H,selectionMode:f,selectionKeyPressed:B,paneClickDistance:a,selectionOnDrag:Z,children:[e,m&&R.jsx(vh,{onSelectionContextMenu:M,noPanClassName:I,disableKeyboardA11y:$})]})})}ns.displayName="FlowRenderer";const Eh=D.memo(ns),bh=e=>t=>e?to(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function Sh(e){return te(D.useCallback(bh(e),[e]),ie)}const Ch=e=>e.updateNodeInternals;function Nh(){const e=te(Ch),[t]=D.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:r.target,force:!0})}),e(o)}));return D.useEffect(()=>()=>{t?.disconnect()},[t]),t}function Mh({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const r=oe(),i=D.useRef(null),s=D.useRef(null),a=D.useRef(e.sourcePosition),u=D.useRef(e.targetPosition),c=D.useRef(t),l=n&&!!e.internals.handleBounds;return D.useEffect(()=>{i.current&&!e.hidden&&(!l||s.current!==i.current)&&(s.current&&o?.unobserve(s.current),o?.observe(i.current),s.current=i.current)},[l,e.hidden]),D.useEffect(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),D.useEffect(()=>{if(i.current){const f=c.current!==t,d=a.current!==e.sourcePosition,h=u.current!==e.targetPosition;(f||d||h)&&(c.current=t,a.current=e.sourcePosition,u.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function Ah({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:u,nodesConnectable:c,nodesFocusable:l,resizeObserver:f,noDragClassName:d,noPanClassName:h,disableKeyboardA11y:g,rfId:_,nodeTypes:w,nodeClickDistance:y,onError:C}){const{node:p,internals:v,isParent:A}=te(H=>{const X=H.nodeLookup.get(e),J=H.parentLookup.has(e);return{node:X,internals:X.internals,isParent:J}},ie);let S=p.type||"default",b=w?.[S]||Sr[S];b===void 0&&(C?.("003",ye.error003(S)),S="default",b=w?.default||Sr.default);const T=!!(p.draggable||a&&typeof p.draggable>"u"),k=!!(p.selectable||u&&typeof p.selectable>"u"),F=!!(p.connectable||c&&typeof p.connectable>"u"),z=!!(p.focusable||l&&typeof p.focusable>"u"),V=oe(),O=bi(p),x=Mh({node:p,nodeType:S,hasDimensions:O,resizeObserver:f}),M=Qi({nodeRef:x,disabled:p.hidden||!T,noDragClassName:d,handleSelector:p.dragHandle,nodeId:e,isSelectable:k,nodeClickDistance:y}),N=Ji();if(p.hidden)return null;const I=Se(p),$=xh(p),P=k||T||t||n||o||r,j=n?H=>n(H,{...v.userNode}):void 0,m=o?H=>o(H,{...v.userNode}):void 0,E=r?H=>r(H,{...v.userNode}):void 0,B=i?H=>i(H,{...v.userNode}):void 0,L=s?H=>s(H,{...v.userNode}):void 0,Y=H=>{const{selectNodesOnDrag:X,nodeDragThreshold:J}=V.getState();k&&(!X||!T||J>0)&&Zn({id:e,store:V,nodeRef:x}),t&&t(H,{...v.userNode})},W=H=>{if(!(Ni(H.nativeEvent)||g)){if(hi.includes(H.key)&&k){const X=H.key==="Escape";Zn({id:e,store:V,unselect:X,nodeRef:x})}else if(T&&p.selected&&Object.prototype.hasOwnProperty.call(Jt,H.key)){H.preventDefault();const{ariaLabelConfig:X}=V.getState();V.setState({ariaLiveMessage:X["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~v.positionAbsolute.x,y:~~v.positionAbsolute.y})}),N({direction:Jt[H.key],factor:H.shiftKey?4:1})}}},Z=()=>{if(g||!x.current?.matches(":focus-visible"))return;const{transform:H,width:X,height:J,autoPanOnNodeFocus:Q,setCenter:q}=V.getState();if(!Q)return;to(new Map([[e,p]]),{x:0,y:0,width:X,height:J},H,!0).length>0||q(p.position.x+I.width/2,p.position.y+I.height/2,{zoom:H[2]})};return R.jsx("div",{className:se(["react-flow__node",`react-flow__node-${S}`,{[h]:T},p.className,{selected:p.selected,selectable:k,parent:A,draggable:T,dragging:M}]),ref:x,style:{zIndex:v.z,transform:`translate(${v.positionAbsolute.x}px,${v.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:O?"visible":"hidden",...p.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:j,onMouseMove:m,onMouseLeave:E,onContextMenu:B,onClick:Y,onDoubleClick:L,onKeyDown:z?W:void 0,tabIndex:z?0:void 0,onFocus:z?Z:void 0,role:p.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${Xi}-${_}`,"aria-label":p.ariaLabel,...p.domAttributes,children:R.jsx(ah,{value:e,children:R.jsx(b,{id:e,data:p.data,type:S,positionAbsoluteX:v.positionAbsolute.x,positionAbsoluteY:v.positionAbsolute.y,selected:p.selected??!1,selectable:k,draggable:T,deletable:p.deletable??!0,isConnectable:F,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:M,dragHandle:p.dragHandle,zIndex:v.z,parentId:p.parentId,...I})})})}var Ih=D.memo(Ah);const Th=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function os(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,onError:r}=te(Th,ie),i=Sh(e.onlyRenderVisibleElements),s=Nh();return R.jsx("div",{className:"react-flow__nodes",style:dn,children:i.map(a=>R.jsx(Ih,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:r},a))})}os.displayName="NodeRenderer";const kh=D.memo(os);function Rh(e){return te(D.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);i&&s&&Cf({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[e]),ie)}const Ph=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return R.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},$h=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return R.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Nr={[Gt.Arrow]:Ph,[Gt.ArrowClosed]:$h};function Dh(e){const t=oe();return D.useMemo(()=>Object.prototype.hasOwnProperty.call(Nr,e)?Nr[e]:(t.getState().onError?.("009",ye.error009(e)),null),[e])}const Hh=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const u=Dh(t);return u?R.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:R.jsx(u,{color:n,strokeWidth:s})}):null},rs=({defaultColor:e,rfId:t})=>{const n=te(i=>i.edges),o=te(i=>i.defaultEdgeOptions),r=D.useMemo(()=>Pf(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?R.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:R.jsx("defs",{children:r.map(i=>R.jsx(Hh,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};rs.displayName="MarkerDefinitions";var zh=D.memo(rs);function is({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:u,className:c,...l}){const[f,d]=D.useState({x:1,y:0,width:0,height:0}),h=se(["react-flow__edge-textwrapper",c]),g=D.useRef(null);return D.useEffect(()=>{if(g.current){const _=g.current.getBBox();d({x:_.x,y:_.y,width:_.width,height:_.height})}},[n]),n?R.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:h,visibility:f.width?"visible":"hidden",...l,children:[r&&R.jsx("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),R.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:o,children:n}),u]}):null}is.displayName="EdgeText";const Oh=D.memo(is);function hn({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,interactionWidth:c=20,...l}){return R.jsxs(R.Fragment,{children:[R.jsx("path",{...l,d:e,fill:"none",className:se(["react-flow__edge-path",l.className])}),c?R.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,o&&pe(t)&&pe(n)?R.jsx(Oh,{x:t,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u}):null]})}function Mr({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===G.Left||e===G.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function ss({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:o,targetY:r,targetPosition:i=G.Top}){const[s,a]=Mr({pos:n,x1:e,y1:t,x2:o,y2:r}),[u,c]=Mr({pos:i,x1:o,y1:r,x2:e,y2:t}),[l,f,d,h]=Ai({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${s},${a} ${u},${c} ${o},${r}`,l,f,d,h]}function as(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,label:u,labelStyle:c,labelShowBg:l,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:_,markerStart:w,interactionWidth:y})=>{const[C,p,v]=ss({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),A=e.isInternal?void 0:t;return R.jsx(hn,{id:A,path:C,labelX:p,labelY:v,label:u,labelStyle:c,labelShowBg:l,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:_,markerStart:w,interactionWidth:y})})}const Lh=as({isInternal:!1}),cs=as({isInternal:!0});Lh.displayName="SimpleBezierEdge";cs.displayName="SimpleBezierEdgeInternal";function us(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:f,style:d,sourcePosition:h=G.Bottom,targetPosition:g=G.Top,markerEnd:_,markerStart:w,pathOptions:y,interactionWidth:C})=>{const[p,v,A]=jn({sourceX:n,sourceY:o,sourcePosition:h,targetX:r,targetY:i,targetPosition:g,borderRadius:y?.borderRadius,offset:y?.offset,stepPosition:y?.stepPosition}),S=e.isInternal?void 0:t;return R.jsx(hn,{id:S,path:p,labelX:v,labelY:A,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:_,markerStart:w,interactionWidth:C})})}const ls=us({isInternal:!1}),fs=us({isInternal:!0});ls.displayName="SmoothStepEdge";fs.displayName="SmoothStepEdgeInternal";function ds(e){return D.memo(({id:t,...n})=>{const o=e.isInternal?void 0:t;return R.jsx(ls,{...n,id:o,pathOptions:D.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const Bh=ds({isInternal:!1}),hs=ds({isInternal:!0});Bh.displayName="StepEdge";hs.displayName="StepEdgeInternal";function gs(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:g,interactionWidth:_})=>{const[w,y,C]=ki({sourceX:n,sourceY:o,targetX:r,targetY:i}),p=e.isInternal?void 0:t;return R.jsx(hn,{id:p,path:w,labelX:y,labelY:C,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:g,interactionWidth:_})})}const Vh=gs({isInternal:!1}),ps=gs({isInternal:!0});Vh.displayName="StraightEdge";ps.displayName="StraightEdgeInternal";function ms(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s=G.Bottom,targetPosition:a=G.Top,label:u,labelStyle:c,labelShowBg:l,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:_,markerStart:w,pathOptions:y,interactionWidth:C})=>{const[p,v,A]=Ii({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a,curvature:y?.curvature}),S=e.isInternal?void 0:t;return R.jsx(hn,{id:S,path:p,labelX:v,labelY:A,label:u,labelStyle:c,labelShowBg:l,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:_,markerStart:w,interactionWidth:C})})}const jh=ms({isInternal:!1}),ys=ms({isInternal:!0});jh.displayName="BezierEdge";ys.displayName="BezierEdgeInternal";const Ar={default:ys,straight:ps,step:hs,smoothstep:fs,simplebezier:cs},Ir={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Fh=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,Yh=(e,t,n)=>n===G.Top?e-t:n===G.Bottom?e+t:e,Tr="react-flow__edgeupdater";function kr({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a}){return R.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:se([Tr,`${Tr}-${a}`]),cx:Fh(t,o,e),cy:Yh(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function Xh({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:u,onReconnect:c,onReconnectStart:l,onReconnectEnd:f,setReconnecting:d,setUpdateHover:h}){const g=oe(),_=(v,A)=>{if(v.button!==0)return;const{autoPanOnConnect:S,domNode:b,connectionMode:T,connectionRadius:k,lib:F,onConnectStart:z,cancelConnection:V,nodeLookup:O,rfId:x,panBy:M,updateConnection:N}=g.getState(),I=A.type==="target",$=(m,E)=>{d(!1),f?.(m,n,A.type,E)},P=m=>c?.(n,m),j=(m,E)=>{d(!0),l?.(v,n,A.type),z?.(m,E)};Xn.onPointerDown(v.nativeEvent,{autoPanOnConnect:S,connectionMode:T,connectionRadius:k,domNode:b,handleId:A.id,nodeId:A.nodeId,nodeLookup:O,isTarget:I,edgeUpdaterType:A.type,lib:F,flowId:x,cancelConnection:V,panBy:M,isValidConnection:(...m)=>g.getState().isValidConnection?.(...m)??!0,onConnect:P,onConnectStart:j,onConnectEnd:(...m)=>g.getState().onConnectEnd?.(...m),onReconnectEnd:$,updateConnection:N,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:v.currentTarget})},w=v=>_(v,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=v=>_(v,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>h(!0),p=()=>h(!1);return R.jsxs(R.Fragment,{children:[(e===!0||e==="source")&&R.jsx(kr,{position:a,centerX:o,centerY:r,radius:t,onMouseDown:w,onMouseEnter:C,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&R.jsx(kr,{position:u,centerX:i,centerY:s,radius:t,onMouseDown:y,onMouseEnter:C,onMouseOut:p,type:"target"})]})}function Zh({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,reconnectRadius:l,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,rfId:g,edgeTypes:_,noPanClassName:w,onError:y,disableKeyboardA11y:C}){let p=te(q=>q.edgeLookup.get(e));const v=te(q=>q.defaultEdgeOptions);p=v?{...v,...p}:p;let A=p.type||"default",S=_?.[A]||Ar[A];S===void 0&&(y?.("011",ye.error011(A)),A="default",S=_?.default||Ar.default);const b=!!(p.focusable||t&&typeof p.focusable>"u"),T=typeof f<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),k=!!(p.selectable||o&&typeof p.selectable>"u"),F=D.useRef(null),[z,V]=D.useState(!1),[O,x]=D.useState(!1),M=oe(),{zIndex:N=p.zIndex,sourceX:I,sourceY:$,targetX:P,targetY:j,sourcePosition:m,targetPosition:E}=te(D.useCallback(q=>{const U=q.nodeLookup.get(p.source),ee=q.nodeLookup.get(p.target);if(!U||!ee)return Ir;const ne=Rf({id:e,sourceNode:U,targetNode:ee,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:q.connectionMode,onError:y}),re=Sf({selected:p.selected,zIndex:p.zIndex,sourceNode:U,targetNode:ee,elevateOnSelect:q.elevateEdgesOnSelect,zIndexMode:q.zIndexMode});return{...ne||Ir,zIndex:re}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex]),ie),B=D.useMemo(()=>p.markerStart?`url('#${Fn(p.markerStart,g)}')`:void 0,[p.markerStart,g]),L=D.useMemo(()=>p.markerEnd?`url('#${Fn(p.markerEnd,g)}')`:void 0,[p.markerEnd,g]);if(p.hidden||I===null||$===null||P===null||j===null)return null;const Y=q=>{const{addSelectedEdges:U,unselectNodesAndEdges:ee,multiSelectionActive:ne}=M.getState();k&&(M.setState({nodesSelectionActive:!1}),p.selected&&ne?(ee({nodes:[],edges:[p]}),F.current?.blur()):U([e])),r&&r(q,p)},W=i?q=>{i(q,{...p})}:void 0,Z=s?q=>{s(q,{...p})}:void 0,H=a?q=>{a(q,{...p})}:void 0,X=u?q=>{u(q,{...p})}:void 0,J=c?q=>{c(q,{...p})}:void 0,Q=q=>{if(!C&&hi.includes(q.key)&&k){const{unselectNodesAndEdges:U,addSelectedEdges:ee}=M.getState();q.key==="Escape"?(F.current?.blur(),U({edges:[p]})):ee([e])}};return R.jsx("svg",{style:{zIndex:N},children:R.jsxs("g",{className:se(["react-flow__edge",`react-flow__edge-${A}`,p.className,w,{selected:p.selected,animated:p.animated,inactive:!k&&!r,updating:z,selectable:k}]),onClick:Y,onDoubleClick:W,onContextMenu:Z,onMouseEnter:H,onMouseMove:X,onMouseLeave:J,onKeyDown:b?Q:void 0,tabIndex:b?0:void 0,role:p.ariaRole??(b?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":b?`${Zi}-${g}`:void 0,ref:F,...p.domAttributes,children:[!O&&R.jsx(S,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:k,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:I,sourceY:$,targetX:P,targetY:j,sourcePosition:m,targetPosition:E,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:B,markerEnd:L,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),T&&R.jsx(Xh,{edge:p,isReconnectable:T,reconnectRadius:l,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,sourceX:I,sourceY:$,targetX:P,targetY:j,sourcePosition:m,targetPosition:E,setUpdateHover:V,setReconnecting:x})]})})}var Wh=D.memo(Zh);const qh=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function xs({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:l,reconnectRadius:f,onEdgeDoubleClick:d,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:_}){const{edgesFocusable:w,edgesReconnectable:y,elementsSelectable:C,onError:p}=te(qh,ie),v=Rh(t);return R.jsxs("div",{className:"react-flow__edges",children:[R.jsx(zh,{defaultColor:e,rfId:n}),v.map(A=>R.jsx(Wh,{id:A,edgesFocusable:w,edgesReconnectable:y,elementsSelectable:C,noPanClassName:r,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:l,reconnectRadius:f,onDoubleClick:d,onReconnectStart:h,onReconnectEnd:g,rfId:n,onError:p,edgeTypes:o,disableKeyboardA11y:_},A))]})}xs.displayName="EdgeRenderer";const Gh=D.memo(xs),Rr=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function Uh({children:e}){const t=oe(),n=D.useRef(null),[o]=D.useState(()=>t.getState().transform);return Ui(()=>{let r=null;const i=()=>{const s=t.getState().transform;r&&s[0]===r[0]&&s[1]===r[1]&&s[2]===r[2]||(r=s,n.current&&(n.current.style.transform=Rr(s)))};return i(),t.subscribe(i)},[t]),R.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Rr(o)},children:e})}function Kh(e){const t=lo(),n=D.useRef(!1);D.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Qh=e=>e.panZoom?.syncViewport;function Jh(e){const t=te(Qh),n=oe();return D.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function eg(e){return e.connection.inProgress?{...e.connection,to:Mt(e.connection.to,e.transform)}:{...e.connection}}function tg(e){return eg}function ng(e){const t=tg();return te(t,ie)}const og=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function rg({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:r,width:i,height:s,isValid:a,inProgress:u}=te(og,ie);return!(i&&r&&u)?null:R.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:R.jsx("g",{className:se(["react-flow__connection",mi(a)]),children:R.jsx(ws,{style:t,type:n,CustomComponent:o,isValid:a})})})}const ws=({style:e,type:t=$e.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:i,fromNode:s,fromHandle:a,fromPosition:u,to:c,toNode:l,toHandle:f,toPosition:d,pointer:h}=ng();if(!r)return;if(n)return R.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:c.x,toY:c.y,fromPosition:u,toPosition:d,connectionStatus:mi(o),toNode:l,toHandle:f,pointer:h});let g="";const _={sourceX:i.x,sourceY:i.y,sourcePosition:u,targetX:c.x,targetY:c.y,targetPosition:d};switch(t){case $e.Bezier:[g]=Ii(_);break;case $e.SimpleBezier:[g]=ss(_);break;case $e.Step:[g]=jn({..._,borderRadius:0});break;case $e.SmoothStep:[g]=jn(_);break;default:[g]=ki(_)}return R.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};ws.displayName="ConnectionLine";const ig={};function Pr(e=ig){D.useRef(e),oe(),D.useEffect(()=>{},[e])}function sg(){oe(),D.useRef(!1),D.useEffect(()=>{},[])}function vs({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:l,onSelectionContextMenu:f,onSelectionStart:d,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:_,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:C,selectionOnDrag:p,selectionMode:v,multiSelectionKeyCode:A,panActivationKeyCode:S,zoomActivationKeyCode:b,deleteKeyCode:T,onlyRenderVisibleElements:k,elementsSelectable:F,defaultViewport:z,translateExtent:V,minZoom:O,maxZoom:x,preventScrolling:M,defaultMarkerColor:N,zoomOnScroll:I,zoomOnPinch:$,panOnScroll:P,panOnScrollSpeed:j,panOnScrollMode:m,zoomOnDoubleClick:E,panOnDrag:B,autoPanOnSelection:L,onPaneClick:Y,onPaneMouseEnter:W,onPaneMouseMove:Z,onPaneMouseLeave:H,onPaneScroll:X,onPaneContextMenu:J,paneClickDistance:Q,nodeClickDistance:q,onEdgeContextMenu:U,onEdgeMouseEnter:ee,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:ce,onReconnect:Ce,onReconnectStart:we,onReconnectEnd:ve,noDragClassName:Ne,noWheelClassName:it,noPanClassName:He,disableKeyboardA11y:ze,nodeExtent:de,rfId:Me,viewport:Ae,onViewportChange:Oe,nodesDraggable:gn}){return Pr(e),Pr(t),sg(),Kh(n),Jh(Ae),R.jsx(Eh,{onPaneClick:Y,onPaneMouseEnter:W,onPaneMouseMove:Z,onPaneMouseLeave:H,onPaneContextMenu:J,onPaneScroll:X,paneClickDistance:Q,deleteKeyCode:T,selectionKeyCode:C,selectionOnDrag:p,selectionMode:v,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:A,panActivationKeyCode:S,zoomActivationKeyCode:b,elementsSelectable:F,zoomOnScroll:I,zoomOnPinch:$,zoomOnDoubleClick:E,panOnScroll:P,panOnScrollSpeed:j,panOnScrollMode:m,panOnDrag:B,autoPanOnSelection:L,defaultViewport:z,translateExtent:V,minZoom:O,maxZoom:x,onSelectionContextMenu:f,preventScrolling:M,noDragClassName:Ne,noWheelClassName:it,noPanClassName:He,disableKeyboardA11y:ze,onViewportChange:Oe,isControlledViewport:!!Ae,children:R.jsxs(Uh,{children:[R.jsx(Gh,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:Ce,onReconnectStart:we,onReconnectEnd:ve,onlyRenderVisibleElements:k,onEdgeContextMenu:U,onEdgeMouseEnter:ee,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:ce,defaultMarkerColor:N,noPanClassName:He,disableKeyboardA11y:ze,rfId:Me}),R.jsx(rg,{style:_,type:g,component:w,containerStyle:y}),R.jsx("div",{className:"react-flow__edgelabel-renderer"}),R.jsx(kh,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:l,nodeClickDistance:q,onlyRenderVisibleElements:k,noPanClassName:He,noDragClassName:Ne,disableKeyboardA11y:ze,nodeExtent:de,rfId:Me,nodesDraggable:gn}),R.jsx("div",{className:"react-flow__viewport-portal"})]})})}vs.displayName="GraphView";const ag=D.memo(vs),cg=Ei(),$r=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:u=.5,maxZoom:c=2,nodeOrigin:l,nodeExtent:f,zIndexMode:d="basic"}={})=>{const h=new Map,g=new Map,_=new Map,w=new Map,y=o??t??[],C=n??e??[],p=l??[0,0],v=f??yt;$i(_,w,y);const{nodesInitialized:A}=Yn(C,h,g,{nodeOrigin:p,nodeExtent:v,zIndexMode:d});let S=[0,0,1];if(s&&r&&i){const b=Ct(h,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:T,y:k,zoom:F}=oo(b,r,i,u,c,a?.padding??.1);S=[T,k,F]}return{rfId:"1",width:r??0,height:i??0,transform:S,nodes:C,nodesInitialized:A,nodeLookup:h,parentLookup:g,edges:y,edgeLookup:w,connectionLookup:_,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:u,maxZoom:c,translateExtent:yt,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:tt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:p,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...pi},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:cg,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:gi,zIndexMode:d,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},ug=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:l,nodeExtent:f,zIndexMode:d})=>_d((h,g)=>{async function _(){const{nodeLookup:w,panZoom:y,fitViewOptions:C,fitViewResolver:p,width:v,height:A,minZoom:S,maxZoom:b}=g();y&&(await yf({nodes:w,width:v,height:A,panZoom:y,minZoom:S,maxZoom:b},C),p?.resolve(!0),h({fitViewResolver:null}))}return{...$r({nodes:e,edges:t,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:l,nodeExtent:f,defaultNodes:n,defaultEdges:o,zIndexMode:d}),setNodes:w=>{const{nodeLookup:y,parentLookup:C,nodeOrigin:p,elevateNodesOnSelect:v,fitViewQueued:A,zIndexMode:S,nodesSelectionActive:b}=g(),{nodesInitialized:T,hasSelectedNodes:k}=Yn(w,y,C,{nodeOrigin:p,nodeExtent:f,elevateNodesOnSelect:v,checkEquality:!0,zIndexMode:S}),F=b&&k;A&&T?(_(),h({nodes:w,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:F})):h({nodes:w,nodesInitialized:T,nodesSelectionActive:F})},setEdges:w=>{const{connectionLookup:y,edgeLookup:C}=g();$i(y,C,w),h({edges:w})},setDefaultNodesAndEdges:(w,y)=>{if(w){const{setNodes:C}=g();C(w),h({hasDefaultNodes:!0})}if(y){const{setEdges:C}=g();C(y),h({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:y,nodeLookup:C,parentLookup:p,domNode:v,nodeOrigin:A,nodeExtent:S,debug:b,fitViewQueued:T,zIndexMode:k}=g(),{changes:F,updatedInternals:z}=Bf(w,C,p,v,A,S,k);z&&(Hf(C,p,{nodeOrigin:A,nodeExtent:S,zIndexMode:k}),T?(_(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),F?.length>0&&(b&&console.log("React Flow: trigger node changes",F),y?.(F)))},updateNodePositions:(w,y=!1)=>{const C=[];let p=[];const{nodeLookup:v,triggerNodeChanges:A,connection:S,updateConnection:b,onNodesChangeMiddlewareMap:T}=g();for(const[k,F]of w){const z=v.get(k),V=!!(z?.expandParent&&z?.parentId&&F?.position),O={id:k,type:"position",position:V?{x:Math.max(0,F.position.x),y:Math.max(0,F.position.y)}:F.position,dragging:y};if(z&&S.inProgress&&S.fromNode.id===z.id){const x=We(z,S.fromHandle,G.Left,!0);b({...S,from:x})}V&&z.parentId&&C.push({id:k,parentId:z.parentId,rect:{...F.internals.positionAbsolute,width:F.measured.width??0,height:F.measured.height??0}}),p.push(O)}if(C.length>0){const{parentLookup:k,nodeOrigin:F}=g(),z=uo(C,v,k,F);p.push(...z)}for(const k of T.values())p=k(p);A(p)},triggerNodeChanges:w=>{const{onNodesChange:y,setNodes:C,nodes:p,hasDefaultNodes:v,debug:A}=g();if(w?.length){if(v){const S=jd(w,p);C(S)}A&&console.log("React Flow: trigger node changes",w),y?.(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:y,setEdges:C,edges:p,hasDefaultEdges:v,debug:A}=g();if(w?.length){if(v){const S=Fd(w,p);C(S)}A&&console.log("React Flow: trigger edge changes",w),y?.(w)}},addSelectedNodes:w=>{const{multiSelectionActive:y,edgeLookup:C,nodeLookup:p,triggerNodeChanges:v,triggerEdgeChanges:A}=g();if(y){const S=w.map(b=>Le(b,!0));v(S);return}v(Ue(p,new Set([...w]),!0)),A(Ue(C))},addSelectedEdges:w=>{const{multiSelectionActive:y,edgeLookup:C,nodeLookup:p,triggerNodeChanges:v,triggerEdgeChanges:A}=g();if(y){const S=w.map(b=>Le(b,!0));A(S);return}A(Ue(C,new Set([...w]))),v(Ue(p,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:y}={})=>{const{edges:C,nodes:p,nodeLookup:v,triggerNodeChanges:A,triggerEdgeChanges:S}=g(),b=w||p,T=y||C,k=[];for(const z of b){if(!z.selected)continue;const V=v.get(z.id);V&&(V.selected=!1),k.push(Le(z.id,!1))}const F=[];for(const z of T)z.selected&&F.push(Le(z.id,!1));A(k),S(F)},setMinZoom:w=>{const{panZoom:y,maxZoom:C}=g();y?.setScaleExtent([w,C]),h({minZoom:w})},setMaxZoom:w=>{const{panZoom:y,minZoom:C}=g();y?.setScaleExtent([C,w]),h({maxZoom:w})},setTranslateExtent:w=>{g().panZoom?.setTranslateExtent(w),h({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:y,triggerNodeChanges:C,triggerEdgeChanges:p,elementsSelectable:v}=g();if(!v)return;const A=y.reduce((b,T)=>T.selected?[...b,Le(T.id,!1)]:b,[]),S=w.reduce((b,T)=>T.selected?[...b,Le(T.id,!1)]:b,[]);C(A),p(S)},setNodeExtent:w=>{const{nodes:y,nodeLookup:C,parentLookup:p,nodeOrigin:v,elevateNodesOnSelect:A,nodeExtent:S,zIndexMode:b}=g();w[0][0]===S[0][0]&&w[0][1]===S[0][1]&&w[1][0]===S[1][0]&&w[1][1]===S[1][1]||(Yn(y,C,p,{nodeOrigin:v,nodeExtent:w,elevateNodesOnSelect:A,checkEquality:!1,zIndexMode:b}),h({nodeExtent:w}))},panBy:w=>{const{transform:y,width:C,height:p,panZoom:v,translateExtent:A}=g();return Vf({delta:w,panZoom:v,transform:y,translateExtent:A,width:C,height:p})},setCenter:async(w,y,C)=>{const{width:p,height:v,maxZoom:A,panZoom:S}=g();if(!S)return!1;const b=typeof C?.zoom<"u"?C.zoom:A;return await S.setViewport({x:p/2-w*b,y:v/2-y*b,zoom:b},{duration:C?.duration,ease:C?.ease,interpolate:C?.interpolate}),!0},cancelConnection:()=>{h({connection:{...pi}})},updateConnection:w=>{h({connection:w})},reset:()=>h({...$r()})}},Object.is);function lg({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:u,fitView:c,nodeOrigin:l,nodeExtent:f,zIndexMode:d,children:h}){const[g]=D.useState(()=>ug({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:c,minZoom:s,maxZoom:a,fitViewOptions:u,nodeOrigin:l,nodeExtent:f,zIndexMode:d}));return R.jsx(Ed,{value:g,children:R.jsx(qd,{children:R.jsx(uh,{children:h})})})}function fg({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:u,minZoom:c,maxZoom:l,nodeOrigin:f,nodeExtent:d,zIndexMode:h}){return D.useContext(ln)?R.jsx(R.Fragment,{children:e}):R.jsx(lg,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:u,initialMinZoom:c,initialMaxZoom:l,nodeOrigin:f,nodeExtent:d,zIndexMode:h,children:e})}const dg={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function hg({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:u,onInit:c,onMove:l,onMoveStart:f,onMoveEnd:d,onConnect:h,onConnectStart:g,onConnectEnd:_,onClickConnectStart:w,onClickConnectEnd:y,onNodeMouseEnter:C,onNodeMouseMove:p,onNodeMouseLeave:v,onNodeContextMenu:A,onNodeDoubleClick:S,onNodeDragStart:b,onNodeDrag:T,onNodeDragStop:k,onNodesDelete:F,onEdgesDelete:z,onDelete:V,onSelectionChange:O,onSelectionDragStart:x,onSelectionDrag:M,onSelectionDragStop:N,onSelectionContextMenu:I,onSelectionStart:$,onSelectionEnd:P,onBeforeDelete:j,connectionMode:m,connectionLineType:E=$e.Bezier,connectionLineStyle:B,connectionLineComponent:L,connectionLineContainerStyle:Y,deleteKeyCode:W="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:H=!1,selectionMode:X=xt.Full,panActivationKeyCode:J="Space",multiSelectionKeyCode:Q=vt()?"Meta":"Control",zoomActivationKeyCode:q=vt()?"Meta":"Control",snapToGrid:U,snapGrid:ee,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:re,nodesDraggable:ce,autoPanOnNodeFocus:Ce,nodesConnectable:we,nodesFocusable:ve,nodeOrigin:Ne=Wi,edgesFocusable:it,edgesReconnectable:He,elementsSelectable:ze=!0,defaultViewport:de=Dd,minZoom:Me=.5,maxZoom:Ae=2,translateExtent:Oe=yt,preventScrolling:gn=!0,nodeExtent:pn,defaultMarkerColor:Ss="#b1b1b7",zoomOnScroll:Cs=!0,zoomOnPinch:Ns=!0,panOnScroll:Ms=!1,panOnScrollSpeed:As=.5,panOnScrollMode:Is=je.Free,zoomOnDoubleClick:Ts=!0,panOnDrag:ks=!0,onPaneClick:Rs,onPaneMouseEnter:Ps,onPaneMouseMove:$s,onPaneMouseLeave:Ds,onPaneScroll:Hs,onPaneContextMenu:zs,paneClickDistance:Os=1,nodeClickDistance:Ls=0,children:Bs,onReconnect:Vs,onReconnectStart:js,onReconnectEnd:Fs,onEdgeContextMenu:Ys,onEdgeDoubleClick:Xs,onEdgeMouseEnter:Zs,onEdgeMouseMove:Ws,onEdgeMouseLeave:qs,reconnectRadius:Gs=10,onNodesChange:Us,onEdgesChange:Ks,noDragClassName:Qs="nodrag",noWheelClassName:Js="nowheel",noPanClassName:ho="nopan",fitView:go,fitViewOptions:po,connectOnClick:ea,attributionPosition:ta,proOptions:na,defaultEdgeOptions:oa,elevateNodesOnSelect:ra=!0,elevateEdgesOnSelect:ia=!1,disableKeyboardA11y:mo=!1,autoPanOnConnect:sa,autoPanOnNodeDrag:aa,autoPanOnSelection:ca=!0,autoPanSpeed:ua,connectionRadius:la,isValidConnection:fa,onError:da,style:ha,id:yo,nodeDragThreshold:ga,connectionDragThreshold:pa,viewport:ma,onViewportChange:ya,width:xa,height:wa,colorMode:va="light",debug:_a,onScroll:xo,ariaLabelConfig:Ea,zIndexMode:wo="basic",...ba},Sa){const mn=yo||"1",Ca=Ld(va),Na=D.useCallback(vo=>{vo.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),xo?.(vo)},[xo]);return R.jsx("div",{"data-testid":"rf__wrapper",...ba,onScroll:Na,style:{...ha,...dg},ref:Sa,className:se(["react-flow",r,Ca]),id:yo,role:"application",children:R.jsxs(fg,{nodes:e,edges:t,width:xa,height:wa,fitView:go,fitViewOptions:po,minZoom:Me,maxZoom:Ae,nodeOrigin:Ne,nodeExtent:pn,zIndexMode:wo,children:[R.jsx(Od,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:h,onConnectStart:g,onConnectEnd:_,onClickConnectStart:w,onClickConnectEnd:y,nodesDraggable:ce,autoPanOnNodeFocus:Ce,nodesConnectable:we,nodesFocusable:ve,edgesFocusable:it,edgesReconnectable:He,elementsSelectable:ze,elevateNodesOnSelect:ra,elevateEdgesOnSelect:ia,minZoom:Me,maxZoom:Ae,nodeExtent:pn,onNodesChange:Us,onEdgesChange:Ks,snapToGrid:U,snapGrid:ee,connectionMode:m,translateExtent:Oe,connectOnClick:ea,defaultEdgeOptions:oa,fitView:go,fitViewOptions:po,onNodesDelete:F,onEdgesDelete:z,onDelete:V,onNodeDragStart:b,onNodeDrag:T,onNodeDragStop:k,onSelectionDrag:M,onSelectionDragStart:x,onSelectionDragStop:N,onMove:l,onMoveStart:f,onMoveEnd:d,noPanClassName:ho,nodeOrigin:Ne,rfId:mn,autoPanOnConnect:sa,autoPanOnNodeDrag:aa,autoPanSpeed:ua,onError:da,connectionRadius:la,isValidConnection:fa,selectNodesOnDrag:re,nodeDragThreshold:ga,connectionDragThreshold:pa,onBeforeDelete:j,debug:_a,ariaLabelConfig:Ea,zIndexMode:wo}),R.jsx(ag,{onInit:c,onNodeClick:a,onEdgeClick:u,onNodeMouseEnter:C,onNodeMouseMove:p,onNodeMouseLeave:v,onNodeContextMenu:A,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:s,connectionLineType:E,connectionLineStyle:B,connectionLineComponent:L,connectionLineContainerStyle:Y,selectionKeyCode:Z,selectionOnDrag:H,selectionMode:X,deleteKeyCode:W,multiSelectionKeyCode:Q,panActivationKeyCode:J,zoomActivationKeyCode:q,onlyRenderVisibleElements:ne,defaultViewport:de,translateExtent:Oe,minZoom:Me,maxZoom:Ae,preventScrolling:gn,zoomOnScroll:Cs,zoomOnPinch:Ns,zoomOnDoubleClick:Ts,panOnScroll:Ms,panOnScrollSpeed:As,panOnScrollMode:Is,panOnDrag:ks,autoPanOnSelection:ca,onPaneClick:Rs,onPaneMouseEnter:Ps,onPaneMouseMove:$s,onPaneMouseLeave:Ds,onPaneScroll:Hs,onPaneContextMenu:zs,paneClickDistance:Os,nodeClickDistance:Ls,onSelectionContextMenu:I,onSelectionStart:$,onSelectionEnd:P,onReconnect:Vs,onReconnectStart:js,onReconnectEnd:Fs,onEdgeContextMenu:Ys,onEdgeDoubleClick:Xs,onEdgeMouseEnter:Zs,onEdgeMouseMove:Ws,onEdgeMouseLeave:qs,reconnectRadius:Gs,defaultMarkerColor:Ss,noDragClassName:Qs,noWheelClassName:Js,noPanClassName:ho,rfId:mn,disableKeyboardA11y:mo,nodeExtent:pn,viewport:ma,onViewportChange:ya,nodesDraggable:ce}),R.jsx($d,{onSelectionChange:O}),Bs,R.jsx(Id,{proOptions:na,position:ta}),R.jsx(Ad,{rfId:mn,disableKeyboardA11y:mo})]})})}var Vg=Gi(hg);function gg({dimensions:e,lineWidth:t,variant:n,className:o}){return R.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:se(["react-flow__background-pattern",n,o])})}function pg({radius:e,className:t}){return R.jsx("circle",{cx:e,cy:e,r:e,className:se(["react-flow__background-pattern","dots",t])})}var De;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(De||(De={}));const mg={[De.Dots]:1,[De.Lines]:1,[De.Cross]:6},yg=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function _s({id:e,variant:t=De.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:s,bgColor:a,style:u,className:c,patternClassName:l}){const f=D.useRef(null),{transform:d,patternId:h}=te(yg,ie),g=o||mg[t],_=t===De.Dots,w=t===De.Cross,y=Array.isArray(n)?n:[n,n],C=[y[0]*d[2]||1,y[1]*d[2]||1],p=g*d[2],v=Array.isArray(i)?i:[i,i],A=w?[p,p]:C,S=[v[0]*d[2]||1+A[0]/2,v[1]*d[2]||1+A[1]/2],b=`${h}${e||""}`;return R.jsxs("svg",{className:se(["react-flow__background",c]),style:{...u,...dn,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:f,"data-testid":"rf__background",children:[R.jsx("pattern",{id:b,x:d[0]%C[0],y:d[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:_?R.jsx(pg,{radius:p/2,className:l}):R.jsx(gg,{dimensions:A,lineWidth:r,variant:t,className:l})}),R.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${b})`})]})}_s.displayName="Background";const jg=D.memo(_s);function xg(){return R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:R.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function wg(){return R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:R.jsx("path",{d:"M0 0h32v4.2H0z"})})}function vg(){return R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:R.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function _g(){return R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:R.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Eg(){return R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:R.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Ht({children:e,className:t,...n}){return R.jsx("button",{type:"button",className:se(["react-flow__controls-button",t]),...n,children:e})}const bg=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Es({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:u,className:c,children:l,position:f="bottom-left",orientation:d="vertical","aria-label":h}){const g=oe(),{isInteractive:_,minZoomReached:w,maxZoomReached:y,ariaLabelConfig:C}=te(bg,ie),{zoomIn:p,zoomOut:v,fitView:A}=lo(),S=()=>{p(),i?.()},b=()=>{v(),s?.()},T=()=>{A(r),a?.()},k=()=>{g.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),u?.(!_)},F=d==="horizontal"?"horizontal":"vertical";return R.jsxs(fn,{className:se(["react-flow__controls",F,c]),position:f,style:e,"data-testid":"rf__controls","aria-label":h??C["controls.ariaLabel"],children:[t&&R.jsxs(R.Fragment,{children:[R.jsx(Ht,{onClick:S,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:y,children:R.jsx(xg,{})}),R.jsx(Ht,{onClick:b,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:w,children:R.jsx(wg,{})})]}),n&&R.jsx(Ht,{className:"react-flow__controls-fitview",onClick:T,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:R.jsx(vg,{})}),o&&R.jsx(Ht,{className:"react-flow__controls-interactive",onClick:k,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:_?R.jsx(Eg,{}):R.jsx(_g,{})}),l]})}Es.displayName="Controls";const Fg=D.memo(Es);function Sg({id:e,x:t,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:u,className:c,borderRadius:l,shapeRendering:f,selected:d,onClick:h}){const{background:g,backgroundColor:_}=i||{},w=s||g||_;return R.jsx("rect",{className:se(["react-flow__minimap-node",{selected:d},c]),x:t,y:n,rx:l,ry:l,width:o,height:r,style:{fill:w,stroke:a,strokeWidth:u},shapeRendering:f,onClick:h?y=>h(y,e):void 0})}const Cg=D.memo(Sg),Ng=e=>e.nodes.map(t=>t.id),Rn=e=>e instanceof Function?e:()=>e;function Mg({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=Cg,onClick:s}){const a=te(Ng,ie),u=Rn(t),c=Rn(e),l=Rn(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return R.jsx(R.Fragment,{children:a.map(d=>R.jsx(Ig,{id:d,nodeColorFunc:u,nodeStrokeColorFunc:c,nodeClassNameFunc:l,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:s,shapeRendering:f},d))})}function Ag({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:u}){const{node:c,x:l,y:f,width:d,height:h}=te(g=>{const _=g.nodeLookup.get(e);if(!_)return{node:void 0,x:0,y:0,width:0,height:0};const w=_.internals.userNode,{x:y,y:C}=_.internals.positionAbsolute,{width:p,height:v}=Se(w);return{node:w,x:y,y:C,width:p,height:v}},ie);return!c||c.hidden||!bi(c)?null:R.jsx(a,{x:l,y:f,width:d,height:h,style:c.style,selected:!!c.selected,className:o(c),color:t(c),borderRadius:r,strokeColor:n(c),strokeWidth:i,shapeRendering:s,onClick:u,id:c.id})}const Ig=D.memo(Ag);var Tg=D.memo(Mg);const kg=200,Rg=150,Pg=e=>!e.hidden,$g=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?vi(Ct(e.nodeLookup,{filter:Pg}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Dr=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Dg=(e,t)=>Dr(e.viewBB,t.viewBB)&&Dr(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,Hg="react-flow__minimap-desc";function bs({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:u,maskColor:c,maskStrokeColor:l,maskStrokeWidth:f,position:d="bottom-right",onClick:h,onNodeClick:g,pannable:_=!1,zoomable:w=!1,ariaLabel:y,inversePan:C,zoomStep:p=1,offsetScale:v=5}){const A=oe(),S=D.useRef(null),{boundingRect:b,viewBB:T,rfId:k,panZoom:F,translateExtent:z,flowWidth:V,flowHeight:O,ariaLabelConfig:x}=te($g,Dg),M=e?.width??kg,N=e?.height??Rg,I=b.width/M,$=b.height/N,P=Math.max(I,$),j=P*M,m=P*N,E=v*P,B=b.x-(j-b.width)/2-E,L=b.y-(m-b.height)/2-E,Y=j+E*2,W=m+E*2,Z=`${Hg}-${k}`,H=D.useRef(0),X=D.useRef();H.current=P,D.useEffect(()=>{if(S.current&&F)return X.current=Uf({domNode:S.current,panZoom:F,getTransform:()=>A.getState().transform,getViewScale:()=>H.current}),()=>{X.current?.destroy()}},[F]),D.useEffect(()=>{X.current?.update({translateExtent:z,width:V,height:O,inversePan:C,pannable:_,zoomStep:p,zoomable:w})},[_,w,C,p,z,V,O]);const J=h?U=>{const[ee,ne]=X.current?.pointer(U)||[0,0];h(U,{x:ee,y:ne})}:void 0,Q=g?D.useCallback((U,ee)=>{const ne=A.getState().nodeLookup.get(ee).internals.userNode;g(U,ne)},[]):void 0,q=y??x["minimap.ariaLabel"];return R.jsx(fn,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*P:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:se(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:R.jsxs("svg",{width:M,height:N,viewBox:`${B} ${L} ${Y} ${W}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Z,ref:S,onClick:J,children:[q&&R.jsx("title",{id:Z,children:q}),R.jsx(Tg,{onClick:Q,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),R.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-E},${L-E}h${Y+E*2}v${W+E*2}h${-Y-E*2}z + M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}bs.displayName="MiniMap";D.memo(bs);const zg=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Og={[rt.Line]:"right",[rt.Handle]:"bottom-right"};function Lg({nodeId:e,position:t,variant:n=rt.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:u=10,maxWidth:c=Number.MAX_VALUE,maxHeight:l=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:d,autoScale:h=!0,shouldResize:g,onResizeStart:_,onResize:w,onResizeEnd:y}){const C=es(),p=typeof e=="string"?e:C,v=oe(),A=D.useRef(null),S=n===rt.Handle,b=te(D.useCallback(zg(S&&h),[S,h]),ie),T=D.useRef(null),k=t??Og[n];D.useEffect(()=>{if(!(!A.current||!p))return T.current||(T.current=ud({domNode:A.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:z,transform:V,snapGrid:O,snapToGrid:x,nodeOrigin:M,domNode:N}=v.getState();return{nodeLookup:z,transform:V,snapGrid:O,snapToGrid:x,nodeOrigin:M,paneDomNode:N}},onChange:(z,V)=>{const{triggerNodeChanges:O,nodeLookup:x,parentLookup:M,nodeOrigin:N}=v.getState(),I=[],$={x:z.x,y:z.y},P=x.get(p);if(P&&P.expandParent&&P.parentId){const j=P.origin??N,m=z.width??P.measured.width??0,E=z.height??P.measured.height??0,B={id:P.id,parentId:P.parentId,rect:{width:m,height:E,...Si({x:z.x??P.position.x,y:z.y??P.position.y},{width:m,height:E},P.parentId,x,j)}},L=uo([B],x,M,N);I.push(...L),$.x=z.x?Math.max(j[0]*m,z.x):void 0,$.y=z.y?Math.max(j[1]*E,z.y):void 0}if($.x!==void 0&&$.y!==void 0){const j={id:p,type:"position",position:{...$}};I.push(j)}if(z.width!==void 0&&z.height!==void 0){const m={id:p,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};I.push(m)}for(const j of V){const m={...j,type:"position"};I.push(m)}O(I)},onEnd:({width:z,height:V})=>{const O={id:p,type:"dimensions",resizing:!1,dimensions:{width:z,height:V}};v.getState().triggerNodeChanges([O])}})),T.current.update({controlPosition:k,boundaries:{minWidth:a,minHeight:u,maxWidth:c,maxHeight:l},keepAspectRatio:f,resizeDirection:d,onResizeStart:_,onResize:w,onResizeEnd:y,shouldResize:g}),()=>{T.current?.destroy()}},[k,a,u,c,l,f,_,w,y,g]);const F=k.split("-");return R.jsx("div",{className:se(["react-flow__resize-control","nodrag",...F,n,o]),ref:A,style:{...r,scale:b,...s&&{[S?"backgroundColor":"borderColor"]:s}},children:i})}D.memo(Lg);export{jg as B,Fg as C,Qt as H,Gt as M,G as P,Ra as a,D as b,Bg as c,Vg as i,R as j,en as r}; diff --git a/src/runtime/operator/web_assets/assets/index-BADaCtIl.css b/src/runtime/operator/web_assets/assets/index-BADaCtIl.css new file mode 100644 index 0000000..9f2fccb --- /dev/null +++ b/src/runtime/operator/web_assets/assets/index-BADaCtIl.css @@ -0,0 +1 @@ +.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}:root{color:#dce4df;background:#0d1011;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;font-synthesis:none;--panel: #131718;--panel-raised: #181d1e;--line: rgba(217, 232, 224, .1);--muted: #87918d;--acid: #d9ed72;--mint: #79dab7;--amber: #f0bd68;--red: #f18378}*{box-sizing:border-box}html,body,#root{width:100%;height:100%;margin:0;overflow:hidden}button,input{font:inherit}button{color:inherit}code,pre,.eyebrow,small{font-family:DM Mono,monospace}.app-shell{height:100%;display:grid;grid-template-rows:58px auto 1fr}.topbar{display:grid;grid-template-columns:260px 1fr auto;align-items:center;padding:0 20px;border-bottom:1px solid var(--line);background:#101314;z-index:10}.brand{display:flex;align-items:center;gap:11px}.brand-mark{width:30px;height:30px;display:grid;place-items:center;color:#101314;background:var(--acid);font-weight:800;clip-path:polygon(50% 0,100% 100%,0 100%);padding-top:8px}.brand div{display:flex;align-items:baseline;gap:7px}.brand strong{font-size:15px;letter-spacing:-.02em}.brand span:last-child{color:var(--muted);font:11px DM Mono;text-transform:uppercase}.breadcrumb{display:flex;justify-content:center;gap:9px;color:var(--muted);font-size:12px}.breadcrumb i{opacity:.4}.breadcrumb strong{color:#cfd8d3;font-weight:500}.connection{display:flex;align-items:center;gap:8px;font:11px DM Mono;text-transform:capitalize}.connection>span{width:7px;height:7px;border-radius:50%;background:var(--amber);box-shadow:0 0 10px var(--amber)}.connection-live>span{background:var(--mint);box-shadow:0 0 10px var(--mint)}.connection small{color:#59615e;margin-left:5px}.connection-error,.action-error,.error-banner{background:#4c2525;color:#ffd4cf;padding:8px 18px;font-size:12px;border-bottom:1px solid #813c37}.workspace{min-height:0;display:grid;grid-template-columns:280px minmax(0,1fr)}.workspace.with-inspector{grid-template-columns:280px minmax(0,1fr) 410px}.explorer{background:var(--panel);border-right:1px solid var(--line);overflow:auto;min-width:0}.explorer>header{padding:22px 18px 14px;position:relative}.eyebrow{display:block;color:var(--acid);font-size:9px;letter-spacing:.16em;text-transform:uppercase}h1,h2,h3,p{margin-top:0}.explorer h2{margin:5px 0 0;font-size:17px}.catalog-revision{position:absolute;right:18px;bottom:17px;color:#67706c;font:9px DM Mono}.target-list{padding:4px 10px 30px}.target{border-top:1px solid var(--line);padding-top:7px;margin-top:4px}.target-heading,.tree-row,.tree-select,.run-select{width:100%;min-width:0}.target-heading,.tree-select,.run-select,.tree-disclosure{background:none;border:0;cursor:pointer;text-align:left}.target-heading{display:grid;grid-template-columns:12px 22px minmax(0,1fr);gap:5px;align-items:center;padding:8px 5px}.target-heading>span:first-child{color:#5e6763}.target-kind{width:20px;height:20px;border:1px solid #49524e;border-radius:3px;display:grid;place-items:center;font:9px DM Mono;color:#a8b1ad}.target-heading strong,.target-heading small,.tree-select strong,.tree-select small,.run-select strong,.run-select small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.target-heading strong{font-size:11px;font-weight:600}.target-heading small{color:#5f6965;font-size:8px;margin-top:2px}.workflow-list{border-left:1px solid #303637;margin-left:16px;padding-left:7px}.tree-row{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:stretch}.tree-disclosure{color:#5f6865;text-align:center;padding:0}.tree-select{display:grid;grid-template-columns:23px minmax(0,1fr);gap:4px;padding:8px;border-radius:4px}.tree-select:hover,.run-select:hover,.tree-select.active,.run-select.active{background:#202627}.tree-select.active{box-shadow:inset 2px 0 var(--acid)}.workflow-glyph{color:var(--acid);font-size:16px}.tree-select strong{font-size:11px;font-weight:600}.tree-select small,.run-select small{color:#68716e;font-size:8px;margin-top:3px}.run-branches{margin-left:28px;border-left:1px dashed #303637;padding:3px 0 6px 8px}.run-select{display:grid;grid-template-columns:20px minmax(0,1fr);gap:5px;align-items:center;padding:7px;border-radius:4px}.run-select strong{font:9px DM Mono}.run-dot{width:16px;height:16px;border-radius:50%;display:grid;place-items:center;font:9px DM Mono;background:#252c2a;color:var(--muted)}.run-dot.status-success{color:var(--mint)}.run-dot.status-failed{color:var(--red)}.run-dot.status-running{color:var(--acid)}.no-runs{display:block;color:#525a57;padding:7px;font:8px DM Mono}.diagnostics{margin:0 12px 12px;padding:9px;background:#34291c;border:1px solid #5d472b;border-radius:4px;font-size:10px}.diagnostics summary{color:var(--amber);cursor:pointer}.diagnostics div{margin-top:9px;border-top:1px solid #5d472b;padding-top:8px}.diagnostics strong,.diagnostics span{display:block}.diagnostics span{color:#ac9473;font:8px DM Mono;overflow:hidden;text-overflow:ellipsis}.diagnostics p{color:#d4bd9b;margin:4px 0 0}.skeleton{padding:20px}.skeleton div{height:38px;background:#1b2021;margin-bottom:9px;animation:pulse 1.2s infinite alternate}@keyframes pulse{to{opacity:.45}}.canvas-shell{min-width:0;min-height:0;display:grid;grid-template-rows:auto 1fr;background:#0f1213}.view-header{min-height:92px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 24px;border-bottom:1px solid var(--line)}.view-header h1{margin:4px 0 2px;font-size:22px;letter-spacing:-.035em}.view-header p{margin:0;color:var(--muted);font-size:11px}.canvas{position:relative;min-height:0}.blueprint-canvas{background:radial-gradient(circle at 55% 35%,rgba(72,97,86,.14),transparent 45%),#0f1213}.run-canvas{background:radial-gradient(circle at 55% 35%,rgba(89,76,62,.13),transparent 45%),#111313}.react-flow__controls{background:#1b2021;border:1px solid var(--line);box-shadow:none}.react-flow__controls-button{background:#1b2021;border-bottom-color:var(--line);fill:#aeb8b3}.react-flow__controls-button:hover{background:#272e2f}.react-flow__edge-path{stroke:#66736d;stroke-width:1.4}.react-flow__arrowhead polyline{stroke:#66736d;fill:#66736d}.node-card{width:248px;min-height:102px;position:relative;display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:15px;text-align:left;background:#171c1d;border:1px solid #47514d;border-radius:6px;box-shadow:0 14px 30px #00000040;cursor:pointer}.node-card:hover{border-color:var(--acid);transform:translateY(-1px)}.node-card.blueprint{background:linear-gradient(145deg,#18201f,#15191a)}.node-card strong{font-size:13px}.node-kicker{color:#78827e;font:8px DM Mono;letter-spacing:.12em;text-transform:uppercase}.node-status{position:absolute;right:12px;top:12px;font:8px DM Mono;text-transform:uppercase;color:var(--muted)}.node-duration{color:var(--muted);font:9px DM Mono}.node-error{color:#ffaaa2;background:#762c2840;padding:5px;border-radius:3px;font-size:9px;max-height:42px;overflow:hidden}.node-card.status-success{border-color:#426b5c}.node-card.status-failed{border-color:#984d47}.node-card.status-running{border-color:#9aa64f;box-shadow:0 0 0 1px #d9ed721f,0 14px 30px #00000040}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:4px;border-top:1px solid var(--line);padding-top:8px}.field-grid>span{min-width:0}.field-grid small{display:block;color:#68726e;font-size:7px;text-transform:uppercase;margin-bottom:3px}.field{display:block;color:#b2bdb7;font:8px DM Mono;overflow:hidden;text-overflow:ellipsis}.react-flow__handle{width:7px;height:7px;background:var(--acid);border:1px solid #101314}.historical-badge{position:absolute;right:18px;bottom:18px;z-index:5;padding:9px 12px;background:#1a1815eb;border:1px solid #665642;color:#9d8f7c;font-size:9px;border-radius:4px}.historical-badge span{display:block;color:var(--amber);font:8px DM Mono;text-transform:uppercase;margin-bottom:3px}.empty-state{height:100%;display:grid;place-content:center;text-align:center;color:#66706c}.empty-state>span{color:var(--acid);font-size:40px}.empty-state h2{color:#c6cfca;margin:8px 0}.empty-state p{max-width:390px;font-size:12px}.inspector{min-width:0;background:var(--panel-raised);border-left:1px solid var(--line);overflow:hidden;display:grid;grid-template-rows:auto auto 1fr}.inspector>header{display:flex;justify-content:space-between;align-items:start;padding:19px 20px 14px;border-bottom:1px solid var(--line)}.inspector h2{margin:4px 0 5px;font-size:18px}.icon-button{width:30px;height:30px;background:none;border:1px solid var(--line);border-radius:4px;cursor:pointer;font-size:19px}.icon-button:hover{border-color:#69736f}.status-pill{display:inline-flex;padding:3px 7px;border:1px solid #48514e;border-radius:20px;color:var(--muted);font:8px DM Mono;text-transform:uppercase}.status-pill.status-failed{color:var(--red);border-color:#75413d}.status-pill.status-success{color:var(--mint);border-color:#355e50}.inspector-tabs{display:flex;overflow-x:auto;padding:0 10px;border-bottom:1px solid var(--line)}.inspector-tabs button{padding:11px 9px 9px;background:none;border:0;border-bottom:2px solid transparent;color:#727c77;font:8px DM Mono;text-transform:uppercase;cursor:pointer}.inspector-tabs button.active{color:var(--acid);border-bottom-color:var(--acid)}.inspector-body{overflow:auto;padding:18px 20px 30px}.inspector-body section{margin-bottom:23px}.inspector-body h3{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#a3ada8}.instructions{color:#c4cdc8;white-space:pre-wrap;font-size:12px;line-height:1.65}.signature-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px}.field-detail{border-top:1px solid var(--line);padding:8px 0}.field-detail strong,.field-detail code{display:block;font-size:10px}.field-detail code{color:#79837f;font-size:8px;margin-top:2px}.field-detail p{color:#78817d;font-size:9px;margin:4px 0 0}.json-block{padding:11px;background:#101415;border:1px solid var(--line);border-radius:4px;overflow:auto;color:#aab5af;font-size:9px;white-space:pre-wrap}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.metric-grid>div{background:#111516;border:1px solid var(--line);padding:10px}.metric-grid small,.metric-grid strong{display:block}.metric-grid small{color:#68716e;font-size:7px;text-transform:uppercase}.metric-grid strong{margin-top:5px;font-size:11px}.node-failure{padding:10px;background:#3a2020;border:1px solid #713d39;color:#ffc1ba;font-size:10px}.trace-header,.value-object{margin:0}.trace-header>div,.value-object>div{display:grid;grid-template-columns:105px minmax(0,1fr);gap:10px;border-top:1px solid var(--line);padding:7px 0}.trace-header dt,.value-object dt{color:#727c77;font:8px DM Mono}.trace-header dd,.value-object dd{margin:0;font-size:10px;min-width:0}.empty-copy{color:#69736e;font-size:11px}.trace-layout{display:grid;grid-template-rows:auto 220px auto;gap:12px}.trace-toolbar{display:flex;justify-content:space-between;align-items:center}.trace-toolbar h3{margin:0 0 3px}.trace-toolbar span{color:#69736e;font:8px DM Mono}.toggle{background:none;border:1px solid #48514d;color:#818b86;border-radius:20px;padding:5px 8px;font:8px DM Mono;cursor:pointer}.toggle.active{color:var(--acid);border-color:#77834a}.turn-list{height:220px;overflow:auto;border:1px solid var(--line);background:#111516}.turn-row{position:absolute;left:0;top:0;width:100%;height:60px;display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px;background:transparent;border:0;border-bottom:1px solid var(--line);text-align:left;cursor:pointer}.turn-row:hover,.turn-row.active{background:#202627}.turn-row.active{box-shadow:inset 2px 0 var(--acid)}.turn-row.failed{box-shadow:inset 2px 0 var(--red)}.turn-row strong{font-size:10px}.turn-row span,.turn-row small{color:#78817d;font:8px DM Mono}.turn-row small{grid-column:1 / -1}.turn-detail{border-top:1px solid var(--line);padding-top:12px}.value-object .value-object{border-left:1px solid #313837;padding-left:8px}.value-string{color:#c4d99d;white-space:pre-wrap;overflow-wrap:anywhere}.value-scalar{color:#82c8cc}.value-null{color:#68716e}.value-unavailable{color:var(--amber);font-size:9px}.value-list{margin:0;padding-left:20px}.value-list li{margin:5px 0}.file-value{display:flex;gap:9px;padding:9px;border:1px solid #5f6441;background:#22251a;border-radius:4px;color:var(--acid)}.file-value small,.file-value code{display:block}.file-value small{color:#919976;font-size:7px;text-transform:uppercase}.file-value code{margin-top:3px;font-size:9px;overflow-wrap:anywhere}.log-list{margin-bottom:12px}.log-list button{width:100%;display:grid;grid-template-columns:48px 1fr auto;gap:7px;padding:7px 4px;border:0;border-bottom:1px solid var(--line);background:none;color:#929c97;text-align:left;font:8px DM Mono;cursor:pointer}.log-list button:hover{background:#202627}.log-level{text-transform:uppercase}.level-error{color:var(--red)}.level-warning{color:var(--amber)}.run-controls{display:flex;align-items:center;gap:7px;position:relative}.run-button,.cancel-button,.input-toggle{border-radius:4px;padding:8px 13px;cursor:pointer;font-size:10px}.run-button{background:var(--acid);border:1px solid var(--acid);color:#111412;font-weight:700}.cancel-button{background:#3a2221;border:1px solid #71403c;color:#f2a39b}.input-toggle{background:transparent;border:1px solid #3c4541;color:#89938e}.input-toggle.active{color:var(--acid);border-color:#6e7848}.run-controls button:disabled{opacity:.5;cursor:wait}.input-popover{position:absolute;z-index:20;right:0;top:43px;width:390px;padding:13px;background:#15191a;border:1px solid #4a5450;box-shadow:0 18px 50px #00000080}.input-popover>div:first-child{display:flex;justify-content:space-between;margin-bottom:9px}.input-popover strong{font-size:11px}.input-popover span{color:#6d7672;font:8px DM Mono}.json-editor{border:1px solid var(--line);font-size:10px}.action-error{position:absolute;z-index:21;right:0;top:44px;width:390px;border:1px solid #813c37}.input-popover+.action-error{top:205px}@media(max-width:1000px){.workspace,.workspace.with-inspector{grid-template-columns:230px minmax(0,1fr)}.inspector{position:fixed;z-index:30;right:0;top:58px;bottom:0;width:min(420px,calc(100vw - 230px));box-shadow:-20px 0 50px #00000073}.topbar{grid-template-columns:210px 1fr auto}}@media(max-width:700px){.workspace,.workspace.with-inspector{grid-template-columns:1fr}.explorer,.breadcrumb{display:none}.topbar{grid-template-columns:1fr auto}.view-header{align-items:flex-start;padding:13px 16px}.inspector{width:100vw;top:58px}.input-popover,.action-error{width:calc(100vw - 32px)}} diff --git a/src/runtime/operator/web_assets/assets/index-BBkdXJIH.js b/src/runtime/operator/web_assets/assets/index-BBkdXJIH.js new file mode 100644 index 0000000..bb3534f --- /dev/null +++ b/src/runtime/operator/web_assets/assets/index-BBkdXJIH.js @@ -0,0 +1,9 @@ +import{r as Dm,a as xm,b as Z,j as v,H as Xd,P as Qd,M as _m,i as jm,B as Mm,C as Rm,c as wm}from"./graph-CoDTrhFP.js";import{S as Um,M as $,r as W,U as w,W as T,s as Oe,G as Bm}from"./protobuf-BR9ifi4u.js";import{E as Ii,a as qm,j as Cm,k as Lm}from"./editor-Dh6wG2B-.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const c of f)if(c.type==="childList")for(const p of c.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function i(f){const c={};return f.integrity&&(c.integrity=f.integrity),f.referrerPolicy&&(c.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?c.credentials="include":f.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(f){if(f.ep)return;f.ep=!0;const c=i(f);fetch(f.href,c)}})();var Sc={exports:{}},xa={},Tc={exports:{}},kc={};var Kd;function Hm(){return Kd||(Kd=1,(function(y){function a(O,U){var V=O.length;O.push(U);t:for(;0>>1,St=O[gt];if(0>>1;gtf(ft,V))Btf(De,ft)?(O[gt]=De,O[Bt]=V,gt=Bt):(O[gt]=ft,O[Et]=V,gt=Et);else if(Btf(De,V))O[gt]=De,O[Bt]=V,gt=Bt;else break t}}return U}function f(O,U){var V=O.sortIndex-U.sortIndex;return V!==0?V:O.id-U.id}if(y.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;y.unstable_now=function(){return c.now()}}else{var p=Date,d=p.now();y.unstable_now=function(){return p.now()-d}}var g=[],m=[],z=1,_=null,R=3,q=!1,H=!1,G=!1,lt=!1,Q=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function rt(O){for(var U=i(m);U!==null;){if(U.callback===null)o(m);else if(U.startTime<=O)o(m),U.sortIndex=U.expirationTime,a(g,U);else break;U=i(m)}}function it(O){if(G=!1,rt(O),!H)if(i(g)!==null)H=!0,wt||(wt=!0,Ut());else{var U=i(m);U!==null&&L(it,U.startTime-O)}}var wt=!1,ut=-1,bt=5,Kt=-1;function Lt(){return lt?!0:!(y.unstable_now()-KtO&&Lt());){var gt=_.callback;if(typeof gt=="function"){_.callback=null,R=_.priorityLevel;var St=gt(_.expirationTime<=O);if(O=y.unstable_now(),typeof St=="function"){_.callback=St,rt(O),U=!0;break e}_===i(g)&&o(g),rt(O)}else o(g);_=i(g)}if(_!==null)U=!0;else{var Jt=i(m);Jt!==null&&L(it,Jt.startTime-O),U=!1}}break t}finally{_=null,R=V,q=!1}U=void 0}}finally{U?Ut():wt=!1}}}var Ut;if(typeof I=="function")Ut=function(){I(Qt)};else if(typeof MessageChannel<"u"){var Zt=new MessageChannel,he=Zt.port2;Zt.port1.onmessage=Qt,Ut=function(){he.postMessage(null)}}else Ut=function(){Q(Qt,0)};function L(O,U){ut=Q(function(){O(y.unstable_now())},U)}y.unstable_IdlePriority=5,y.unstable_ImmediatePriority=1,y.unstable_LowPriority=4,y.unstable_NormalPriority=3,y.unstable_Profiling=null,y.unstable_UserBlockingPriority=2,y.unstable_cancelCallback=function(O){O.callback=null},y.unstable_forceFrameRate=function(O){0>O||125gt?(O.sortIndex=V,a(m,O),i(g)===null&&O===i(m)&&(G?(K(ut),ut=-1):G=!0,L(it,V-gt))):(O.sortIndex=St,a(g,O),H||q||(H=!0,wt||(wt=!0,Ut()))),O},y.unstable_shouldYield=Lt,y.unstable_wrapCallback=function(O){var U=R;return function(){var V=R;R=U;try{return O.apply(this,arguments)}finally{R=V}}}})(kc)),kc}var Zd;function Vm(){return Zd||(Zd=1,Tc.exports=Hm()),Tc.exports}var Jd;function Ym(){if(Jd)return xa;Jd=1;var y=Vm(),a=Dm(),i=xm();function o(t){var e="https://react.dev/errors/"+t;if(1St||(t.current=gt[St],gt[St]=null,St--)}function ft(t,e){St++,gt[St]=t.current,t.current=e}var Bt=Jt(null),De=Jt(null),Ie=Jt(null),Ma=Jt(null);function Ra(t,e){switch(ft(Ie,e),ft(De,t),ft(Bt,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?hd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=hd(e),t=gd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Et(Bt),ft(Bt,t)}function Kn(){Et(Bt),Et(De),Et(Ie)}function eu(t){t.memoizedState!==null&&ft(Ma,t);var e=Bt.current,n=gd(e,t.type);e!==n&&(ft(De,t),ft(Bt,n))}function wa(t){De.current===t&&(Et(Bt),Et(De)),Ma.current===t&&(Et(Ma),Aa._currentValue=V)}var nu,Vc;function Nn(t){if(nu===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);nu=e&&e[1]||"",Vc=-1)":-1u||b[l]!==A[u]){var x=` +`+b[l].replace(" at new "," at ");return t.displayName&&x.includes("")&&(x=x.replace("",t.displayName)),x}while(1<=l&&0<=u);break}}}finally{lu=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Nn(n):""}function ih(t,e){switch(t.tag){case 26:case 27:case 5:return Nn(t.type);case 16:return Nn("Lazy");case 13:return t.child!==e&&e!==null?Nn("Suspense Fallback"):Nn("Suspense");case 19:return Nn("SuspenseList");case 0:case 15:return au(t.type,!1);case 11:return au(t.type.render,!1);case 1:return au(t.type,!0);case 31:return Nn("Activity");default:return""}}function Yc(t){try{var e="",n=null;do e+=ih(t,n),n=t,t=t.return;while(t);return e}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}var iu=Object.prototype.hasOwnProperty,uu=y.unstable_scheduleCallback,su=y.unstable_cancelCallback,uh=y.unstable_shouldYield,sh=y.unstable_requestPaint,le=y.unstable_now,ch=y.unstable_getCurrentPriorityLevel,Gc=y.unstable_ImmediatePriority,Xc=y.unstable_UserBlockingPriority,Ua=y.unstable_NormalPriority,oh=y.unstable_LowPriority,Qc=y.unstable_IdlePriority,fh=y.log,rh=y.unstable_setDisableYieldValue,ql=null,ae=null;function Pe(t){if(typeof fh=="function"&&rh(t),ae&&typeof ae.setStrictMode=="function")try{ae.setStrictMode(ql,t)}catch{}}var ie=Math.clz32?Math.clz32:gh,dh=Math.log,hh=Math.LN2;function gh(t){return t>>>=0,t===0?32:31-(dh(t)/hh|0)|0}var Ba=256,qa=262144,Ca=4194304;function On(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function La(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var u=0,s=t.suspendedLanes,r=t.pingedLanes;t=t.warmLanes;var h=l&134217727;return h!==0?(l=h&~s,l!==0?u=On(l):(r&=h,r!==0?u=On(r):n||(n=h&~t,n!==0&&(u=On(n))))):(h=l&~s,h!==0?u=On(h):r!==0?u=On(r):n||(n=l&~t,n!==0&&(u=On(n)))),u===0?0:e!==0&&e!==u&&(e&s)===0&&(s=u&-u,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:u}function Cl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function mh(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Kc(){var t=Ca;return Ca<<=1,(Ca&62914560)===0&&(Ca=4194304),t}function cu(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ll(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function yh(t,e,n,l,u,s){var r=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,b=t.expirationTimes,A=t.hiddenUpdates;for(n=r&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var kh=/[\n"\\]/g;function me(t){return t.replace(kh,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function gu(t,e,n,l,u,s,r,h){t.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.type=r:t.removeAttribute("type"),e!=null?r==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ge(e)):t.value!==""+ge(e)&&(t.value=""+ge(e)):r!=="submit"&&r!=="reset"||t.removeAttribute("value"),e!=null?mu(t,r,ge(e)):n!=null?mu(t,r,ge(n)):l!=null&&t.removeAttribute("value"),u==null&&s!=null&&(t.defaultChecked=!!s),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+ge(h):t.removeAttribute("name")}function io(t,e,n,l,u,s,r,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){hu(t);return}n=n!=null?""+ge(n):"",e=e!=null?""+ge(e):n,h||e===t.value||(t.value=e),t.defaultValue=e}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=h?t.checked:!!l,t.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.name=r),hu(t)}function mu(t,e,n){e==="number"&&Ya(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function In(t,e,n,l){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=!1;if(Ue)try{var Gl={};Object.defineProperty(Gl,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Gl,Gl),window.removeEventListener("test",Gl,Gl)}catch{Su=!1}var en=null,Tu=null,Xa=null;function ho(){if(Xa)return Xa;var t,e=Tu,n=e.length,l,u="value"in en?en.value:en.textContent,s=u.length;for(t=0;t=Kl),bo=" ",So=!1;function To(t,e){switch(t){case"keyup":return Wh.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ko(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var nl=!1;function Ih(t,e){switch(t){case"compositionend":return ko(e);case"keypress":return e.which!==32?null:(So=!0,bo);case"textInput":return t=e.data,t===bo&&So?null:t;default:return null}}function Ph(t,e){if(nl)return t==="compositionend"||!Nu&&To(t,e)?(t=ho(),Xa=Tu=en=null,nl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=_o(n)}}function Mo(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Mo(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ro(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ya(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ya(t.document)}return e}function xu(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var sg=Ue&&"documentMode"in document&&11>=document.documentMode,ll=null,_u=null,Wl=null,ju=!1;function wo(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ju||ll==null||ll!==Ya(l)||(l=ll,"selectionStart"in l&&xu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Wl&&$l(Wl,l)||(Wl=l,l=qi(_u,"onSelect"),0>=r,u-=r,xe=1<<32-ie(e)+u|n<F?(nt=C,C=null):nt=C.sibling;var ct=N(k,C,E[F],j);if(ct===null){C===null&&(C=nt);break}t&&C&&ct.alternate===null&&e(k,C),S=s(ct,S,F),st===null?Y=ct:st.sibling=ct,st=ct,C=nt}if(F===E.length)return n(k,C),at&&qe(k,F),Y;if(C===null){for(;FF?(nt=C,C=null):nt=C.sibling;var En=N(k,C,ct.value,j);if(En===null){C===null&&(C=nt);break}t&&C&&En.alternate===null&&e(k,C),S=s(En,S,F),st===null?Y=En:st.sibling=En,st=En,C=nt}if(ct.done)return n(k,C),at&&qe(k,F),Y;if(C===null){for(;!ct.done;F++,ct=E.next())ct=M(k,ct.value,j),ct!==null&&(S=s(ct,S,F),st===null?Y=ct:st.sibling=ct,st=ct);return at&&qe(k,F),Y}for(C=l(C);!ct.done;F++,ct=E.next())ct=D(C,k,F,ct.value,j),ct!==null&&(t&&ct.alternate!==null&&C.delete(ct.key===null?F:ct.key),S=s(ct,S,F),st===null?Y=ct:st.sibling=ct,st=ct);return t&&C.forEach(function(Om){return e(k,Om)}),at&&qe(k,F),Y}function pt(k,S,E,j){if(typeof E=="object"&&E!==null&&E.type===G&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case q:t:{for(var Y=E.key;S!==null;){if(S.key===Y){if(Y=E.type,Y===G){if(S.tag===7){n(k,S.sibling),j=u(S,E.props.children),j.return=k,k=j;break t}}else if(S.elementType===Y||typeof Y=="object"&&Y!==null&&Y.$$typeof===bt&&Cn(Y)===S.type){n(k,S.sibling),j=u(S,E.props),na(j,E),j.return=k,k=j;break t}n(k,S);break}else e(k,S);S=S.sibling}E.type===G?(j=Rn(E.props.children,k.mode,j,E.key),j.return=k,k=j):(j=ti(E.type,E.key,E.props,null,k.mode,j),na(j,E),j.return=k,k=j)}return r(k);case H:t:{for(Y=E.key;S!==null;){if(S.key===Y)if(S.tag===4&&S.stateNode.containerInfo===E.containerInfo&&S.stateNode.implementation===E.implementation){n(k,S.sibling),j=u(S,E.children||[]),j.return=k,k=j;break t}else{n(k,S);break}else e(k,S);S=S.sibling}j=Cu(E,k.mode,j),j.return=k,k=j}return r(k);case bt:return E=Cn(E),pt(k,S,E,j)}if(L(E))return B(k,S,E,j);if(Ut(E)){if(Y=Ut(E),typeof Y!="function")throw Error(o(150));return E=Y.call(E),X(k,S,E,j)}if(typeof E.then=="function")return pt(k,S,si(E),j);if(E.$$typeof===I)return pt(k,S,li(k,E),j);ci(k,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,S!==null&&S.tag===6?(n(k,S.sibling),j=u(S,E),j.return=k,k=j):(n(k,S),j=qu(E,k.mode,j),j.return=k,k=j),r(k)):n(k,S)}return function(k,S,E,j){try{ea=0;var Y=pt(k,S,E,j);return gl=null,Y}catch(C){if(C===hl||C===ii)throw C;var st=se(29,C,null,k.mode);return st.lanes=j,st.return=k,st}}}var Hn=lf(!0),af=lf(!1),sn=!1;function Wu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fu(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function on(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(ot&2)!==0){var u=l.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),l.pending=e,e=Pa(t),Vo(t,null,n),e}return Ia(t,l,e,n),Pa(t)}function la(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Jc(t,n)}}function Iu(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var u=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?u=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?u=s=e:s=s.next=e}else u=s=e;n={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Pu=!1;function aa(){if(Pu){var t=dl;if(t!==null)throw t}}function ia(t,e,n,l){Pu=!1;var u=t.updateQueue;sn=!1;var s=u.firstBaseUpdate,r=u.lastBaseUpdate,h=u.shared.pending;if(h!==null){u.shared.pending=null;var b=h,A=b.next;b.next=null,r===null?s=A:r.next=A,r=b;var x=t.alternate;x!==null&&(x=x.updateQueue,h=x.lastBaseUpdate,h!==r&&(h===null?x.firstBaseUpdate=A:h.next=A,x.lastBaseUpdate=b))}if(s!==null){var M=u.baseState;r=0,x=A=b=null,h=s;do{var N=h.lane&-536870913,D=N!==h.lane;if(D?(et&N)===N:(l&N)===N){N!==0&&N===rl&&(Pu=!0),x!==null&&(x=x.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var B=t,X=h;N=e;var pt=n;switch(X.tag){case 1:if(B=X.payload,typeof B=="function"){M=B.call(pt,M,N);break t}M=B;break t;case 3:B.flags=B.flags&-65537|128;case 0:if(B=X.payload,N=typeof B=="function"?B.call(pt,M,N):B,N==null)break t;M=_({},M,N);break t;case 2:sn=!0}}N=h.callback,N!==null&&(t.flags|=64,D&&(t.flags|=8192),D=u.callbacks,D===null?u.callbacks=[N]:D.push(N))}else D={lane:N,tag:h.tag,payload:h.payload,callback:h.callback,next:null},x===null?(A=x=D,b=M):x=x.next=D,r|=N;if(h=h.next,h===null){if(h=u.shared.pending,h===null)break;D=h,h=D.next,D.next=null,u.lastBaseUpdate=D,u.shared.pending=null}}while(!0);x===null&&(b=M),u.baseState=b,u.firstBaseUpdate=A,u.lastBaseUpdate=x,s===null&&(u.shared.lanes=0),gn|=r,t.lanes=r,t.memoizedState=M}}function uf(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function sf(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ts?s:8;var r=O.T,h={};O.T=h,vs(t,!1,e,n);try{var b=u(),A=O.S;if(A!==null&&A(h,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var x=yg(b,l);ca(t,e,x,de(t))}else ca(t,e,l,de(t))}catch(M){ca(t,e,{then:function(){},status:"rejected",reason:M},de())}finally{U.p=s,r!==null&&h.types!==null&&(r.types=h.types),O.T=r}}function kg(){}function ys(t,e,n,l){if(t.tag!==5)throw Error(o(476));var u=Lf(t).queue;Cf(t,u,e,V,n===null?kg:function(){return Hf(t),n(l)})}function Lf(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:V},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Hf(t){var e=Lf(t);e.next===null&&(e=t.alternate.memoizedState),ca(t,e.next.queue,{},de())}function ps(){return Yt(Aa)}function Vf(){return Dt().memoizedState}function Yf(){return Dt().memoizedState}function zg(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=de();t=cn(n);var l=on(e,t,n);l!==null&&(ne(l,e,n),la(l,e,n)),e={cache:Ku()},t.payload=e;return}e=e.return}}function Eg(t,e,n){var l=de();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},vi(t)?Xf(e,n):(n=Uu(t,e,n,l),n!==null&&(ne(n,t,l),Qf(n,e,l)))}function Gf(t,e,n){var l=de();ca(t,e,n,l)}function ca(t,e,n,l){var u={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(vi(t))Xf(e,u);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var r=e.lastRenderedState,h=s(r,n);if(u.hasEagerState=!0,u.eagerState=h,ue(h,r))return Ia(t,e,u,0),vt===null&&Fa(),!1}catch{}if(n=Uu(t,e,u,l),n!==null)return ne(n,t,l),Qf(n,e,l),!0}return!1}function vs(t,e,n,l){if(l={lane:2,revertLane:Ws(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},vi(t)){if(e)throw Error(o(479))}else e=Uu(t,n,l,2),e!==null&&ne(e,t,2)}function vi(t){var e=t.alternate;return t===J||e!==null&&e===J}function Xf(t,e){yl=ri=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Qf(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Jc(t,n)}}var oa={readContext:Yt,use:gi,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};oa.useEffectEvent=At;var Kf={readContext:Yt,use:gi,useCallback:function(t,e){return $t().memoizedState=[t,e===void 0?null:e],t},useContext:Yt,useEffect:xf,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,yi(4194308,4,Rf.bind(null,e,t),n)},useLayoutEffect:function(t,e){return yi(4194308,4,t,e)},useInsertionEffect:function(t,e){yi(4,2,t,e)},useMemo:function(t,e){var n=$t();e=e===void 0?null:e;var l=t();if(Vn){Pe(!0);try{t()}finally{Pe(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=$t();if(n!==void 0){var u=n(e);if(Vn){Pe(!0);try{n(e)}finally{Pe(!1)}}}else u=e;return l.memoizedState=l.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},l.queue=t,t=t.dispatch=Eg.bind(null,J,t),[l.memoizedState,t]},useRef:function(t){var e=$t();return t={current:t},e.memoizedState=t},useState:function(t){t=rs(t);var e=t.queue,n=Gf.bind(null,J,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(t,e){var n=$t();return ms(n,t,e)},useTransition:function(){var t=rs(!1);return t=Cf.bind(null,J,t.queue,!0,!1),$t().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=J,u=$t();if(at){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),vt===null)throw Error(o(349));(et&127)!==0||hf(l,e,n)}u.memoizedState=n;var s={value:n,getSnapshot:e};return u.queue=s,xf(mf.bind(null,l,s,t),[t]),l.flags|=2048,vl(9,{destroy:void 0},gf.bind(null,l,s,n,e),null),n},useId:function(){var t=$t(),e=vt.identifierPrefix;if(at){var n=_e,l=xe;n=(l&~(1<<32-ie(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=di++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(u,{is:l.is}):r.createElement(u)}}s[Ht]=e,s[Wt]=l;t:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break t;for(;r.sibling===null;){if(r.return===null||r.return===e)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=s;t:switch(Xt(s,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&Ge(e)}}return kt(e),Ms(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Ge(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(o(166));if(t=Ie.current,ol(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,u=Vt,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}t[Ht]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||rd(t.nodeValue,n)),t||an(e,!0)}else t=Ci(t).createTextNode(l),t[Ht]=e,e.stateNode=t}return kt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=ol(e),n!==null){if(t===null){if(!l)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Ht]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),t=!1}else n=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(oe(e),e):(oe(e),null);if((e.flags&128)!==0)throw Error(o(558))}return kt(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=ol(e),l!==null&&l.dehydrated!==null){if(t===null){if(!u)throw Error(o(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Ht]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),u=!1}else u=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(oe(e),e):(oe(e),null)}return oe(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),zi(e,e.updateQueue),kt(e),null);case 4:return Kn(),t===null&&tc(e.stateNode.containerInfo),kt(e),null;case 10:return Le(e.type),kt(e),null;case 19:if(Et(Ot),l=e.memoizedState,l===null)return kt(e),null;if(u=(e.flags&128)!==0,s=l.rendering,s===null)if(u)ra(l,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=fi(t),s!==null){for(e.flags|=128,ra(l,!1),t=s.updateQueue,e.updateQueue=t,zi(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Yo(n,t),n=n.sibling;return ft(Ot,Ot.current&1|2),at&&qe(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&le()>Di&&(e.flags|=128,u=!0,ra(l,!1),e.lanes=4194304)}else{if(!u)if(t=fi(s),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,zi(e,t),ra(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!at)return kt(e),null}else 2*le()-l.renderingStartTime>Di&&n!==536870912&&(e.flags|=128,u=!0,ra(l,!1),e.lanes=4194304);l.isBackwards?(s.sibling=e.child,e.child=s):(t=l.last,t!==null?t.sibling=s:e.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=le(),t.sibling=null,n=Ot.current,ft(Ot,u?n&1|2:n&1),at&&qe(e,l.treeForkCount),t):(kt(e),null);case 22:case 23:return oe(e),es(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(kt(e),e.subtreeFlags&6&&(e.flags|=8192)):kt(e),n=e.updateQueue,n!==null&&zi(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&Et(qn),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Le(xt),kt(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function xg(t,e){switch(Hu(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Le(xt),Kn(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return wa(e),null;case 31:if(e.memoizedState!==null){if(oe(e),e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(oe(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Et(Ot),null;case 4:return Kn(),null;case 10:return Le(e.type),null;case 22:case 23:return oe(e),es(),t!==null&&Et(qn),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Le(xt),null;case 25:return null;default:return null}}function yr(t,e){switch(Hu(e),e.tag){case 3:Le(xt),Kn();break;case 26:case 27:case 5:wa(e);break;case 4:Kn();break;case 31:e.memoizedState!==null&&oe(e);break;case 13:oe(e);break;case 19:Et(Ot);break;case 10:Le(e.type);break;case 22:case 23:oe(e),es(),t!==null&&Et(qn);break;case 24:Le(xt)}}function da(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var u=l.next;n=u;do{if((n.tag&t)===t){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==u)}}catch(h){ht(e,e.return,h)}}function dn(t,e,n){try{var l=e.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var s=u.next;l=s;do{if((l.tag&t)===t){var r=l.inst,h=r.destroy;if(h!==void 0){r.destroy=void 0,u=e;var b=n,A=h;try{A()}catch(x){ht(u,b,x)}}}l=l.next}while(l!==s)}}catch(x){ht(e,e.return,x)}}function pr(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{sf(e,n)}catch(l){ht(t,t.return,l)}}}function vr(t,e,n){n.props=Yn(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){ht(t,e,l)}}function ha(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(u){ht(t,e,u)}}function je(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(u){ht(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){ht(t,e,u)}else n.current=null}function br(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(u){ht(t,t.return,u)}}function Rs(t,e,n){try{var l=t.stateNode;Fg(l,t.type,n,e),l[Wt]=e}catch(u){ht(t,t.return,u)}}function Sr(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bn(t.type)||t.tag===4}function ws(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Sr(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Us(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=we));else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Us(t,e,n),t=t.sibling;t!==null;)Us(t,e,n),t=t.sibling}function Ei(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ei(t,e,n),t=t.sibling;t!==null;)Ei(t,e,n),t=t.sibling}function Tr(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);Xt(e,l,n),e[Ht]=t,e[Wt]=n}catch(s){ht(t,t.return,s)}}var Xe=!1,Mt=!1,Bs=!1,kr=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function _g(t,e){if(t=t.containerInfo,lc=Qi,t=Ro(t),xu(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var u=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var r=0,h=-1,b=-1,A=0,x=0,M=t,N=null;e:for(;;){for(var D;M!==n||u!==0&&M.nodeType!==3||(h=r+u),M!==s||l!==0&&M.nodeType!==3||(b=r+l),M.nodeType===3&&(r+=M.nodeValue.length),(D=M.firstChild)!==null;)N=M,M=D;for(;;){if(M===t)break e;if(N===n&&++A===u&&(h=r),N===s&&++x===l&&(b=r),(D=M.nextSibling)!==null)break;M=N,N=M.parentNode}M=D}n=h===-1||b===-1?null:{start:h,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(ac={focusedElem:t,selectionRange:n},Qi=!1,Ct=e;Ct!==null;)if(e=Ct,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ct=t;else for(;Ct!==null;){switch(e=Ct,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),Xt(s,l,n),s[Ht]=t,qt(s),l=s;break t;case"link":var r=Dd("link","href",u).get(l+(n.href||""));if(r){for(var h=0;hpt&&(r=pt,pt=X,X=r);var k=jo(h,X),S=jo(h,pt);if(k&&S&&(D.rangeCount!==1||D.anchorNode!==k.node||D.anchorOffset!==k.offset||D.focusNode!==S.node||D.focusOffset!==S.offset)){var E=M.createRange();E.setStart(k.node,k.offset),D.removeAllRanges(),X>pt?(D.addRange(E),D.extend(S.node,S.offset)):(E.setEnd(S.node,S.offset),D.addRange(E))}}}}for(M=[],D=h;D=D.parentNode;)D.nodeType===1&&M.push({element:D,left:D.scrollLeft,top:D.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;hn?32:n,O.T=null,n=Gs,Gs=null;var s=yn,r=$e;if(Rt=0,zl=yn=null,$e=0,(ot&6)!==0)throw Error(o(331));var h=ot;if(ot|=4,Rr(s.current),_r(s,s.current,r,n),ot=h,ba(0,!1),ae&&typeof ae.onPostCommitFiberRoot=="function")try{ae.onPostCommitFiberRoot(ql,s)}catch{}return!0}finally{U.p=u,O.T=l,Fr(t,e)}}function Pr(t,e,n){e=pe(n,e),e=ks(t.stateNode,e,2),t=on(t,e,2),t!==null&&(Ll(t,2),Me(t))}function ht(t,e,n){if(t.tag===3)Pr(t,t,n);else for(;e!==null;){if(e.tag===3){Pr(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(mn===null||!mn.has(l))){t=pe(n,t),n=tr(2),l=on(e,n,2),l!==null&&(er(n,l,e,t),Ll(l,2),Me(l));break}}e=e.return}}function Zs(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new Rg;var u=new Set;l.set(e,u)}else u=l.get(e),u===void 0&&(u=new Set,l.set(e,u));u.has(n)||(Ls=!0,u.add(n),t=Cg.bind(null,t,e,n),e.then(t,t))}function Cg(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,vt===t&&(et&n)===n&&(Nt===4||Nt===3&&(et&62914560)===et&&300>le()-Oi?(ot&2)===0&&El(t,0):Hs|=n,kl===et&&(kl=0)),Me(t)}function td(t,e){e===0&&(e=Kc()),t=Mn(t,e),t!==null&&(Ll(t,e),Me(t))}function Lg(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),td(t,n)}function Hg(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(e),td(t,n)}function Vg(t,e){return uu(t,e)}var wi=null,Nl=null,Js=!1,Ui=!1,$s=!1,vn=0;function Me(t){t!==Nl&&t.next===null&&(Nl===null?wi=Nl=t:Nl=Nl.next=t),Ui=!0,Js||(Js=!0,Gg())}function ba(t,e){if(!$s&&Ui){$s=!0;do for(var n=!1,l=wi;l!==null;){if(t!==0){var u=l.pendingLanes;if(u===0)var s=0;else{var r=l.suspendedLanes,h=l.pingedLanes;s=(1<<31-ie(42|t)+1)-1,s&=u&~(r&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,ad(l,s))}else s=et,s=La(l,l===vt?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Cl(l,s)||(n=!0,ad(l,s));l=l.next}while(n);$s=!1}}function Yg(){ed()}function ed(){Ui=Js=!1;var t=0;vn!==0&&Pg()&&(t=vn);for(var e=le(),n=null,l=wi;l!==null;){var u=l.next,s=nd(l,e);s===0?(l.next=null,n===null?wi=u:n.next=u,u===null&&(Nl=n)):(n=l,(t!==0||(s&3)!==0)&&(Ui=!0)),l=u}Rt!==0&&Rt!==5||ba(t),vn!==0&&(vn=0)}function nd(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,u=t.expirationTimes,s=t.pendingLanes&-62914561;0h)break;var x=b.transferSize,M=b.initiatorType;x&&dd(M)&&(b=b.responseEnd,r+=x*(b"u"?null:document;function Ed(t,e,n){var l=Ol;if(l&&typeof e=="string"&&e){var u=me(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),zd.has(u)||(zd.add(u),t={rel:t,crossOrigin:n,href:e},l.querySelector(u)===null&&(e=l.createElement("link"),Xt(e,"link",t),qt(e),l.head.appendChild(e)))}}function cm(t){We.D(t),Ed("dns-prefetch",t,null)}function om(t,e){We.C(t,e),Ed("preconnect",t,e)}function fm(t,e,n){We.L(t,e,n);var l=Ol;if(l&&t&&e){var u='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+me(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+me(n.imageSizes)+'"]')):u+='[href="'+me(t)+'"]';var s=u;switch(e){case"style":s=Dl(t);break;case"script":s=xl(t)}ze.has(s)||(t=_({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),ze.set(s,t),l.querySelector(u)!==null||e==="style"&&l.querySelector(za(s))||e==="script"&&l.querySelector(Ea(s))||(e=l.createElement("link"),Xt(e,"link",t),qt(e),l.head.appendChild(e)))}}function rm(t,e){We.m(t,e);var n=Ol;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+me(l)+'"][href="'+me(t)+'"]',s=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=xl(t)}if(!ze.has(s)&&(t=_({rel:"modulepreload",href:t},e),ze.set(s,t),n.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ea(s)))return}l=n.createElement("link"),Xt(l,"link",t),qt(l),n.head.appendChild(l)}}}function dm(t,e,n){We.S(t,e,n);var l=Ol;if(l&&t){var u=Wn(l).hoistableStyles,s=Dl(t);e=e||"default";var r=u.get(s);if(!r){var h={loading:0,preload:null};if(r=l.querySelector(za(s)))h.loading=5;else{t=_({rel:"stylesheet",href:t,"data-precedence":e},n),(n=ze.get(s))&&rc(t,n);var b=r=l.createElement("link");qt(b),Xt(b,"link",t),b._p=new Promise(function(A,x){b.onload=A,b.onerror=x}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Hi(r,e,l)}r={type:"stylesheet",instance:r,count:1,state:h},u.set(s,r)}}}function hm(t,e){We.X(t,e);var n=Ol;if(n&&t){var l=Wn(n).hoistableScripts,u=xl(t),s=l.get(u);s||(s=n.querySelector(Ea(u)),s||(t=_({src:t,async:!0},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),qt(s),Xt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function gm(t,e){We.M(t,e);var n=Ol;if(n&&t){var l=Wn(n).hoistableScripts,u=xl(t),s=l.get(u);s||(s=n.querySelector(Ea(u)),s||(t=_({src:t,async:!0,type:"module"},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),qt(s),Xt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function Ad(t,e,n,l){var u=(u=Ie.current)?Li(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Dl(n.href),n=Wn(u).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Dl(n.href);var s=Wn(u).hoistableStyles,r=s.get(t);if(r||(u=u.ownerDocument||u,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,r),(s=u.querySelector(za(t)))&&!s._p&&(r.instance=s,r.state.loading=5),ze.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ze.set(t,n),s||mm(u,t,n,r.state))),e&&l===null)throw Error(o(528,""));return r}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=xl(n),n=Wn(u).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function Dl(t){return'href="'+me(t)+'"'}function za(t){return'link[rel="stylesheet"]['+t+"]"}function Nd(t){return _({},t,{"data-precedence":t.precedence,precedence:null})}function mm(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),Xt(e,"link",n),qt(e),t.head.appendChild(e))}function xl(t){return'[src="'+me(t)+'"]'}function Ea(t){return"script[async]"+t}function Od(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+me(n.href)+'"]');if(l)return e.instance=l,qt(l),l;var u=_({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),qt(l),Xt(l,"style",u),Hi(l,n.precedence,t),e.instance=l;case"stylesheet":u=Dl(n.href);var s=t.querySelector(za(u));if(s)return e.state.loading|=4,e.instance=s,qt(s),s;l=Nd(n),(u=ze.get(u))&&rc(l,u),s=(t.ownerDocument||t).createElement("link"),qt(s);var r=s;return r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Xt(s,"link",l),e.state.loading|=4,Hi(s,n.precedence,t),e.instance=s;case"script":return s=xl(n.src),(u=t.querySelector(Ea(s)))?(e.instance=u,qt(u),u):(l=n,(u=ze.get(s))&&(l=_({},n),dc(l,u)),t=t.ownerDocument||t,u=t.createElement("script"),qt(u),Xt(u,"link",l),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,Hi(l,n.precedence,t));return e.instance}function Hi(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,s=u,r=0;r title"):null)}function ym(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function _d(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function pm(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=Dl(l.href),s=e.querySelector(za(u));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Yi.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,qt(s);return}s=e.ownerDocument||e,l=Nd(l),(u=ze.get(u))&&rc(l,u),s=s.createElement("link"),qt(s);var r=s;r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Xt(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Yi.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var hc=0;function vm(t,e){return t.stylesheets&&t.count===0&&Xi(t,t.stylesheets),0hc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Yi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xi(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Gi=null;function Xi(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gi=new Map,e.forEach(bm,t),Gi=null,Yi.call(t))}function bm(t,e){if(!(e.state.loading&4)){var n=Gi.get(t);if(n)var l=n.get(null);else{n=new Map,Gi.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y)}catch(a){console.error(a)}}return y(),Sc.exports=Ym(),Sc.exports}var Xm=Gm();class Qm extends ${constructor(){super("avalanche.operator.Empty",[])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.poszc},{no:6,name:"run_id",kind:"scalar",T:9},{no:7,name:"workflow_selector",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.flowName="",i.inputJson="",i.contextJson="",i.inputFiles=[],i.runId="",i.workflowSelector="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posAn}},{no:3,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posAn}},{no:5,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"cron",kind:"scalar",T:9},{no:8,name:"next_run_at",kind:"scalar",T:1},{no:9,name:"last_run_at",kind:"scalar",T:1},{no:10,name:"workflow_id",kind:"scalar",T:9},{no:11,name:"display_name",kind:"scalar",T:9},{no:12,name:"root_alias",kind:"scalar",T:9},{no:13,name:"relative_file",kind:"scalar",T:9},{no:14,name:"builder_symbol",kind:"scalar",T:9},{no:15,name:"agent_node_ids",kind:"scalar",repeat:2,T:9},{no:16,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:17,name:"webhook_path",kind:"scalar",T:9},{no:18,name:"webhook_url",kind:"scalar",T:9},{no:19,name:"webhook_active",kind:"scalar",T:8}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.name="",i.filePath="",i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.cron="",i.nextRunAt=0,i.lastRunAt=0,i.workflowId="",i.displayName="",i.rootAlias="",i.relativeFile="",i.builderSymbol="",i.agentNodeIds=[],i.agentMetadataJson={},i.webhookPath="",i.webhookUrl="",i.webhookActive=!1,a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posEc},{no:5,name:"scan_targets",kind:"message",repeat:2,T:()=>Nc},{no:6,name:"diagnostics",kind:"message",repeat:2,T:()=>Ac}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.revision="0",i.workflows=[],i.scanTargets=[],i.diagnostics=[],a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posOc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.valueJson="",i.files=[],a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posRl},{no:8,name:"revision",kind:"scalar",T:4},{no:9,name:"event_page_token",kind:"scalar",T:9},{no:10,name:"error",kind:"scalar",opt:!0,T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeId="",i.name="",i.nodeType="",i.status="",i.startedAt=0,i.endedAt=0,i.revision="0",i.eventPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posFe},{no:4,name:"nodes",kind:"message",repeat:2,T:()=>wl},{no:5,name:"latest_log_sequence",kind:"scalar",T:4},{no:6,name:"log_page_token",kind:"scalar",T:9},{no:7,name:"topology",kind:"message",T:()=>Ml}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.nodes=[],i.latestLogSequence="0",i.logPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posFe},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runs=[],i.nextPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posUl},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.logs=[],i.nextPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posBl},{no:6,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runId="",i.nodeId="",i.events=[],i.nextPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posFe},{no:2,name:"nodes",kind:"message",repeat:2,T:()=>wl},{no:3,name:"topology",kind:"message",T:()=>Ml}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodes=[],a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posUl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posBl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posRl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posPi}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posDc},{no:3,name:"run_status_changed",kind:"message",oneof:"change",T:()=>xc},{no:4,name:"node_status_changed",kind:"message",oneof:"change",T:()=>_c},{no:5,name:"log_appended",kind:"message",oneof:"change",T:()=>jc},{no:6,name:"agent_event_appended",kind:"message",oneof:"change",T:()=>Mc},{no:7,name:"trace_finalized",kind:"message",oneof:"change",T:()=>Rc},{no:8,name:"catalog_replaced",kind:"message",oneof:"change",T:()=>wc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.sequence="0",i.change={oneofKind:void 0},a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posUc},{no:3,name:"reset_required",kind:"message",oneof:"payload",T:()=>Bc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.payload={oneofKind:void 0},a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posawait this.client.getRunSnapshot({runId:g.runId,operatorInstanceId:f,asOfSequence:c}).response)),d=await this.getCatalog();if(a.operatorInstanceId!==f||d.operatorInstanceId!==f||a.revision!==d.revision||BigInt(a.asOfSequence)>BigInt(c)||BigInt(d.asOfSequence)d.nodeId===i);if(!o?.eventPageToken)return[];const f=[];let c=o.eventPageToken,p="0";do{const d=await this.client.listAgentEvents({pageToken:c,afterEventSequence:p,pageSize:100}).response;f.push(...d.events),d.events.length&&(p=d.events.at(-1).eventSequence),c=d.nextPageToken}while(c);return f}async listLogs(a){if(!a.logPageToken)return[];const i=[];let o=a.logPageToken,f="0";do{const c=await this.client.listLogs({pageToken:o,afterSequence:f,pageSize:100}).response;i.push(...c.logs),c.logs.length&&(f=c.logs.at(-1).sequence),o=c.nextPageToken}while(o);return i}async readDetail(a){const i=[];for await(const p of this.client.readDetail({bodyToken:a}).responses)i.push(p.data);const o=i.reduce((p,d)=>p+d.length,0),f=new Uint8Array(o);let c=0;for(const p of i)f.set(p,c),c+=p.length;return JSON.parse(new TextDecoder().decode(f))}async startRun(a,i){return(await this.client.startRun({flowName:"",workflowSelector:a,runId:"",inputJson:i===void 0?"":JSON.stringify(i),contextJson:"",inputFiles:[]}).response).runId}async cancelRun(a){await this.client.cancelRun({runId:a}).response}}function tp(y){return y==="success"?"✓":y==="failed"?"!":y==="running"?"●":"·"}function ep({workflow:y,runs:a,selection:i,onSelect:o}){const[f,c]=Z.useState(!0);return v.jsxs("div",{className:"workflow-branch",children:[v.jsxs("div",{className:"tree-row",children:[v.jsx("button",{type:"button",className:"tree-disclosure",onClick:()=>c(p=>!p),"aria-label":`${f?"Collapse":"Expand"} ${y.displayName}`,children:f?"⌄":"›"}),v.jsxs("button",{type:"button",className:i?.kind==="workflow"&&i.workflowId===y.workflowId?"tree-select active":"tree-select",onClick:()=>o({kind:"workflow",workflowId:y.workflowId}),children:[v.jsx("span",{className:"workflow-glyph",children:"◇"}),v.jsxs("span",{children:[v.jsx("strong",{children:y.displayName}),v.jsx("small",{children:y.relativeFile})]})]})]}),f&&v.jsxs("div",{className:"run-branches",children:[a.map(p=>{const d=p.summary;return v.jsxs("button",{type:"button",className:i?.kind==="run"&&i.runId===d.runId?"run-select active":"run-select",onClick:()=>o({kind:"run",workflowId:y.workflowId,runId:d.runId}),children:[v.jsx("span",{className:`run-dot status-${d.status}`,children:tp(d.status)}),v.jsxs("span",{children:[v.jsx("strong",{children:d.runId}),v.jsx("small",{children:d.startedAt?`Created at sequence ${d.createdSequence}`:"Awaiting start"})]})]},d.runId)}),!a.length&&v.jsx("span",{className:"no-runs",children:"No runs yet"})]})]})}function np(y,a){return y.workflows.filter(i=>i.rootAlias===a.alias)}function lp({catalog:y,runs:a,selection:i,onSelect:o}){const[f,c]=Z.useState({});if(!y)return v.jsxs("aside",{className:"explorer skeleton","aria-label":"Explorer",children:[v.jsx("div",{}),v.jsx("div",{}),v.jsx("div",{})]});const p=y.scanTargets.length?y.scanTargets:[{alias:"workflows",targetPath:"Configured workflows",kind:"directory"}];return v.jsxs("aside",{className:"explorer","aria-label":"Explorer",children:[v.jsxs("header",{children:[v.jsx("span",{className:"eyebrow",children:"Navigator"}),v.jsx("h2",{children:"Explorer"}),v.jsxs("span",{className:"catalog-revision",children:["catalog r",y.revision]})]}),y.diagnostics.length>0&&v.jsxs("details",{className:"diagnostics",open:!0,children:[v.jsxs("summary",{children:[y.diagnostics.length," reload issue",y.diagnostics.length===1?"":"s"]}),y.diagnostics.map(d=>v.jsxs("div",{children:[v.jsx("strong",{children:d.kind.replaceAll("_"," ")}),v.jsx("span",{children:d.path}),v.jsx("p",{children:d.message})]},`${d.path}-${d.kind}`))]}),v.jsx("div",{className:"target-list",children:p.map(d=>{const g=d.alias==="workflows"?y.workflows:np(y,d),m=!!f[d.alias];return v.jsxs("section",{className:"target",children:[v.jsxs("button",{type:"button",className:"target-heading",onClick:()=>c(z=>{const _={...z};return _[d.alias]?delete _[d.alias]:_[d.alias]=!0,_}),children:[v.jsx("span",{children:m?"›":"⌄"}),v.jsx("span",{className:"target-kind",children:d.kind==="file"?"F":"D"}),v.jsxs("span",{children:[v.jsx("strong",{children:d.alias}),v.jsx("small",{title:d.targetPath,children:d.targetPath})]})]}),!m&&v.jsx("div",{className:"workflow-list",children:g.map(z=>v.jsx(ep,{workflow:z,runs:Object.values(a).filter(_=>_.summary?.workflowId===z.workflowId).sort((_,R)=>Number(R.summary.createdSequence)-Number(_.summary.createdSequence)),selection:i,onSelect:o},z.workflowId))})]},d.alias)})})]})}function Qn(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function Fd(y){return Array.isArray(y)?y.flatMap(a=>!Qn(a)||typeof a.name!="string"?[]:[{name:a.name,type:typeof a.type=="string"?a.type:void 0,description:typeof a.description=="string"?a.description:void 0}]):[]}function th(y){if(y)try{const a=JSON.parse(y);if(!Qn(a))return;const i=Qn(a.signature)?a.signature:{};return{instructions:typeof i.instructions=="string"?i.instructions:"",inputs:Fd(i.inputs),outputs:Fd(i.outputs),model:a.models,runtime:a.runtime,skills:a.skills,tools:a.tools}}catch{return}}const eh=Z.memo(({data:y})=>v.jsxs("button",{type:"button",className:`node-card ${y.status?`status-${y.status}`:"blueprint"}`,onClick:y.onOpen,"aria-label":`Inspect ${y.label}`,children:[v.jsx(Xd,{type:"target",position:Qd.Left,isConnectable:!1}),v.jsx("span",{className:"node-kicker",children:y.nodeType}),v.jsx("strong",{children:y.label}),y.status&&v.jsx("span",{className:"node-status",children:y.status}),y.duration&&v.jsx("span",{className:"node-duration",children:y.duration}),y.error&&v.jsx("span",{className:"node-error",children:y.error}),y.declaration&&v.jsxs("span",{className:"field-grid",children:[v.jsxs("span",{children:[v.jsx("small",{children:"Inputs"}),y.declaration.inputs.map(a=>v.jsx("span",{className:"field",children:a.name},`input-${a.name}`))]}),v.jsxs("span",{children:[v.jsx("small",{children:"Outputs"}),y.declaration.outputs.map(a=>v.jsx("span",{className:"field",children:a.name},`output-${a.name}`))]})]}),v.jsx(Xd,{type:"source",position:Qd.Right,isConnectable:!1})]}));eh.displayName="WorkflowNodeCard";function ap(y){const a=Object.fromEntries(y.nodeIds.map(c=>[c,0]));for(const c of Object.values(y.graph))for(const p of c.children)a[p]=(a[p]??0)+1;const i={},o=y.nodeIds.filter(c=>a[c]===0);for(const c of o)i[c]=0;for(let c=0;cp.map((d,g)=>[d,{x:Number(c)*330,y:g*220-(p.length-1)*110}])))}function ip(y){if(!y.startedAt)return;const a=y.endedAt||Date.now()/1e3,i=Math.max(0,a-y.startedAt);return i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m`}function up({workflow:y,runTopology:a,runNodes:i=[],onOpenNode:o}){const f=Z.useMemo(()=>{if(a)return a;if(y)return{nodeIds:y.nodeIds,graph:y.graph,nodeTypes:y.nodeTypes,displayNames:y.displayNames}},[a,y]),c=Z.useMemo(()=>{if(!f)return{nodes:[],edges:[]};const p=ap(f),d=Object.fromEntries(i.map(_=>[_.nodeId,_])),g=f.nodeIds.map(_=>{const R=d[_];return{id:_,type:"workflow",position:p[_],data:{label:f.displayNames[_]||R?.name||_,nodeType:f.nodeTypes[_]||R?.nodeType||"step",status:R?.status,error:R?.error,duration:R?ip(R):void 0,declaration:y?th(y.agentMetadataJson[_]):void 0,onOpen:()=>o(_)}}}),m=new Set,z=[];for(const[_,R]of Object.entries(f.graph))for(const q of R.children){const H=`${_}->${q}`;m.has(H)||(m.add(H),z.push({id:H,source:_,target:q,markerEnd:{type:_m.ArrowClosed},className:"dag-edge"}))}return{nodes:g,edges:z}},[o,i,f,y]);return v.jsxs(jm,{nodes:c.nodes,edges:c.edges,nodeTypes:{workflow:eh},fitView:!0,fitViewOptions:{padding:.24},minZoom:.25,maxZoom:1.8,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[v.jsx(Mm,{color:"rgba(255,255,255,.06)",gap:24,size:1}),v.jsx(Rm,{showInteractive:!1})]})}function sp(y,a,i){const o=new Array(y);return new Proxy(o,{get(f,c,p){if(typeof c=="string"){const d=c.charCodeAt(0);if(d>=48&&d<=57){const g=+c;if(Number.isInteger(g)&&g>=0&&go[z]!==m))&&(o=d,f=a(...d),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(f),c=!1),f}return p.updateDeps=d=>{o=d},p}function Id(y,a){if(y===void 0)throw new Error("Unexpected undefined");return y}const cp=(y,a)=>Math.abs(y-a)<1.01,op=(y,a,i)=>{let o;return function(...f){y.clearTimeout(o),o=y.setTimeout(()=>a.apply(this,f),i)}};let _a;const Cc=()=>{if(_a!==void 0)return _a;if(typeof navigator>"u")return _a=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return _a=!0;const y=navigator.maxTouchPoints;return _a=navigator.platform==="MacIntel"&&y!==void 0&&y>0},Pd=y=>{const{offsetWidth:a,offsetHeight:i}=y;return{width:a,height:i}},fp=y=>y,rp=y=>{const a=Math.max(y.startIndex-y.overscan,0),o=Math.min(y.endIndex+y.overscan,y.count-1)-a+1,f=new Array(o);for(let c=0;c{const i=y.scrollElement;if(!i)return;const o=y.targetWindow;if(!o)return;const f=p=>{const{width:d,height:g}=p;a({width:Math.round(d),height:Math.round(g)})};if(f(Pd(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(p=>{const d=()=>{const g=p[0];if(g?.borderBoxSize){const m=g.borderBoxSize[0];if(m){f({width:m.inlineSize,height:m.blockSize});return}}f(Pd(i))};y.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},tu={passive:!0},hp=typeof window>"u"?!0:"onscrollend"in window,gp=(y,a,i)=>{const o=y.scrollElement;if(!o)return;const f=y.targetWindow;if(!f)return;const c=y.options.useScrollendEvent&&hp;let p=0;const d=c?null:op(f,()=>a(p,!1),y.options.isScrollingResetDelay),g=_=>()=>{p=i(o),d?.(),a(p,_)},m=g(!0),z=g(!1);return o.addEventListener("scroll",m,tu),c&&o.addEventListener("scrollend",z,tu),()=>{o.removeEventListener("scroll",m),c&&o.removeEventListener("scrollend",z)}},mp=(y,a)=>gp(y,a,i=>{const{horizontal:o,isRtl:f}=y.options;return o?i.scrollLeft*(f&&-1||1):i.scrollTop}),yp=(y,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(y),f=i.options.getItemKey(o);return i.itemSizeCache.get(f)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(y),f=i.options.getItemKey(o),c=i.itemSizeCache.get(f);if(c!==void 0)return c}return y[i.options.horizontal?"offsetWidth":"offsetHeight"]},pp=(y,{adjustments:a=0,behavior:i},o)=>{var f,c;(c=(f=o.scrollElement)==null?void 0:f.scrollTo)==null||c.call(f,{[o.options.horizontal?"left":"top"]:y+a,behavior:i})},vp=pp;class bp{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,f;return((f=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:f.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(f=>{f.forEach(c=>{const p=()=>{const d=c.target,g=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,z]of this.elementsCache)if(z===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(d,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(p):p()})}));return{disconnect:()=>{var f;(f=o())==null||f.disconnect(),i=null},observe:f=>{var c;return(c=o())==null?void 0:c.observe(f,{box:"border-box"})},unobserve:f=>{var c;return(c=o())==null?void 0:c.unobserve(f)}}})(),this.range=null,this.setOptions=i=>{var o,f;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:fp,rangeExtractor:rp,onChange:()=>{},measureElement:yp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const R in i){const q=i[R];q!==void 0&&(c[R]=q)}const p=this.options;let d=null,g=null,m=!1;if(p!==void 0&&p.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const R=p.count,q=c.count,H=this.getMeasurements(),G=R>0?((o=H[0])==null?void 0:o.key)??p.getItemKey(0):null,lt=R>0?((f=H[R-1])==null?void 0:f.key)??p.getItemKey(R-1):null;if(q!==R||R>0&&q>0&&(c.getItemKey(0)!==G||c.getItemKey(q-1)!==lt)){m=!0;const I=R>0?this.getVirtualItemForOffset(this.getScrollOffset())??H[0]:null;I&&(d=[I.key,this.getScrollOffset()-I.start]);const rt=c.followOnAppend===!0?"auto":c.followOnAppend||null;rt&&q>R&&this.isAtEnd(p.scrollEndThreshold)&&(R===0||c.getItemKey(q-1)!==lt)&&(g=rt)}}this.options=c,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let z=!1,_=0;if(d&&this.scrollOffset!==null){const[R,q]=d,H=this.getMeasurements(),{count:G,getItemKey:lt}=this.options;let Q=0;for(;Q{var o,f;(f=(o=this.options).onChange)==null||f.call(o,this,i)},this.maybeNotify=jl(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,p)=>{if(p&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=p?d===c?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Cc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",p,tu),c.addEventListener("touchend",d,tu),this.unsubs.push(()=>{c.removeEventListener("touchstart",p),c.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const f=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,f&&this.scrollElement&&this.options.enabled){const[c,p,d,g]=f;c!==null&&!d&&(Cc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?g!==0&&(this._iosDeferredAdjustment+=g):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const f=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=f,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=jl(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,f,c,p,d,g,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:p,lanes:d,laneAssignmentMode:g,gap:m}),{key:!1}),this.getMeasurements=jl(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:p,lanes:d,laneAssignmentMode:g,gap:m},z)=>{const _=this.itemSizeCache;if(!p)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const Q of this.laneAssignments.keys())Q>=i&&this.laneAssignments.delete(Q);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(Q=>{this.itemSizeCache.set(Q.key,Q.size)}));const R=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),d===1){const Q=i*2;let K=this._flatMeasurements;if(!K||K.length0&&it.set(K.subarray(0,R*2)),K=it,this._flatMeasurements=K}let I;if(R===0)I=o+f;else{const it=R-1;I=K[it*2]+K[it*2+1]+m}for(let it=R;it1){rt=I;const Lt=H[rt],Qt=Lt!==void 0?q[Lt]:void 0;it=Qt?Qt.end+m:o+f}else if(lt===d){let Lt=0,Qt=G[0],Ut=H[0];for(let Zt=1;Ztthis.options.debug}),this.calculateRange=jl(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,f,c)=>i.length===0||o===0?(this.range=null,null):(this.range=Tp(i,o,f,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=jl(()=>{let i=null,o=null;const f=this.calculateRange();return f&&(i=f.startIndex,o=f.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,f,c,p)=>c===null||p===null?[]:i({startIndex:c,endIndex:p,overscan:o,count:f}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,f=i.getAttribute(o);return f?parseInt(f,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const f=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(f!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),p=Math.max(0,f-c),d=Math.min(this.options.count-1,f+c);return i>=p&&i<=d}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((p,d)=>{p.isConnected||(this.observer.unobserve(p),this.elementsCache.delete(d))});return}const o=this.indexFromElement(i),f=this.options.getItemKey(o),c=this.elementsCache.get(f);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(f,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var f,c;if(i<0||i>=this.options.count)return;let p,d,g;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)g=this.options.getItemKey(i),d=m[i*2],p=m[i*2+1];else{const R=this.measurementsCache[i];if(!R)return;g=R.key,d=R.start,p=R.size}const z=this.itemSizeCache.get(g)??p,_=o-z;if(_!==0){const R=this.options.anchorTo==="end"&&((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,q=R?this.getTotalSize():0,H=this.getScrollOffset()+this.scrollAdjustments,lt=!this.itemSizeCache.has(g)?d[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const f=[];for(let c=0,p=i.length;cthis.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const f=this._flatMeasurements,c=this.options.lanes===1&&f!=null,p=nh(0,o.length-1,c?d=>f[d*2]:d=>Id(o[d]).start,i);return Id(o[p])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,f=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),p=this.getScrollOffset();o==="auto"&&(o=i>=p+c?"end":"start"),o==="center"?i+=(f-c)/2:o==="end"&&(i-=c);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const f=this.getSize(),c=this.getScrollOffset(),p=this.measurementsCache[i];if(!p)return;if(o==="auto")if(p.end>=c+f-this.options.scrollPaddingEnd)o="end";else if(p.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?p.end+this.options.scrollPaddingEnd:p.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,p.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),p=this.now();this.scrollState={index:null,align:o,behavior:f,startedAt:p,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[p,d]=c,g=this.now();this.scrollState={index:i,align:d,behavior:f,startedAt:g,lastTargetOffset:p,stableFrames:0},this._scrollToOffset(p,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const f=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let f;if(o.length===0)f=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,p=this._flatMeasurements;p!=null?f=p[c*2]+p[c*2+1]:f=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let p=o.length-1;for(;p>=0&&c.some(d=>d===null);){const d=o[p];c[d.lane]===null&&(c[d.lane]=d.end),p--}f=Math.max(...c.filter(d=>d!==null))}return Math.max(f-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const f of o)f&&this.itemSizeCache.has(f.key)&&i.push({index:f.index,key:f.key,start:f.start,size:f.size,end:f.end,lane:f.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:f})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:f,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Cc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,f=o?o[0]:this.scrollState.lastTargetOffset,c=1,p=f!==this.scrollState.lastTargetOffset;if(!p&&cp(f,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==f&&this._scrollToOffset(f,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,p){const d=this.getSize()||600,g=Math.abs(f-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&g>d;this.scrollState.lastTargetOffset=f,m||(this.scrollState.behavior="auto"),this._scrollToOffset(f,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const nh=(y,a,i,o)=>{for(;y<=a;){const f=(y+a)/2|0,c=i(f);if(co)a=f-1;else return f}return y>0?y-1:0};function Sp(y,a,i){let o=0;for(;o<=a;){const f=(o+a)/2|0,c=y[f*2];if(ci)a=f-1;else return f}return o>0?o-1:0}function Tp(y,a,i,o,f){const c=y.length-1;if(y.length<=o)return{startIndex:0,endIndex:c};if(o===1&&f!==null){const m=Sp(f,c,i);let z=m;const _=i+a;for(;zy[m].start,i),g=d;if(o===1)for(;g1){const m=Array(o).fill(0);for(;g_=0&&z.some(_=>_>=i);){const _=y[d];z[_.lane]=_.start,d--}d=Math.max(0,d-d%o),g=Math.min(c,g+(o-1-g%o))}return{startIndex:d,endIndex:g}}const Lc=typeof document<"u"?Z.useLayoutEffect:Z.useEffect;function kp({useFlushSync:y=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const f=Z.useReducer(z=>z+1,0)[1],c=Z.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const p=z=>{const _=c.current;if(!_.enabled||!_.container)return;const R=z.getTotalSize();if(R!==_.lastSize){_.lastSize=R;const q=z.options.horizontal?"width":"height";_.container.style[q]=`${R}px`}},d=z=>{const _=c.current;if(!_.enabled||!_.container)return;p(z);const R=!!z.options.horizontal,q=_.mode==="transform",H=R?"left":"top",G=z.options.scrollMargin,lt=z.getVirtualItems();for(const Q of lt){const K=Q.start-G,I=z.elementsCache.get(Q.key);I&&_.lastPositions.get(I)!==K&&(_.lastPositions.set(I,K),q?I.style.transform=R?`translate3d(${K}px, 0, 0)`:`translate3d(0, ${K}px, 0)`:I.style[H]=`${K}px`)}},g={...o,onChange:(z,_)=>{var R;const q=c.current;let H=!0;if(q.enabled){d(z);const G=z.range,lt=q.prevRange;H=!lt||lt.isScrolling!==z.isScrolling||lt.startIndex!==G?.startIndex||lt.endIndex!==G?.endIndex,H&&(q.prevRange=G?{startIndex:G.startIndex,endIndex:G.endIndex,isScrolling:z.isScrolling}:null)}H&&(y&&_?wm.flushSync(f):f()),(R=o.onChange)==null||R.call(o,z,_)}},[m]=Z.useState(()=>{const z=new bp(g);return Object.assign(z,{containerRef:_=>{const R=c.current;if(R.container=_,R.lastSize=null,_&&R.enabled){const q=z.getTotalSize();R.lastSize=q;const H=z.options.horizontal?"width":"height";_.style[H]=`${q}px`}}})});return m.setOptions(g),Lc(()=>m._didMount(),[]),Lc(()=>(p(m),m._willUpdate())),Lc(()=>{d(m)}),m}function zp(y){return kp({observeElementRect:dp,observeElementOffset:mp,scrollToFn:vp,...y})}function ja({value:y,depth:a=0}){return y===null?v.jsx("span",{className:"value-null",children:"null"}):typeof y=="string"?v.jsx("span",{className:"value-string",children:y}):typeof y=="number"||typeof y=="boolean"?v.jsx("span",{className:"value-scalar",children:String(y)}):Array.isArray(y)?v.jsx("ol",{className:"value-list",children:y.map((i,o)=>v.jsx("li",{children:v.jsx(ja,{value:i,depth:a+1})},`${a}-${o}`))}):Qn(y)?y.kind==="predict_rlm_file"&&typeof y.path=="string"?v.jsxs("span",{className:"file-value",title:"Reported host path; contents are not copied",children:[v.jsx("span",{"aria-hidden":"true",children:"↗"}),v.jsxs("span",{children:[v.jsx("small",{children:"PredictRLM file"}),v.jsx("code",{children:y.path})]})]}):y.kind==="unavailable"&&typeof y.reason=="string"?v.jsxs("span",{className:"value-unavailable",children:["Unavailable · ",y.reason]}):v.jsx("dl",{className:"value-object",children:Object.entries(y).map(([i,o])=>v.jsxs("div",{children:[v.jsx("dt",{children:i}),v.jsx("dd",{children:v.jsx(ja,{value:o,depth:a+1})})]},i))}):v.jsx("span",{className:"value-unavailable",children:"Unavailable"})}function Hc({value:y}){return v.jsx("pre",{className:"json-block",children:JSON.stringify(y,null,2)})}function Ep(y){if(Qn(y))return Qn(y.data)?y.data:y}function Ap({api:y,workflow:a,run:i,nodeId:o,liveEvents:f=[],liveLogs:c=[],onClose:p}){const[d,g]=Z.useState("overview"),[m,z]=Z.useState([]),[_,R]=Z.useState([]),[q,H]=Z.useState(),[G,lt]=Z.useState(),[Q,K]=Z.useState(),[I,rt]=Z.useState(!0),it=Z.useRef(new Map),wt=Z.useRef(null),ut=i?.nodes.find(L=>L.nodeId===o),bt=a?th(a.agentMetadataJson[o??""]):void 0;Z.useEffect(()=>{if(g("overview"),z([]),R([]),H(void 0),lt(void 0),rt(!0),it.current.clear(),!i||!o)return;let L=!0;return Promise.all([y.listAgentEvents(i,o),y.listLogs(i)]).then(([O,U])=>{L&&(z(O),R(U.filter(V=>!V.nodeId||V.nodeId===o)))}).catch(O=>{L&&K(O instanceof Error?O.message:"Details unavailable")}),()=>{L=!1}},[y,o,i]);const Kt=Z.useMemo(()=>{const L=new Map;for(const O of[...m,...f])L.set(O.eventSequence,O);return[...L.values()].sort((O,U)=>Number(O.eventSequence)-Number(U.eventSequence))},[m,f]),Lt=Kt.filter(L=>L.eventKind==="iteration.recorded"),Qt=Z.useMemo(()=>{const L=new Map;for(const O of[..._,...c])L.set(O.sequence,O);return[...L.values()].sort((O,U)=>Number(O.sequence)-Number(U.sequence))},[c,_]),Ut=zp({count:Lt.length,getScrollElement:()=>wt.current,estimateSize:()=>64,overscan:6});if(Z.useEffect(()=>{!I||!Lt.length||H(Lt.at(-1).eventSequence)},[I,Lt]),Z.useEffect(()=>{const L=Kt.find(V=>V.eventSequence===q);if(!L?.bodyToken){lt(void 0);return}const O=it.current.get(L.bodyToken);if(O!==void 0){lt(O);return}let U=!0;return lt(void 0),K(void 0),y.readDetail(L.bodyToken).then(V=>{if(U){for(it.current.delete(L.bodyToken),it.current.set(L.bodyToken,V);it.current.size>8;){const gt=it.current.keys().next().value;if(gt===void 0)break;it.current.delete(gt)}lt(V)}}).catch(V=>{U&&K(V instanceof Error?V.message:"Detail unavailable")}),()=>{U=!1}},[y,Kt,q]),Z.useEffect(()=>{const L=d==="inputs"?"run.started":d==="output"?"run.succeeded":void 0;if(!L)return;const O=[...Kt].reverse().find(U=>U.eventKind===L);O&&H(O.eventSequence)},[Kt,d]),!i&&a&&o)return v.jsxs("aside",{className:"inspector","aria-label":"Node declaration",children:[v.jsxs("header",{children:[v.jsxs("div",{children:[v.jsx("span",{className:"eyebrow",children:"Declaration"}),v.jsx("h2",{children:a.displayNames[o]||o})]}),v.jsx("button",{type:"button",className:"icon-button",onClick:p,"aria-label":"Close",children:"×"})]}),bt?v.jsxs("div",{className:"inspector-body declaration",children:[v.jsxs("section",{children:[v.jsx("h3",{children:"Instructions"}),v.jsx("p",{className:"instructions",children:bt.instructions||"No instructions"})]}),v.jsxs("section",{className:"signature-columns",children:[v.jsxs("div",{children:[v.jsx("h3",{children:"Inputs"}),bt.inputs.map(L=>v.jsxs("div",{className:"field-detail",children:[v.jsx("strong",{children:L.name}),v.jsx("code",{children:L.type}),v.jsx("p",{children:L.description})]},L.name))]}),v.jsxs("div",{children:[v.jsx("h3",{children:"Outputs"}),bt.outputs.map(L=>v.jsxs("div",{className:"field-detail",children:[v.jsx("strong",{children:L.name}),v.jsx("code",{children:L.type}),v.jsx("p",{children:L.description})]},L.name))]})]}),v.jsxs("section",{children:[v.jsx("h3",{children:"Runtime"}),v.jsx(Hc,{value:bt.runtime})]}),v.jsxs("section",{children:[v.jsx("h3",{children:"Models"}),v.jsx(Hc,{value:bt.model})]}),v.jsxs("section",{children:[v.jsx("h3",{children:"Skills & tools"}),v.jsx(Hc,{value:{skills:bt.skills,tools:bt.tools}})]})]}):v.jsx("p",{className:"empty-copy",children:"This node has no agent declaration metadata."})]});if(!i||!ut)return null;const Zt=Ep(G),he=d==="inputs"?"inputs":"outputs";return v.jsxs("aside",{className:"inspector","aria-label":"Run inspector",children:[v.jsxs("header",{children:[v.jsxs("div",{children:[v.jsx("span",{className:"eyebrow",children:"Historical execution"}),v.jsx("h2",{children:ut.name}),v.jsx("span",{className:`status-pill status-${ut.status}`,children:ut.status})]}),v.jsx("button",{type:"button",className:"icon-button",onClick:p,"aria-label":"Close",children:"×"})]}),v.jsx("nav",{className:"inspector-tabs","aria-label":"Run detail views",children:["overview","inputs","output","trace","logs"].map(L=>v.jsx("button",{type:"button",className:d===L?"active":"",onClick:()=>g(L),children:L},L))}),v.jsxs("div",{className:"inspector-body",children:[Q&&v.jsx("p",{className:"error-banner",children:Q}),d==="overview"&&v.jsxs(v.Fragment,{children:[v.jsxs("section",{className:"metric-grid",children:[v.jsxs("div",{children:[v.jsx("small",{children:"Status"}),v.jsx("strong",{children:ut.status})]}),v.jsxs("div",{children:[v.jsx("small",{children:"Revision"}),v.jsx("strong",{children:ut.revision})]}),v.jsxs("div",{children:[v.jsx("small",{children:"Started"}),v.jsx("strong",{children:ut.startedAt?"yes":"—"})]}),v.jsxs("div",{children:[v.jsx("small",{children:"Duration"}),v.jsx("strong",{children:ut.startedAt&&ut.endedAt?`${Math.max(0,ut.endedAt-ut.startedAt).toFixed(2)}s`:"—"})]})]}),ut.error&&v.jsx("p",{className:"node-failure",children:ut.error}),ut.trace&&v.jsxs("section",{children:[v.jsx("h3",{children:"Trace header"}),v.jsxs("dl",{className:"trace-header",children:[v.jsxs("div",{children:[v.jsx("dt",{children:"Status"}),v.jsx("dd",{children:ut.trace.status})]}),v.jsxs("div",{children:[v.jsx("dt",{children:"Events"}),v.jsx("dd",{children:ut.trace.eventCount})]}),v.jsxs("div",{children:[v.jsx("dt",{children:"Size"}),v.jsxs("dd",{children:[ut.trace.sizeBytes," B"]})]}),v.jsxs("div",{children:[v.jsx("dt",{children:"Complete"}),v.jsx("dd",{children:ut.trace.complete?"yes":"no"})]})]})]})]}),(d==="inputs"||d==="output")&&v.jsxs("section",{children:[v.jsx("h3",{children:d==="inputs"?"Invocation inputs":"Terminal output"}),Zt&&he in Zt?v.jsx(ja,{value:Zt[he]}):v.jsxs("p",{className:"empty-copy",children:["No retained ",d," are available."]})]}),d==="trace"&&v.jsxs("section",{className:"trace-layout",children:[v.jsxs("div",{className:"trace-toolbar",children:[v.jsxs("div",{children:[v.jsx("h3",{children:"RunTrace"}),v.jsxs("span",{children:[Lt.length," complete turns"]})]}),v.jsx("button",{type:"button",className:I?"toggle active":"toggle",onClick:()=>rt(L=>!L),children:I?"Following live":"Follow latest"})]}),v.jsx("div",{className:"turn-list",ref:wt,children:v.jsx("div",{style:{height:Ut.getTotalSize(),position:"relative"},children:Ut.getVirtualItems().map(L=>{const O=Lt[L.index];return v.jsxs("button",{type:"button",className:`turn-row ${q===O.eventSequence?"active":""} ${O.error?"failed":""}`,style:{transform:`translateY(${L.start}px)`},onClick:()=>{rt(!1),H(O.eventSequence)},children:[v.jsxs("strong",{children:["Turn ",O.iteration??L.index+1]}),v.jsx("span",{children:O.durationMs?`${O.durationMs} ms`:"—"}),v.jsxs("small",{children:[O.toolCount," tools · ",O.predictCount," predicts"]})]},O.eventSequence)})})}),v.jsx("div",{className:"turn-detail",children:G!==void 0?v.jsx(ja,{value:G}):v.jsx("p",{className:"empty-copy",children:"Select a turn."})})]}),d==="logs"&&v.jsxs("section",{children:[v.jsx("h3",{children:"Node logs"}),v.jsx("div",{className:"log-list",children:Qt.map(L=>v.jsxs("button",{type:"button",onClick:()=>{y.readDetail(L.bodyToken).then(lt).catch(O=>{K(O instanceof Error?O.message:"Log unavailable")})},children:[v.jsx("span",{className:`log-level level-${L.level}`,children:L.level}),v.jsx("time",{children:new Date(L.timestamp*1e3).toLocaleTimeString()}),v.jsxs("span",{children:["#",L.sequence]})]},L.sequence))}),G!==void 0&&v.jsx(ja,{value:G})]})]})]})}function Np({value:y,onChange:a}){const i=Z.useRef(null);return Z.useEffect(()=>{if(!i.current)return;const o=new Ii({parent:i.current,state:qm.create({doc:y,extensions:[Cm(),Lm.of([]),Ii.lineWrapping,Ii.theme({"&":{backgroundColor:"#0e1112",color:"#dce4df"},".cm-content":{caretColor:"#eeff8c",minHeight:"110px"},".cm-gutters":{backgroundColor:"#0e1112",color:"#626b67",border:"0"},"&.cm-focused":{outline:"1px solid #778357"}}),Ii.updateListener.of(f=>{f.docChanged&&a(f.state.doc.toString())})]})});return()=>o.destroy()},[]),v.jsx("div",{className:"json-editor",ref:i})}function Op({workflow:y,run:a,pending:i,onStart:o,onCancel:f}){const[c,p]=Z.useState(!1),[d,g]=Z.useState("{}"),[m,z]=Z.useState(),_=a?.summary?.status==="pending"||a?.summary?.status==="running",R=async()=>{if(!y)return;z(void 0);let q;if(c)try{const H=JSON.parse(d);if(!Qn(H))throw new Error("Run input must be a JSON object");q=H}catch(H){z(H instanceof Error?H.message:"Run input is invalid JSON");return}try{await o(y.workflowId,q)}catch(H){z(H instanceof Error?H.message:"Operator rejected the run")}};return v.jsxs("div",{className:"run-controls",children:[y&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",className:"run-button",disabled:i?.kind==="start",onClick:()=>{R()},children:i?.kind==="start"?"Requesting…":"Run"}),v.jsx("button",{type:"button",className:`input-toggle ${c?"active":""}`,onClick:()=>p(q=>!q),children:c?"Hide JSON input":"Add JSON input"})]}),_&&a?.summary&&v.jsx("button",{type:"button",className:"cancel-button",disabled:i?.kind==="cancel",onClick:()=>{z(void 0),f(a.summary.runId).catch(q=>{z(q instanceof Error?q.message:"Cancellation failed")})},children:i?.kind==="cancel"?"Cancelling…":"Cancel run"}),c&&y&&v.jsxs("div",{className:"input-popover",children:[v.jsxs("div",{children:[v.jsx("strong",{children:"Workflow input"}),v.jsx("span",{children:"Schema-blind JSON object"})]}),v.jsx(Np,{value:d,onChange:g})]}),m&&v.jsx("div",{className:"action-error",children:m})]})}const lh={runs:{},liveEvents:{},liveLogs:{},operatorInstanceId:"",sequence:"0",connection:"connecting"};function Dp(y,a){if(a.type==="baseline"){const g=Object.fromEntries(a.baseline.runs.filter(m=>m.summary).map(m=>[m.summary.runId,m]));return{...lh,catalog:a.baseline.catalog,runs:g,operatorInstanceId:a.baseline.catalog.operatorInstanceId,sequence:a.baseline.asOfSequence,connection:"live"}}if(a.type==="connection")return{...y,connection:a.connection,error:a.error};if(a.type==="action")return{...y,action:a.action};const{envelope:i}=a;if(i.operatorInstanceId!==y.operatorInstanceId)throw new Error("Operator epoch changed");if(i.payload.oneofKind!=="update")throw new Error("Operator requested a structural reset");const o=i.payload.update;if(BigInt(o.sequence)!==BigInt(y.sequence)+1n)throw new Error(`Operator update gap after sequence ${y.sequence}`);const f={...y,sequence:o.sequence,error:void 0},c=o.change;if(c.oneofKind==="catalogReplaced")return c.catalogReplaced.catalog&&(f.catalog=c.catalogReplaced.catalog),f;if(c.oneofKind==="runCreated"&&c.runCreated.summary){const g=c.runCreated.summary;return f.runs={...y.runs,[g.runId]:{operatorInstanceId:y.operatorInstanceId,asOfSequence:o.sequence,summary:g,nodes:c.runCreated.nodes,latestLogSequence:"0",logPageToken:"",topology:c.runCreated.topology}},f}const p=c.oneofKind==="runStatusChanged"?c.runStatusChanged.runId:c.oneofKind==="nodeStatusChanged"?c.nodeStatusChanged.runId:c.oneofKind==="logAppended"?c.logAppended.runId:c.oneofKind==="agentEventAppended"?c.agentEventAppended.runId:c.oneofKind==="traceFinalized"?c.traceFinalized.runId:"",d=y.runs[p];if(!d)throw new Error(`Operator update referenced unknown run ${p}`);if(c.oneofKind==="runStatusChanged"&&d.summary)f.runs={...y.runs,[p]:{...d,summary:{...d.summary,status:c.runStatusChanged.status,startedAt:c.runStatusChanged.startedAt,endedAt:c.runStatusChanged.endedAt,revision:c.runStatusChanged.revision}}};else if(c.oneofKind==="nodeStatusChanged"){const g=c.nodeStatusChanged;f.runs={...y.runs,[p]:{...d,nodes:d.nodes.map(m=>m.nodeId===g.nodeId?{...m,status:g.status,startedAt:g.startedAt,endedAt:g.endedAt,revision:g.revision,error:g.error}:m)}}}else if(c.oneofKind==="logAppended"&&c.logAppended.log)f.liveLogs={...y.liveLogs,[p]:[...y.liveLogs[p]??[],c.logAppended.log]};else if(c.oneofKind==="agentEventAppended"&&c.agentEventAppended.event){const g=`${p}:${c.agentEventAppended.nodeId}`;f.liveEvents={...y.liveEvents,[g]:[...y.liveEvents[g]??[],c.agentEventAppended.event]}}else c.oneofKind==="traceFinalized"&&c.traceFinalized.trace&&(f.runs={...y.runs,[p]:{...d,nodes:d.nodes.map(g=>g.nodeId===c.traceFinalized.nodeId?{...g,trace:c.traceFinalized.trace}:g)}});return f}function xp(y){const[a,i]=Z.useReducer(Dp,lh),o=Z.useRef(0),f=Z.useCallback(async()=>{const d=await y.loadBaseline();return i({type:"baseline",baseline:d}),d},[y]);Z.useEffect(()=>{const d=++o.current;let g=!1;return(async()=>{let z=250;for(;!g&&o.current===d;)try{i({type:"connection",connection:"connecting"});const _=await y.loadBaseline();if(g)return;i({type:"baseline",baseline:_}),z=250;let R=_.asOfSequence;for await(const q of y.streamUpdates(_.catalog.operatorInstanceId,R)){if(g)return;if(q.payload.oneofKind!=="update"||BigInt(q.payload.update.sequence)!==BigInt(R)+1n)break;i({type:"envelope",envelope:q}),R=q.payload.update.sequence}i({type:"connection",connection:"reconnecting"})}catch(_){if(g)return;i({type:"connection",connection:"reconnecting",error:_ instanceof Error?_.message:"Operator connection failed"});const{promise:R,resolve:q}=Promise.withResolvers();window.setTimeout(q,z),await R,z=Math.min(z*2,4e3)}})(),()=>{g=!0,o.current+=1}},[y]);const c=Z.useCallback(async(d,g)=>{i({type:"action",action:{kind:"start",target:d}});try{return await y.startRun(d,g)}finally{i({type:"action",action:void 0})}},[y]),p=Z.useCallback(async d=>{i({type:"action",action:{kind:"cancel",target:d}});try{await y.cancelRun(d)}finally{i({type:"action",action:void 0})}},[y]);return{state:a,reconcile:f,startRun:c,cancelRun:p}}function _p({api:y}){const{state:a,startRun:i,cancelRun:o}=xp(y),[f,c]=Z.useState(),[p,d]=Z.useState();Z.useEffect(()=>{const G=a.catalog?.workflows??[];if(!G.length){c(void 0);return}if(!f){c({kind:"workflow",workflowId:G[0].workflowId});return}G.some(lt=>lt.workflowId===f.workflowId)||c({kind:"workflow",workflowId:G[0].workflowId})},[f,a.catalog]);const g=a.catalog?.workflows.find(G=>G.workflowId===f?.workflowId),m=f?.kind==="run"?a.runs[f.runId]:void 0,z=Z.useMemo(()=>Object.values(a.runs).filter(G=>G.summary?.workflowId===g?.workflowId).sort((G,lt)=>Number(lt.summary.createdSequence)-Number(G.summary.createdSequence))[0],[a.runs,g?.workflowId]),_=Z.useCallback(G=>d(G),[]),R=Z.useCallback(G=>{c(G),d(void 0)},[]),q=m??(f?.kind==="workflow"?z:void 0),H=m&&p?`${m.summary?.runId}:${p}`:"";return v.jsxs("div",{className:"app-shell",children:[v.jsxs("header",{className:"topbar",children:[v.jsxs("div",{className:"brand",children:[v.jsx("span",{className:"brand-mark","aria-hidden":"true",children:"A"}),v.jsxs("div",{children:[v.jsx("strong",{children:"Avalanche"}),v.jsx("span",{children:"Operator"})]})]}),v.jsxs("div",{className:"breadcrumb",children:[v.jsx("span",{children:g?.rootAlias||"Local operator"}),g&&v.jsxs(v.Fragment,{children:[v.jsx("i",{children:"/"}),v.jsx("strong",{children:g.displayName})]}),m?.summary&&v.jsxs(v.Fragment,{children:[v.jsx("i",{children:"/"}),v.jsx("strong",{children:m.summary.runId})]})]}),v.jsxs("div",{className:`connection connection-${a.connection}`,children:[v.jsx("span",{}),a.connection==="live"?"Live":a.connection,v.jsxs("small",{children:["seq ",a.sequence]})]})]}),a.error&&v.jsx("div",{className:"connection-error",children:a.error}),v.jsxs("main",{className:`workspace ${p?"with-inspector":""}`,children:[v.jsx(lp,{catalog:a.catalog,runs:a.runs,selection:f,onSelect:R}),v.jsxs("section",{className:"canvas-shell",children:[v.jsxs("header",{className:"view-header",children:[v.jsxs("div",{children:[v.jsx("span",{className:"eyebrow",children:m?"Historical run":"Current definition"}),v.jsx("h1",{children:m?.summary?.runId||g?.displayName||"Operator"}),v.jsx("p",{children:m?`Recorded topology · ${m.summary?.status??"unknown"}`:g?`${g.nodeIds.length} nodes · ${g.relativeFile}`:"Waiting for a workflow catalog"})]}),v.jsx(Op,{workflow:m?void 0:g,run:m??q,pending:a.action,onStart:i,onCancel:o})]}),v.jsxs("div",{className:m?"canvas run-canvas":"canvas blueprint-canvas",children:[g||m?.topology?v.jsx(up,{workflow:m?void 0:g,runTopology:m?.topology,runNodes:m?.nodes,onOpenNode:_}):v.jsxs("div",{className:"empty-state",children:[v.jsx("span",{children:"◇"}),v.jsx("h2",{children:"No workflows discovered"}),v.jsx("p",{children:"Catalog changes will appear here as the operator scans configured targets."})]}),m&&v.jsxs("div",{className:"historical-badge",children:[v.jsx("span",{children:"Immutable run snapshot"}),"Current workflow changes do not alter this canvas"]})]})]}),p&&v.jsx(Ap,{api:y,workflow:g,run:m,nodeId:p,liveEvents:a.liveEvents[H],liveLogs:m?.summary?a.liveLogs[m.summary.runId]:void 0,onClose:()=>d(void 0)})]})]})}const ah=document.getElementById("root");if(!ah)throw new Error("Operator UI root element is missing");Xm.createRoot(ah).render(v.jsx(Z.StrictMode,{children:v.jsx(_p,{api:new Py})})); diff --git a/src/runtime/operator/web_assets/assets/protobuf-BR9ifi4u.js b/src/runtime/operator/web_assets/assets/protobuf-BR9ifi4u.js new file mode 100644 index 0000000..930ab2a --- /dev/null +++ b/src/runtime/operator/web_assets/assets/protobuf-BR9ifi4u.js @@ -0,0 +1,4 @@ +function ge(r){let e=typeof r;if(e=="object"){if(Array.isArray(r))return"array";if(r===null)return"null"}return e}function Be(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}let v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Y=[];for(let r=0;r>4,a=s,i=2;break;case 2:t[n++]=(a&15)<<4|(s&60)>>2,a=s,i=3;break;case 3:t[n++]=(a&3)<<6|s,i=0;break}}if(i==1)throw Error("invalid base64 string.");return t.subarray(0,n)}function Ne(r){let e="",t=0,n,i=0;for(let s=0;s>2],i=(n&3)<<4,t=1;break;case 1:e+=v[i|n>>4],i=(n&15)<<2,t=2;break;case 2:e+=v[i|n>>6],e+=v[n&63],t=0;break}return t&&(e+=v[i],e+="=",t==1&&(e+="=")),e}var q;(function(r){r.symbol=Symbol.for("protobuf-ts/unknown"),r.onRead=(t,n,i,s,a)=>{(e(n)?n[r.symbol]:n[r.symbol]=[]).push({no:i,wireType:s,data:a})},r.onWrite=(t,n,i)=>{for(let{no:s,wireType:a,data:o}of r.list(n))i.tag(s,a).raw(o)},r.list=(t,n)=>{if(e(t)){let i=t[r.symbol];return n?i.filter(s=>s.no==n):i}return[]},r.last=(t,n)=>r.list(t,n).slice(-1)[0];const e=t=>t&&Array.isArray(t[r.symbol])})(q||(q={}));function Le(r,e){return Object.assign(Object.assign({},r),e)}var I;(function(r){r[r.Varint=0]="Varint",r[r.Bit64=1]="Bit64",r[r.LengthDelimited=2]="LengthDelimited",r[r.StartGroup=3]="StartGroup",r[r.EndGroup=4]="EndGroup",r[r.Bit32=5]="Bit32"})(I||(I={}));function Fe(){let r=0,e=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(r|=(i&127)<>4,(t&128)==0)return this.assertBounds(),[r,e];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(e|=(i&127)<>>s,o=!(!(a>>>7)&&e==0),f=(o?a|128:a)&255;if(t.push(f),!o)return}const n=r>>>28&15|(e&7)<<4,i=e>>3!=0;if(t.push((i?n|128:n)&255),!!i){for(let s=3;s<31;s=s+7){const a=e>>>s,o=!!(a>>>7),f=(o?a|128:a)&255;if(t.push(f),!o)return}t.push(e>>>31&1)}}const J=65536*65536;function we(r){let e=r[0]=="-";e&&(r=r.slice(1));const t=1e6;let n=0,i=0;function s(a,o){const f=Number(r.slice(a,o));i*=t,n=n*t+f,n>=J&&(i=i+(n/J|0),n=n%J)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),[e,n,i]}function Q(r,e){if(e>>>0<=2097151)return""+(J*e+(r>>>0));let t=r&16777215,n=(r>>>24|e<<8)>>>0&16777215,i=e>>16&65535,s=t+n*6777216+i*6710656,a=n+i*8147497,o=i*2,f=1e7;s>=f&&(a+=Math.floor(s/f),s%=f),a>=f&&(o+=Math.floor(a/f),a%=f);function u(c,d){let m=c?String(c):"";return d?"0000000".slice(m.length)+m:m}return u(o,0)+u(a,o)+u(s,1)}function ie(r,e){if(r>=0){for(;r>127;)e.push(r&127|128),r=r>>>7;e.push(r)}else{for(let t=0;t<9;t++)e.push(r&127|128),r=r>>7;e.push(1)}}function Re(){let r=this.buf[this.pos++],e=r&127;if((r&128)==0)return this.assertBounds(),e;if(r=this.buf[this.pos++],e|=(r&127)<<7,(r&128)==0)return this.assertBounds(),e;if(r=this.buf[this.pos++],e|=(r&127)<<14,(r&128)==0)return this.assertBounds(),e;if(r=this.buf[this.pos++],e|=(r&127)<<21,(r&128)==0)return this.assertBounds(),e;r=this.buf[this.pos++],e|=(r&15)<<28;for(let t=5;(r&128)!==0&&t<10;t++)r=this.buf[this.pos++];if((r&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}let w;function _e(){const r=new DataView(new ArrayBuffer(8));w=globalThis.BigInt!==void 0&&typeof r.getBigInt64=="function"&&typeof r.getBigUint64=="function"&&typeof r.setBigInt64=="function"&&typeof r.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:r}:void 0}_e();function Ee(r){if(!r)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const Ie=/^-?[0-9]+$/,W=4294967296,X=2147483648;class ye{constructor(e,t){this.lo=e|0,this.hi=t|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let e=this.hi*W+(this.lo>>>0);if(!Number.isSafeInteger(e))throw new Error("cannot convert to safe number");return e}}class D extends ye{static from(e){if(w)switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=="")throw new Error("string is no integer");e=w.C(e);case"number":if(e===0)return this.ZERO;e=w.C(e);case"bigint":if(!e)return this.ZERO;if(ew.UMAX)throw new Error("ulong too large");return w.V.setBigUint64(0,e,!0),new D(w.V.getInt32(0,!0),w.V.getInt32(4,!0))}else switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=e.trim(),!Ie.test(e))throw new Error("string is no integer");let[t,n,i]=we(e);if(t)throw new Error("signed value for ulong");return new D(n,i);case"number":if(e==0)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");if(e<0)throw new Error("signed value for ulong");return new D(e,e/W)}throw new Error("unknown value "+typeof e)}toString(){return w?this.toBigInt().toString():Q(this.lo,this.hi)}toBigInt(){return Ee(w),w.V.setInt32(0,this.lo,!0),w.V.setInt32(4,this.hi,!0),w.V.getBigUint64(0,!0)}}D.ZERO=new D(0,0);class y extends ye{static from(e){if(w)switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=="")throw new Error("string is no integer");e=w.C(e);case"number":if(e===0)return this.ZERO;e=w.C(e);case"bigint":if(!e)return this.ZERO;if(ew.MAX)throw new Error("signed long too large");return w.V.setBigInt64(0,e,!0),new y(w.V.getInt32(0,!0),w.V.getInt32(4,!0))}else switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=e.trim(),!Ie.test(e))throw new Error("string is no integer");let[t,n,i]=we(e);if(t){if(i>X||i==X&&n!=0)throw new Error("signed long too small")}else if(i>=X)throw new Error("signed long too large");let s=new y(n,i);return t?s.negate():s;case"number":if(e==0)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");return e>0?new y(e,e/W):new y(-e,-e/W).negate()}throw new Error("unknown value "+typeof e)}isNegative(){return(this.hi&X)!==0}negate(){let e=~this.hi,t=this.lo;return t?t=~t+1:e+=1,new y(t,e)}toString(){if(w)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return"-"+Q(e.lo,e.hi)}return Q(this.lo,this.hi)}toBigInt(){return Ee(w),w.V.setInt32(0,this.lo,!0),w.V.setInt32(4,this.hi,!0),w.V.getBigInt64(0,!0)}}y.ZERO=new y(0,0);const se={readUnknownField:!0,readerFactory:r=>new Ue(r)};function xe(r){return r?Object.assign(Object.assign({},se),r):se}class Ue{constructor(e,t){this.varint64=Fe,this.uint32=Re,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e){let t=this.pos;switch(e){case I.Varint:for(;this.buf[this.pos++]&128;);break;case I.Bit64:this.pos+=4;case I.Bit32:this.pos+=4;break;case I.LengthDelimited:let n=this.uint32();this.pos+=n;break;case I.StartGroup:let i;for(;(i=this.tag()[1])!==I.EndGroup;)this.skip(i);break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(t,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return new y(...this.varint64())}uint64(){return new D(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,new y(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new D(this.sfixed32(),this.sfixed32())}sfixed64(){return new y(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}}function g(r,e){if(!r)throw new Error(e)}function Se(r,e){throw new Error("Unexpected object: "+r)}const Ve=34028234663852886e22,ve=-34028234663852886e22,Me=4294967295,Pe=2147483647,je=-2147483648;function K(r){if(typeof r!="number")throw new Error("invalid int 32: "+typeof r);if(!Number.isInteger(r)||r>Pe||rMe||r<0)throw new Error("invalid uint 32: "+r)}function re(r){if(typeof r!="number")throw new Error("invalid float 32: "+typeof r);if(Number.isFinite(r)&&(r>Ve||rnew Xe};function Ke(r){return r?Object.assign(Object.assign({},ae),r):ae}class Xe{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Z(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return K(e),ie(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){re(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){Z(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){K(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return K(e),e=(e<<1^e>>31)>>>0,ie(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),i=y.from(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),i=D.from(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(t)}int64(e){let t=y.from(e);return H(t.lo,t.hi,this.buf),this}sint64(e){let t=y.from(e),n=t.hi>>31,i=t.lo<<1^n,s=(t.hi<<1|t.lo>>>31)^n;return H(i,s,this.buf),this}uint64(e){let t=D.from(e);return H(t.lo,t.hi,this.buf),this}}const oe={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},fe={ignoreUnknownFields:!1};function $e(r){return r?Object.assign(Object.assign({},fe),r):fe}function Ce(r){return r?Object.assign(Object.assign({},oe),r):oe}function Je(r,e){var t,n;let i=Object.assign(Object.assign({},r),e);return i.typeRegistry=[...(t=r?.typeRegistry)!==null&&t!==void 0?t:[],...(n=e?.typeRegistry)!==null&&n!==void 0?n:[]],i}const Te=Symbol.for("protobuf-ts/message-type");function ee(r){let e=!1;const t=[];for(let n=0;n!i.includes(a))||!n&&i.some(a=>!s.known.includes(a)))return!1;if(t<1)return!0;for(const a of s.oneofs){const o=e[a];if(!We(o))return!1;if(o.oneofKind===void 0)continue;const f=this.fields.find(u=>u.localName===o.oneofKind);if(!f||!this.field(o[o.oneofKind],f,n,t))return!1}for(const a of this.fields)if(a.oneof===void 0&&!this.field(e[a.localName],a,n,t))return!1;return!0}field(e,t,n,i){let s=t.repeat;switch(t.kind){case"scalar":return e===void 0?t.opt:s?this.scalars(e,t.T,i,t.L):this.scalar(e,t.T,t.L);case"enum":return e===void 0?t.opt:s?this.scalars(e,l.INT32,i):this.scalar(e,l.INT32);case"message":return e===void 0?!0:s?this.messages(e,t.T(),n,i):this.message(e,t.T(),n,i);case"map":if(typeof e!="object"||e===null)return!1;if(i<2)return!0;if(!this.mapKeys(e,t.K,i))return!1;switch(t.V.kind){case"scalar":return this.scalars(Object.values(e),t.V.T,i,t.V.L);case"enum":return this.scalars(Object.values(e),l.INT32,i);case"message":return this.messages(Object.values(e),t.V.T(),n,i)}break}return!0}message(e,t,n,i){return n?t.isAssignable(e,i):t.is(e,i)}messages(e,t,n,i){if(!Array.isArray(e))return!1;if(i<2)return!0;if(n){for(let s=0;sparseInt(s)),t,n);case l.BOOL:return this.scalars(i.slice(0,n).map(s=>s=="true"?!0:s=="false"?!1:s),t,n);default:return this.scalars(i,t,n,U.STRING)}}}function F(r,e){switch(e){case U.BIGINT:return r.toBigInt();case U.NUMBER:return r.toNumber();default:return r.toString()}}class Ge{constructor(e){this.info=e}prepare(){var e;if(this.fMap===void 0){this.fMap={};const t=(e=this.info.fields)!==null&&e!==void 0?e:[];for(const n of t)this.fMap[n.name]=n,this.fMap[n.jsonName]=n,this.fMap[n.localName]=n}}assert(e,t,n){if(!e){let i=ge(n);throw(i=="number"||i=="boolean")&&(i=n.toString()),new Error(`Cannot parse JSON ${i} for ${this.info.typeName}#${t}`)}}read(e,t,n){this.prepare();const i=[];for(const[s,a]of Object.entries(e)){const o=this.fMap[s];if(!o){if(!n.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${s}`);continue}const f=o.localName;let u;if(o.oneof){if(a===null&&(o.kind!=="enum"||o.T()[0]!=="google.protobuf.NullValue"))continue;if(i.includes(o.oneof))throw new Error(`Multiple members of the oneof group "${o.oneof}" of ${this.info.typeName} are present in JSON.`);i.push(o.oneof),u=t[o.oneof]={oneofKind:f}}else u=t;if(o.kind=="map"){if(a===null)continue;this.assert(Be(a),o.name,a);const c=u[f];for(const[d,m]of Object.entries(a)){this.assert(m!==null,o.name+" map value",null);let E;switch(o.V.kind){case"message":E=o.V.T().internalJsonRead(m,n);break;case"enum":if(E=this.enum(o.V.T(),m,o.name,n.ignoreUnknownFields),E===!1)continue;break;case"scalar":E=this.scalar(m,o.V.T,o.V.L,o.name);break}this.assert(E!==void 0,o.name+" map value",m);let k=d;o.K==l.BOOL&&(k=k=="true"?!0:k=="false"?!1:k),k=this.scalar(k,o.K,U.STRING,o.name).toString(),c[k]=E}}else if(o.repeat){if(a===null)continue;this.assert(Array.isArray(a),o.name,a);const c=u[f];for(const d of a){this.assert(d!==null,o.name,null);let m;switch(o.kind){case"message":m=o.T().internalJsonRead(d,n);break;case"enum":if(m=this.enum(o.T(),d,o.name,n.ignoreUnknownFields),m===!1)continue;break;case"scalar":m=this.scalar(d,o.T,o.L,o.name);break}this.assert(m!==void 0,o.name,a),c.push(m)}}else switch(o.kind){case"message":if(a===null&&o.T().typeName!="google.protobuf.Value"){this.assert(o.oneof===void 0,o.name+" (oneof member)",null);continue}u[f]=o.T().internalJsonRead(a,n,u[f]);break;case"enum":if(a===null)continue;let c=this.enum(o.T(),a,o.name,n.ignoreUnknownFields);if(c===!1)continue;u[f]=c;break;case"scalar":if(a===null)continue;u[f]=this.scalar(a,o.T,o.L,o.name);break}}}enum(e,t,n,i){if(e[0]=="google.protobuf.NullValue"&&g(t===null||t==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} only accepts null.`),t===null)return 0;switch(typeof t){case"number":return g(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${n}, enum can only be integral number, got ${t}.`),t;case"string":let s=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(s=t.substring(e[2].length));let a=e[1][s];return typeof a>"u"&&i?!1:(g(typeof a=="number",`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} has no value for "${t}".`),a)}g(!1,`Unable to parse field ${this.info.typeName}#${n}, cannot parse enum value from ${typeof t}".`)}scalar(e,t,n,i){let s;try{switch(t){case l.DOUBLE:case l.FLOAT:if(e===null)return 0;if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""){s="empty string";break}if(typeof e=="string"&&e.trim().length!==e.length){s="extra whitespace";break}if(typeof e!="string"&&typeof e!="number")break;let a=Number(e);if(Number.isNaN(a)){s="not a number";break}if(!Number.isFinite(a)){s="too large or small";break}return t==l.FLOAT&&re(a),a;case l.INT32:case l.FIXED32:case l.SFIXED32:case l.SINT32:case l.UINT32:if(e===null)return 0;let o;if(typeof e=="number"?o=e:e===""?s="empty string":typeof e=="string"&&(e.trim().length!==e.length?s="extra whitespace":o=Number(e)),o===void 0)break;return t==l.UINT32?Z(o):K(o),o;case l.INT64:case l.SFIXED64:case l.SINT64:if(e===null)return F(y.ZERO,n);if(typeof e!="number"&&typeof e!="string")break;return F(y.from(e),n);case l.FIXED64:case l.UINT64:if(e===null)return F(D.ZERO,n);if(typeof e!="number"&&typeof e!="string")break;return F(D.from(e),n);case l.BOOL:if(e===null)return!1;if(typeof e!="boolean")break;return e;case l.STRING:if(e===null)return"";if(typeof e!="string"){s="extra whitespace";break}try{encodeURIComponent(e)}catch(f){f="invalid UTF8";break}return e;case l.BYTES:if(e===null||e==="")return new Uint8Array(0);if(typeof e!="string")break;return pe(e)}}catch(a){s=a.message}this.assert(!1,i+(s?" - "+s:""),e)}}class Ye{constructor(e){var t;this.fields=(t=e.fields)!==null&&t!==void 0?t:[]}write(e,t){const n={},i=e;for(const s of this.fields){if(!s.oneof){let u=this.field(s,i[s.localName],t);u!==void 0&&(n[t.useProtoFieldName?s.name:s.jsonName]=u);continue}const a=i[s.oneof];if(a.oneofKind!==s.localName)continue;const o=s.kind=="scalar"||s.kind=="enum"?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t;let f=this.field(s,a[s.localName],o);g(f!==void 0),n[t.useProtoFieldName?s.name:s.jsonName]=f}return n}field(e,t,n){let i;if(e.kind=="map"){g(typeof t=="object"&&t!==null);const s={};switch(e.V.kind){case"scalar":for(const[f,u]of Object.entries(t)){const c=this.scalar(e.V.T,u,e.name,!1,!0);g(c!==void 0),s[f.toString()]=c}break;case"message":const a=e.V.T();for(const[f,u]of Object.entries(t)){const c=this.message(a,u,e.name,n);g(c!==void 0),s[f.toString()]=c}break;case"enum":const o=e.V.T();for(const[f,u]of Object.entries(t)){g(u===void 0||typeof u=="number");const c=this.enum(o,u,e.name,!1,!0,n.enumAsInteger);g(c!==void 0),s[f.toString()]=c}break}(n.emitDefaultValues||Object.keys(s).length>0)&&(i=s)}else if(e.repeat){g(Array.isArray(t));const s=[];switch(e.kind){case"scalar":for(let f=0;f0||n.emitDefaultValues)&&(i=s)}else switch(e.kind){case"scalar":i=this.scalar(e.T,t,e.name,e.opt,n.emitDefaultValues);break;case"enum":i=this.enum(e.T(),t,e.name,e.opt,n.emitDefaultValues,n.enumAsInteger);break;case"message":i=this.message(e.T(),t,e.name,n);break}return i}enum(e,t,n,i,s,a){if(e[0]=="google.protobuf.NullValue")return!s&&!i?void 0:null;if(t===void 0){g(i);return}if(!(t===0&&!s&&!i))return g(typeof t=="number"),g(Number.isInteger(t)),a||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}message(e,t,n,i){return t===void 0?i.emitDefaultValues?null:void 0:e.internalJsonWrite(t,i)}scalar(e,t,n,i,s){if(t===void 0){g(i);return}const a=s||i;switch(e){case l.INT32:case l.SFIXED32:case l.SINT32:return t===0?a?0:void 0:(K(t),t);case l.FIXED32:case l.UINT32:return t===0?a?0:void 0:(Z(t),t);case l.FLOAT:re(t);case l.DOUBLE:return t===0?a?0:void 0:(g(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t);case l.STRING:return t===""?a?"":void 0:(g(typeof t=="string"),t);case l.BOOL:return t===!1?a?!1:void 0:(g(typeof t=="boolean"),t);case l.UINT64:case l.FIXED64:g(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let o=D.from(t);return o.isZero()&&!a?void 0:o.toString();case l.INT64:case l.SFIXED64:case l.SINT64:g(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let f=y.from(t);return f.isZero()&&!a?void 0:f.toString();case l.BYTES:return g(t instanceof Uint8Array),t.byteLength?Ne(t):a?"":void 0}}}function te(r,e=U.STRING){switch(r){case l.BOOL:return!1;case l.UINT64:case l.FIXED64:return F(D.ZERO,e);case l.INT64:case l.SFIXED64:case l.SINT64:return F(y.ZERO,e);case l.DOUBLE:case l.FLOAT:return 0;case l.BYTES:return new Uint8Array(0);case l.STRING:return"";default:return 0}}class He{constructor(e){this.info=e}prepare(){var e;if(!this.fieldNoToField){const t=(e=this.info.fields)!==null&&e!==void 0?e:[];this.fieldNoToField=new Map(t.map(n=>[n.no,n]))}}read(e,t,n,i){this.prepare();const s=i===void 0?e.len:e.pos+i;for(;e.post.no-n.no)}}write(e,t,n){this.prepare();for(const s of this.fields){let a,o,f=s.repeat,u=s.localName;if(s.oneof){const c=e[s.oneof];if(c.oneofKind!==u)continue;a=c[u],o=!0}else a=e[u],o=!1;switch(s.kind){case"scalar":case"enum":let c=s.kind=="enum"?l.INT32:s.T;if(f)if(g(Array.isArray(a)),f==G.PACKED)this.packed(t,c,s.no,a);else for(const d of a)this.scalar(t,c,s.no,d,!0);else a===void 0?g(s.opt):this.scalar(t,c,s.no,a,o||s.opt);break;case"message":if(f){g(Array.isArray(a));for(const d of a)this.message(t,n,s.T(),s.no,d)}else this.message(t,n,s.T(),s.no,a);break;case"map":g(typeof a=="object"&&a!==null);for(const[d,m]of Object.entries(a))this.mapEntry(t,n,s,d,m);break}}let i=n.writeUnknownFields;i!==!1&&(i===!0?q.onWrite:i)(this.info.typeName,e,t)}mapEntry(e,t,n,i,s){e.tag(n.no,I.LengthDelimited),e.fork();let a=i;switch(n.K){case l.INT32:case l.FIXED32:case l.UINT32:case l.SFIXED32:case l.SINT32:a=Number.parseInt(i);break;case l.BOOL:g(i=="true"||i=="false"),a=i=="true";break}switch(this.scalar(e,n.K,1,a,!0),n.V.kind){case"scalar":this.scalar(e,n.V.T,2,s,!0);break;case"enum":this.scalar(e,l.INT32,2,s,!0);break;case"message":this.message(e,t,n.V.T(),2,s);break}e.join()}message(e,t,n,i,s){s!==void 0&&(n.internalBinaryWrite(s,e.tag(i,I.LengthDelimited).fork(),t),e.join())}scalar(e,t,n,i,s){let[a,o,f]=this.scalarInfo(t,i);(!f||s)&&(e.tag(n,a),e[o](i))}packed(e,t,n,i){if(!i.length)return;g(t!==l.BYTES&&t!==l.STRING),e.tag(n,I.LengthDelimited),e.fork();let[,s]=this.scalarInfo(t);for(let a=0;ant(i,this)),this.options=n??{}}}class N extends Error{constructor(e,t="UNKNOWN",n){super(e),this.name="RpcError",Object.setPrototypeOf(this,new.target.prototype),this.code=t,this.meta=n??{}}toString(){const e=[this.name+": "+this.message];this.code&&(e.push(""),e.push("Code: "+this.code)),this.serviceName&&this.methodName&&e.push("Method: "+this.serviceName+"/"+this.methodName);let t=Object.entries(this.meta);if(t.length){e.push(""),e.push("Meta:");for(let[n,i]of t)e.push(` ${n}: ${i}`)}return e.join(` +`)}}function rt(r,e){if(!e)return r;let t={};C(r,t),C(e,t);for(let n of Object.keys(e)){let i=e[n];switch(n){case"jsonOptions":t.jsonOptions=Je(r.jsonOptions,t.jsonOptions);break;case"binaryOptions":t.binaryOptions=Le(r.binaryOptions,t.binaryOptions);break;case"meta":t.meta={},C(r.meta,t.meta),C(e.meta,t.meta);break;case"interceptors":t.interceptors=r.interceptors?r.interceptors.concat(i):i.concat();break}}return t}function C(r,e){if(!r)return;let t=e;for(let[n,i]of Object.entries(r))i instanceof Date?t[n]=new Date(i.getTime()):Array.isArray(i)?t[n]=i.concat():t[n]=i}var L;(function(r){r[r.PENDING=0]="PENDING",r[r.REJECTED=1]="REJECTED",r[r.RESOLVED=2]="RESOLVED"})(L||(L={}));class M{constructor(e=!0){this._state=L.PENDING,this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n}),e&&this._promise.catch(t=>{})}get state(){return this._state}get promise(){return this._promise}resolve(e){if(this.state!==L.PENDING)throw new Error(`cannot resolve ${L[this.state].toLowerCase()}`);this._resolve(e),this._state=L.RESOLVED}reject(e){if(this.state!==L.PENDING)throw new Error(`cannot reject ${L[this.state].toLowerCase()}`);this._reject(e),this._state=L.REJECTED}resolvePending(e){this._state===L.PENDING&&this.resolve(e)}rejectPending(e){this._state===L.PENDING&&this.reject(e)}}class it{constructor(){this._lis={nxt:[],msg:[],err:[],cmp:[]},this._closed=!1,this._itState={q:[]}}onNext(e){return this.addLis(e,this._lis.nxt)}onMessage(e){return this.addLis(e,this._lis.msg)}onError(e){return this.addLis(e,this._lis.err)}onComplete(e){return this.addLis(e,this._lis.cmp)}addLis(e,t){return t.push(e),()=>{let n=t.indexOf(e);n>=0&&t.splice(n,1)}}clearLis(){for(let e of Object.values(this._lis))e.splice(0,e.length)}get closed(){return this._closed!==!1}notifyNext(e,t,n){g((e?1:0)+(t?1:0)+(n?1:0)<=1,"only one emission at a time"),e&&this.notifyMessage(e),t&&this.notifyError(t),n&&this.notifyComplete()}notifyMessage(e){g(!this.closed,"stream is closed"),this.pushIt({value:e,done:!1}),this._lis.msg.forEach(t=>t(e)),this._lis.nxt.forEach(t=>t(e,void 0,!1))}notifyError(e){g(!this.closed,"stream is closed"),this._closed=e,this.pushIt(e),this._lis.err.forEach(t=>t(e)),this._lis.nxt.forEach(t=>t(void 0,e,!1)),this.clearLis()}notifyComplete(){g(!this.closed,"stream is closed"),this._closed=!0,this.pushIt({value:null,done:!0}),this._lis.cmp.forEach(e=>e()),this._lis.nxt.forEach(e=>e(void 0,void 0,!0)),this.clearLis()}[Symbol.asyncIterator](){return this._closed===!0?this.pushIt({value:null,done:!0}):this._closed!==!1&&this.pushIt(this._closed),{next:()=>{let e=this._itState;g(e,"bad state"),g(!e.p,"iterator contract broken");let t=e.q.shift();return t?"value"in t?Promise.resolve(t):Promise.reject(t):(e.p=new M,e.p.promise)}}}pushIt(e){let t=this._itState;if(t.p){const n=t.p;g(n.state==L.PENDING,"iterator contract broken"),"value"in e?n.resolve(e):n.reject(e),delete t.p}else t.q.push(e)}}var st=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{u(n.next(c))}catch(d){a(d)}}function f(c){try{u(n.throw(c))}catch(d){a(d)}}function u(c){c.done?s(c.value):i(c.value).then(o,f)}u((n=n.apply(r,e||[])).next())})};class at{constructor(e,t,n,i,s,a,o){this.method=e,this.requestHeaders=t,this.request=n,this.headers=i,this.response=s,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(n=>e?Promise.resolve(e(n)):n,n=>t?Promise.resolve(t(n)):Promise.reject(n))}promiseFinished(){return st(this,void 0,void 0,function*(){let[e,t,n,i]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:e,response:t,status:n,trailers:i}})}}var ot=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{u(n.next(c))}catch(d){a(d)}}function f(c){try{u(n.throw(c))}catch(d){a(d)}}function u(c){c.done?s(c.value):i(c.value).then(o,f)}u((n=n.apply(r,e||[])).next())})};class ft{constructor(e,t,n,i,s,a,o){this.method=e,this.requestHeaders=t,this.request=n,this.headers=i,this.responses=s,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(n=>e?Promise.resolve(e(n)):n,n=>t?Promise.resolve(t(n)):Promise.reject(n))}promiseFinished(){return ot(this,void 0,void 0,function*(){let[e,t,n]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:e,status:t,trailers:n}})}}function pt(r,e,t,n,i){var s,a,o,f;if(r=="unary"){let u=(c,d,m)=>e.unary(c,d,m);for(const c of((s=n.interceptors)!==null&&s!==void 0?s:[]).filter(d=>d.interceptUnary).reverse()){const d=u;u=(m,E,k)=>c.interceptUnary(d,m,E,k)}return u(t,i,n)}if(r=="serverStreaming"){let u=(c,d,m)=>e.serverStreaming(c,d,m);for(const c of((a=n.interceptors)!==null&&a!==void 0?a:[]).filter(d=>d.interceptServerStreaming).reverse()){const d=u;u=(m,E,k)=>c.interceptServerStreaming(d,m,E,k)}return u(t,i,n)}if(r=="clientStreaming"){let u=(c,d)=>e.clientStreaming(c,d);for(const c of((o=n.interceptors)!==null&&o!==void 0?o:[]).filter(d=>d.interceptClientStreaming).reverse()){const d=u;u=(m,E)=>c.interceptClientStreaming(d,m,E)}return u(t,n)}if(r=="duplex"){let u=(c,d)=>e.duplex(c,d);for(const c of((f=n.interceptors)!==null&&f!==void 0?f:[]).filter(d=>d.interceptDuplex).reverse()){const d=u;u=(m,E)=>c.interceptDuplex(d,m,E)}return u(t,n)}Se(r)}var h;(function(r){r[r.OK=0]="OK",r[r.CANCELLED=1]="CANCELLED",r[r.UNKNOWN=2]="UNKNOWN",r[r.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",r[r.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",r[r.NOT_FOUND=5]="NOT_FOUND",r[r.ALREADY_EXISTS=6]="ALREADY_EXISTS",r[r.PERMISSION_DENIED=7]="PERMISSION_DENIED",r[r.UNAUTHENTICATED=16]="UNAUTHENTICATED",r[r.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",r[r.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",r[r.ABORTED=10]="ABORTED",r[r.OUT_OF_RANGE=11]="OUT_OF_RANGE",r[r.UNIMPLEMENTED=12]="UNIMPLEMENTED",r[r.INTERNAL=13]="INTERNAL",r[r.UNAVAILABLE=14]="UNAVAILABLE",r[r.DATA_LOSS=15]="DATA_LOSS"})(h||(h={}));var ut=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{u(n.next(c))}catch(d){a(d)}}function f(c){try{u(n.throw(c))}catch(d){a(d)}}function u(c){c.done?s(c.value):i(c.value).then(o,f)}u((n=n.apply(r,e||[])).next())})};function ce(r,e,t,n,i){if(n)for(let[s,a]of Object.entries(n))if(typeof a=="string")r.append(s,a);else for(let o of a)r.append(s,o);if(r.set("Content-Type",e==="text"?"application/grpc-web-text":"application/grpc-web+proto"),e=="text"&&r.set("Accept","application/grpc-web-text"),r.set("X-Grpc-Web","1"),typeof t=="number"){if(t<=0)throw new N(`timeout ${t} ms exceeded`,h[h.DEADLINE_EXCEEDED]);r.set("grpc-timeout",`${t}m`)}else if(t){const s=t.getTime(),a=Date.now();if(s<=a)throw new N(`deadline ${t} exceeded`,h[h.DEADLINE_EXCEEDED]);r.set("grpc-timeout",`${s-a}m`)}return r}function he(r,e){let t=new Uint8Array(5+r.length);t[0]=R.DATA;for(let n=r.length,i=4;i>0;i--)t[i]=n%256,n>>>=8;return t.set(r,5),e==="binary"?t:Ne(t)}function ne(r,e,t){if(arguments.length===1){let f=r,u;try{u=f.type}catch{}switch(u){case"error":case"opaque":case"opaqueredirect":throw new N(`fetch response type ${f.type}`,h[h.UNKNOWN])}return ne(dt(f.headers),f.status,f.statusText)}let n=r,i=e>=200&&e<300,s=De(n),[a,o]=Ae(n);return(a===void 0||a===h.OK)&&!i&&(a=mt(e),o=t),[a,o,s]}function de(r){let e=ht(r),[t,n]=Ae(e),i=De(e);return[t??h.OK,n,i]}var R;(function(r){r[r.DATA=0]="DATA",r[r.TRAILER=128]="TRAILER"})(R||(R={}));function me(r,e,t){return ut(this,void 0,void 0,function*(){let n,i="",s=new Uint8Array(0),a=ct(e);if(lt(r)){let o=r.getReader();n={next:()=>o.read()}}else n=r[Symbol.asyncIterator]();for(;;){let o=yield n.next();if(o.value!==void 0){if(a==="text"){for(let u=0;u=5&&s[0]===R.DATA;){let f=0;for(let u=1;u<5;u++)f=(f<<8)+s[u];if(s.length-5>=f)t(R.DATA,s.subarray(5,5+f)),s=s.subarray(5+f);else break}}if(o.done){if(s.length===0)break;if(s[0]!==R.TRAILER||s.length<5)throw new N("premature EOF",h[h.DATA_LOSS]);t(R.TRAILER,s.subarray(5));break}}})}const lt=r=>typeof r.getReader=="function";function be(r,e){let t=new Uint8Array(r.length+e.length);return t.set(r),t.set(e,r.length),t}function ct(r){switch(r){case"application/grpc-web-text":case"application/grpc-web-text+proto":return"text";case"application/grpc-web":case"application/grpc-web+proto":return"binary";case void 0:case null:throw new N("missing response content type",h[h.INTERNAL]);default:throw new N("unexpected response content type: "+r,h[h.INTERNAL])}}function Ae(r){let e,t,n=r["grpc-message"];if(n!==void 0){if(Array.isArray(n))return[h.INTERNAL,"invalid grpc-web message"];t=n}let i=r["grpc-status"];if(i!==void 0){if(Array.isArray(i))return[h.INTERNAL,"invalid grpc-web status"];if(e=parseInt(i,10),h[e]===void 0)return[h.INTERNAL,"invalid grpc-web status"]}return[e,t]}function De(r){let e={};for(let[t,n]of Object.entries(r))switch(t){case"grpc-message":case"grpc-status":case"content-type":break;default:e[t]=n}return e}function ht(r){let e={};for(let t of String.fromCharCode.apply(String,r).trim().split(`\r +`)){if(t=="")continue;let[n,...i]=t.split(":");const s=i.join(":").trim();n=n.trim();let a=e[n];typeof a=="string"?e[n]=[a,s]:Array.isArray(a)?a.push(s):e[n]=s}return e}function dt(r){let e={};return r.forEach((t,n)=>{let i=e[n];typeof i=="string"?e[n]=[i,t]:Array.isArray(i)?i.push(t):e[n]=t}),e}function mt(r){switch(r){case 200:return h.OK;case 400:return h.INVALID_ARGUMENT;case 401:return h.UNAUTHENTICATED;case 403:return h.PERMISSION_DENIED;case 404:return h.NOT_FOUND;case 409:return h.ABORTED;case 412:return h.FAILED_PRECONDITION;case 429:return h.RESOURCE_EXHAUSTED;case 499:return h.CANCELLED;case 500:return h.UNKNOWN;case 501:return h.UNIMPLEMENTED;case 503:return h.UNAVAILABLE;case 504:return h.DEADLINE_EXCEEDED;default:return h.UNKNOWN}}class Nt{constructor(e){this.defaultOptions=e}mergeOptions(e){return rt(this.defaultOptions,e)}makeUrl(e,t){let n=t.baseUrl;return n.endsWith("/")&&(n=n.substring(0,n.length-1)),`${n}/${e.service.typeName}/${e.name}`}clientStreaming(e){const t=new N("Client streaming is not supported by grpc-web",h[h.UNIMPLEMENTED]);throw t.methodName=e.name,t.serviceName=e.service.typeName,t}duplex(e){const t=new N("Duplex streaming is not supported by grpc-web",h[h.UNIMPLEMENTED]);throw t.methodName=e.name,t.serviceName=e.service.typeName,t}serverStreaming(e,t,n){var i,s,a,o,f;let u=n,c=(i=u.format)!==null&&i!==void 0?i:"text",d=(s=u.fetch)!==null&&s!==void 0?s:globalThis.fetch,m=(a=u.fetchInit)!==null&&a!==void 0?a:{},E=this.makeUrl(e,u),k=e.I.toBinary(t,u.binaryOptions),S=new M,A=new it,_=!0,O,P=new M,x,j=new M;return d(E,Object.assign(Object.assign({},m),{method:"POST",headers:ce(new globalThis.Headers,c,u.timeout,u.meta),body:he(k,c),signal:(o=n.abort)!==null&&o!==void 0?o:null})).then(p=>{let[b,T,B]=ne(p);if(S.resolve(B),b!=null&&b!==h.OK)throw new N(T??h[b],h[b],B);return b!=null&&(O={code:h[b],detail:T??h[b]}),p}).then(p=>{if(!p.body)throw new N("missing response body",h[h.INTERNAL]);return me(p.body,p.headers.get("content-type"),(b,T)=>{switch(b){case R.DATA:A.notifyMessage(e.O.fromBinary(T,u.binaryOptions)),_=!1;break;case R.TRAILER:let B,V;[B,V,x]=de(T),O={code:h[B],detail:V??h[B]};break}})}).then(()=>{if(!x&&!_)throw new N("missing trailers",h[h.DATA_LOSS]);if(!O)throw new N("missing status",h[h.INTERNAL]);if(O.code!=="OK")throw new N(O.detail,O.code,x);A.notifyComplete(),P.resolve(O),j.resolve(x||{})}).catch(p=>{let b;p instanceof N?b=p:p instanceof Error&&p.name==="AbortError"?b=new N(p.message,h[h.CANCELLED]):b=new N(p instanceof Error?p.message:""+p,h[h.INTERNAL]),b.methodName=e.name,b.serviceName=e.service.typeName,S.rejectPending(b),A.notifyError(b),P.rejectPending(b),j.rejectPending(b)}),new ft(e,(f=u.meta)!==null&&f!==void 0?f:{},t,S.promise,A,P.promise,j.promise)}unary(e,t,n){var i,s,a,o,f;let u=n,c=(i=u.format)!==null&&i!==void 0?i:"text",d=(s=u.fetch)!==null&&s!==void 0?s:globalThis.fetch,m=(a=u.fetchInit)!==null&&a!==void 0?a:{},E=this.makeUrl(e,u),k=e.I.toBinary(t,u.binaryOptions),S=new M,A,_=new M,O,P=new M,x,j=new M;return d(E,Object.assign(Object.assign({},m),{method:"POST",headers:ce(new globalThis.Headers,c,u.timeout,u.meta),body:he(k,c),signal:(o=n.abort)!==null&&o!==void 0?o:null})).then(p=>{let[b,T,B]=ne(p);if(S.resolve(B),b!=null&&b!==h.OK)throw new N(T??h[b],h[b],B);return b!=null&&(O={code:h[b],detail:T??h[b]}),p}).then(p=>{if(!p.body)throw new N("missing response body",h[h.INTERNAL]);return me(p.body,p.headers.get("content-type"),(b,T)=>{switch(b){case R.DATA:if(A)throw new N("unary call received 2nd message",h[h.DATA_LOSS]);A=e.O.fromBinary(T,u.binaryOptions);break;case R.TRAILER:let B,V;[B,V,x]=de(T),O={code:h[B],detail:V??h[B]};break}})}).then(()=>{if(!x&&A)throw new N("missing trailers",h[h.DATA_LOSS]);if(!O)throw new N("missing status",h[h.INTERNAL]);if(!A&&O.code==="OK")throw new N("expected error status",h[h.DATA_LOSS]);if(!A)throw new N(O.detail,O.code,x);if(_.resolve(A),O.code!=="OK")throw new N(O.detail,O.code,x);P.resolve(O),j.resolve(x||{})}).catch(p=>{let b;p instanceof N?b=p:p instanceof Error&&p.name==="AbortError"?b=new N(p.message,h[h.CANCELLED]):b=new N(p instanceof Error?p.message:""+p,h[h.INTERNAL]),b.methodName=e.name,b.serviceName=e.service.typeName,S.rejectPending(b),_.rejectPending(b),P.rejectPending(b),j.rejectPending(b)}),new at(e,(f=u.meta)!==null&&f!==void 0?f:{},t,S.promise,_.promise,P.promise,j.promise)}}export{Nt as G,bt as M,gt as S,q as U,I as W,z as r,pt as s}; diff --git a/src/runtime/operator/web_assets/index.html b/src/runtime/operator/web_assets/index.html new file mode 100644 index 0000000..996e876 --- /dev/null +++ b/src/runtime/operator/web_assets/index.html @@ -0,0 +1,17 @@ + + + + + + + Avalanche Operator + + + + + + + +
+ + diff --git a/test/operator_tests/test_web.py b/test/operator_tests/test_web.py index 05aa97f..c5d0c9e 100644 --- a/test/operator_tests/test_web.py +++ b/test/operator_tests/test_web.py @@ -119,6 +119,25 @@ def test_browser_listener_serves_assets_and_spa_routes(tmp_path: Path): operator.close() +def test_browser_listener_serves_packaged_operator_application(): + operator = Operator([], watch=False, schedule=False) + server = start_browser_server(operator, port=0) + try: + connection = http.client.HTTPConnection(server.host, server.port, timeout=5) + connection.request("GET", "/") + response = connection.getresponse() + body = response.read() + + assert response.status == 200 + assert response.getheader("Content-Type") == "text/html" + assert b"Avalanche Operator" in body + assert b'
' in body + connection.close() + finally: + server.close() + operator.close() + + def test_browser_listener_rejects_non_loopback_without_trusted_proxy(tmp_path: Path): operator = Operator([], watch=False, schedule=False) try: diff --git a/web/operator/index.html b/web/operator/index.html new file mode 100644 index 0000000..cf07ba4 --- /dev/null +++ b/web/operator/index.html @@ -0,0 +1,13 @@ + + + + + + + Avalanche Operator + + +
+ + + diff --git a/web/operator/package.json b/web/operator/package.json new file mode 100644 index 0000000..be392fb --- /dev/null +++ b/web/operator/package.json @@ -0,0 +1,38 @@ +{ + "name": "@avalanche/operator-web", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "build": "tsc --noEmit -p tsconfig.app.json && tsc --noEmit -p tsconfig.node.json && vite build", + "dev": "vite", + "generate": "uv run python -m grpc_tools.protoc -I../../src/runtime/operator/proto --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=src/generated --ts_opt=long_type_string ../../src/runtime/operator/proto/operator.proto", + "test": "vitest run" + }, + "dependencies": { + "@codemirror/lang-json": "^6.0.2", + "@codemirror/state": "^6.5.2", + "@codemirror/view": "^6.38.6", + "@protobuf-ts/grpcweb-transport": "^2.11.1", + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1", + "@tanstack/react-virtual": "^3.13.12", + "@xyflow/react": "^12.9.2", + "react": "^19.1.1", + "react-dom": "^19.1.1" + }, + "devDependencies": { + "@protobuf-ts/plugin": "^2.11.1", + "@testing-library/jest-dom": "6.9.1", + "@testing-library/react": "^16.3.0", + "@testing-library/user-event": "^14.6.1", + "@types/react": "^19.1.16", + "@types/react-dom": "^19.1.9", + "@vitejs/plugin-react": "^5.0.4", + "jsdom": "^27.0.0", + "typescript": "^5.9.2", + "vite": "^7.1.7", + "vitest": "^3.2.4" + }, + "packageManager": "pnpm@10.17.1" +} diff --git a/web/operator/pnpm-lock.yaml b/web/operator/pnpm-lock.yaml new file mode 100644 index 0000000..11fdbfe --- /dev/null +++ b/web/operator/pnpm-lock.yaml @@ -0,0 +1,2396 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@codemirror/lang-json': + specifier: ^6.0.2 + version: 6.0.2 + '@codemirror/state': + specifier: ^6.5.2 + version: 6.7.1 + '@codemirror/view': + specifier: ^6.38.6 + version: 6.43.7 + '@protobuf-ts/grpcweb-transport': + specifier: ^2.11.1 + version: 2.11.1 + '@protobuf-ts/runtime': + specifier: ^2.11.1 + version: 2.11.1 + '@protobuf-ts/runtime-rpc': + specifier: ^2.11.1 + version: 2.11.1 + '@tanstack/react-virtual': + specifier: ^3.13.12 + version: 3.14.9(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@xyflow/react': + specifier: ^12.9.2 + version: 12.11.2(@types/react-dom@19.2.4(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + react: + specifier: ^19.1.1 + version: 19.2.8 + react-dom: + specifier: ^19.1.1 + version: 19.2.8(react@19.2.8) + devDependencies: + '@protobuf-ts/plugin': + specifier: ^2.11.1 + version: 2.11.1 + '@testing-library/jest-dom': + specifier: 6.9.1 + version: 6.9.1 + '@testing-library/react': + specifier: ^16.3.0 + version: 16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@19.2.4(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@testing-library/user-event': + specifier: ^14.6.1 + version: 14.6.1(@testing-library/dom@10.4.1) + '@types/react': + specifier: ^19.1.16 + version: 19.2.18 + '@types/react-dom': + specifier: ^19.1.9 + version: 19.2.4(@types/react@19.2.18) + '@vitejs/plugin-react': + specifier: ^5.0.4 + version: 5.2.0(vite@7.3.6) + jsdom: + specifier: ^27.0.0 + version: 27.4.0 + typescript: + specifier: ^5.9.2 + version: 5.9.3 + vite: + specifier: ^7.1.7 + version: 7.3.6 + vitest: + specifier: ^3.2.4 + version: 3.2.7(jsdom@27.4.0) + +packages: + + '@acemir/cssom@0.9.31': + resolution: {integrity: sha512-ZnR3GSaH+/vJ0YlHau21FjfLYjMpYVIzTD8M8vIEQvIGxeOXyXdzCI140rrCY862p/C/BbzWsjc1dgnM9mkoTA==} + + '@adobe/css-tools@4.5.0': + resolution: {integrity: sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==} + + '@asamuzakjp/css-color@4.1.2': + resolution: {integrity: sha512-NfBUvBaYgKIuq6E/RBLY1m0IohzNHAYyaJGuTK79Z23uNwmz2jl1mPsC5ZxCCxylinKhT1Amn5oNTlx1wN8cQg==} + + '@asamuzakjp/dom-selector@6.8.1': + resolution: {integrity: sha512-MvRz1nCqW0fsy8Qz4dnLIvhOlMzqDVBabZx6lH+YywFDdjXhMY37SmpV1XFX3JzG5GWHn63j6HX6QPr3lZXHvQ==} + + '@asamuzakjp/nwsapi@2.3.9': + resolution: {integrity: sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==} + + '@babel/code-frame@7.29.7': + resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==} + engines: {node: '>=6.9.0'} + + '@babel/compat-data@7.29.7': + resolution: {integrity: sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==} + engines: {node: '>=6.9.0'} + + '@babel/core@7.29.7': + resolution: {integrity: sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==} + engines: {node: '>=6.9.0'} + + '@babel/generator@7.29.8': + resolution: {integrity: sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-compilation-targets@7.29.7': + resolution: {integrity: sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-globals@7.29.7': + resolution: {integrity: sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-imports@7.29.7': + resolution: {integrity: sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-transforms@7.29.7': + resolution: {integrity: sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-plugin-utils@7.29.7': + resolution: {integrity: sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-string-parser@7.29.7': + resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.29.7': + resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-option@7.29.7': + resolution: {integrity: sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==} + engines: {node: '>=6.9.0'} + + '@babel/helpers@7.29.7': + resolution: {integrity: sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.29.8': + resolution: {integrity: sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/plugin-transform-react-jsx-self@7.29.7': + resolution: {integrity: sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-react-jsx-source@7.29.7': + resolution: {integrity: sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/runtime@7.29.7': + resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==} + engines: {node: '>=6.9.0'} + + '@babel/template@7.29.7': + resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.29.8': + resolution: {integrity: sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.29.8': + resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==} + engines: {node: '>=6.9.0'} + + '@bufbuild/protobuf@2.13.0': + resolution: {integrity: sha512-acq7c49vxfm1ggJ95P70TX7ABDM0vxr1SYD3BB0o0jnBLB4OAqeHyKuN+cD3w80gXEDQ2zxHpR6CUeA+O/aU9g==} + + '@bufbuild/protoplugin@2.13.0': + resolution: {integrity: sha512-32eMChKaL/A8Hh5AfMmXSdnuyznN85uoEjoyWiWeRrvtQOtpqX/v1R9PDe0g9vMIgzznK9inMT3CUaal0kjLUQ==} + + '@codemirror/lang-json@6.0.2': + resolution: {integrity: sha512-x2OtO+AvwEHrEwR0FyyPtfDUiloG3rnVTSZV1W8UteaLL8/MajQd8DpvUb2YVzC+/T18aSDv0H9mu+xw0EStoQ==} + + '@codemirror/language@6.12.4': + resolution: {integrity: sha512-1q4PaT+o6PbgpkJt4Q8Fv5XJxTy4FUZ4MWETtyiDw3J0Pyr9E2vqcKL+k9wcvjNTIsauxvE7OfmWj3FRPHQ76A==} + + '@codemirror/state@6.7.1': + resolution: {integrity: sha512-9QzNDgE4EYDnAHfrTlR2lwiPciiOymLtwKK+8yHQzCc7GXhAP9xdEbEJFy2IWB1j9UGUl9BsgMmTo/ImA02T7A==} + + '@codemirror/view@6.43.7': + resolution: {integrity: sha512-FZsExxkoxnAN+d9TgqXLg5g4A1oQwzX9WlkOT5i2PKkcW7xx3Bmu0vs90g6fo9Mpdsb/l96dnAraQ8932aO4/g==} + + '@csstools/color-helpers@6.1.0': + resolution: {integrity: sha512-064IFJdjTfUqnjpCVpMOdbr8FLQBhinbZj6yRv2An2E41O/pLEXqfFRWqGq/SxlE5PEUYTlvWsG2r8MswAVvkg==} + engines: {node: '>=20.19.0'} + + '@csstools/css-calc@3.3.0': + resolution: {integrity: sha512-c5ihYsPkdG6JCkU2zTMm4+k6r7RXuGxtWYhu5DHMIiF1FHzrfmHL5so11AoFpUv/tu61xfcmT4AmKoFfMPoqdQ==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-parser-algorithms': ^4.0.0 + '@csstools/css-tokenizer': ^4.0.0 + + '@csstools/css-color-parser@4.1.10': + resolution: {integrity: sha512-UZhQLIUyJaaMepqehrCODwCg2KW25vFvLWBmqYFaPclYvvxzj/sG8LBOhBFCp11i9uE7t1EyS+RAoV9tztPFyw==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-parser-algorithms': ^4.0.0 + '@csstools/css-tokenizer': ^4.0.0 + + '@csstools/css-parser-algorithms@4.0.0': + resolution: {integrity: sha512-+B87qS7fIG3L5h3qwJ/IFbjoVoOe/bpOdh9hAjXbvx0o8ImEmUsGXN0inFOnk2ChCFgqkkGFQ+TpM5rbhkKe4w==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-tokenizer': ^4.0.0 + + '@csstools/css-syntax-patches-for-csstree@1.1.7': + resolution: {integrity: sha512-fQ+05118eQS1cofO3aJpB5efgpBZMvIzwr/sbC8kDLVA5XLG8q1kJV5yzrUAI1f7lvhPnm8fgIjzFB8/O/5Dig==} + peerDependencies: + css-tree: ^3.2.1 + peerDependenciesMeta: + css-tree: + optional: true + + '@csstools/css-tokenizer@4.0.0': + resolution: {integrity: sha512-QxULHAm7cNu72w97JUNCBFODFaXpbDg+dP8b/oWFAZ2MTRppA3U00Y2L1HqaS4J6yBqxwa/Y3nMBaxVKbB/NsA==} + engines: {node: '>=20.19.0'} + + '@esbuild/aix-ppc64@0.28.1': + resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.28.1': + resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.28.1': + resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.28.1': + resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.28.1': + resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.28.1': + resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.28.1': + resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.28.1': + resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.28.1': + resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.28.1': + resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.28.1': + resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.28.1': + resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.28.1': + resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.28.1': + resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.28.1': + resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.28.1': + resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.28.1': + resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.28.1': + resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.28.1': + resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.28.1': + resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.28.1': + resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.28.1': + resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.28.1': + resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.28.1': + resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.28.1': + resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.28.1': + resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@exodus/bytes@1.15.1': + resolution: {integrity: sha512-S6mL0yNB/Abt9Ei4tq8gDhcczc4S3+vQ4ra7vxnAf+YHC02srtqxKKZghx2Dq6p0e66THKwR6r8N6P95wEty7Q==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + peerDependencies: + '@noble/hashes': ^1.8.0 || ^2.0.0 + peerDependenciesMeta: + '@noble/hashes': + optional: true + + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/remapping@2.3.5': + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + + '@lezer/common@1.5.2': + resolution: {integrity: sha512-sxQE460fPZyU3sdc8lafxiPwJHBzZRy/udNFynGQky1SePYBdhkBl1kOagA9uT3pxR8K09bOrmTUqA9wb/PjSQ==} + + '@lezer/highlight@1.2.3': + resolution: {integrity: sha512-qXdH7UqTvGfdVBINrgKhDsVTJTxactNNxLk7+UMwZhU13lMHaOBlJe9Vqp907ya56Y3+ed2tlqzys7jDkTmW0g==} + + '@lezer/json@1.0.3': + resolution: {integrity: sha512-BP9KzdF9Y35PDpv04r0VeSTKDeox5vVr3efE7eBbx3r4s3oNLfunchejZhjArmeieBH+nVOpgIiBJpEAv8ilqQ==} + + '@lezer/lr@1.4.10': + resolution: {integrity: sha512-rnCpTIBafOx4mRp43xOxDJbFipJm/c0cia/V5TiGlhmMa+wsSdoGmUN3w5Bqrks/09Q/D4tNAmWaT8p6NRi77A==} + + '@marijn/find-cluster-break@1.0.3': + resolution: {integrity: sha512-FY+MKLBoTsLNJF/eLWaOsXGdz6uh3Iu1axjPf6TUq92IYumcTcXWHoS747JARLkcdlJ/Waiaxc5wQfFO8jC6NA==} + + '@protobuf-ts/grpcweb-transport@2.11.1': + resolution: {integrity: sha512-1W4utDdvOB+RHMFQ0soL4JdnxjXV+ddeGIUg08DvZrA8Ms6k5NN6GBFU2oHZdTOcJVpPrDJ02RJlqtaoCMNBtw==} + + '@protobuf-ts/plugin@2.11.1': + resolution: {integrity: sha512-HyuprDcw0bEEJqkOWe1rnXUP0gwYLij8YhPuZyZk6cJbIgc/Q0IFgoHQxOXNIXAcXM4Sbehh6kjVnCzasElw1A==} + hasBin: true + + '@protobuf-ts/protoc@2.11.1': + resolution: {integrity: sha512-mUZJaV0daGO6HUX90o/atzQ6A7bbN2RSuHtdwo8SSF2Qoe3zHwa4IHyCN1evftTeHfLmdz+45qo47sL+5P8nyg==} + hasBin: true + + '@protobuf-ts/runtime-rpc@2.11.1': + resolution: {integrity: sha512-4CqqUmNA+/uMz00+d3CYKgElXO9VrEbucjnBFEjqI4GuDrEQ32MaI3q+9qPBvIGOlL4PmHXrzM32vBPWRhQKWQ==} + + '@protobuf-ts/runtime@2.11.1': + resolution: {integrity: sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==} + + '@rolldown/pluginutils@1.0.0-rc.3': + resolution: {integrity: sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==} + + '@rollup/rollup-android-arm-eabi@4.62.3': + resolution: {integrity: sha512-c0wdcekXtQvvn5Tsrk/+op/gUArrbWaFduBnTLP2l1cKLSQs4diMWjJw3m6A0DdzT8dAAX95KpkJ3qynCePbmw==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.62.3': + resolution: {integrity: sha512-3YjElDdWN+qXAFbJ/CzPV+0wspLqh54k/I6GfdYtEJRqg7buSgc1yPM3B+93j1M4neobtkATHZTmxK2AMVGfnA==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.62.3': + resolution: {integrity: sha512-Pch2pFNOxxz1hTjypIdPyRTR6riiwRl84+VcN9djS680fw+Co1nAJINrdpqp7KV0NvyuU8ilZXZCjd7ykJl1GQ==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.62.3': + resolution: {integrity: sha512-LEuncFUHFiF8t4yZVZvvZA1wk0pjAscRnsrn1EfTEmN4HXotBi2YtcnLRyaK6UbuczW7xZS5ES+81Rdz8Z0T6g==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.62.3': + resolution: {integrity: sha512-zvBUvsQUpOWALdDsk6qbS8bXf2VxmPisuudNDrY7x0p0jBdsoZl8HsHczIOgkQiZldmcacMKtBzpoGVNeIe2bQ==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.62.3': + resolution: {integrity: sha512-C2KmNrcSem/AMg984H/dev+si0lieQGdXdR/lYGJnuumXnFb9Y7QdiI62obFdLlxRYLBv4P0eUVIDbD4c1vVvw==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.62.3': + resolution: {integrity: sha512-ggXnsTAEzNQx74XpunRsiZ9aBZDsI7XIa0hm2nzR9f4WzH5/f/d73ZSDaC5ejJ8YLY4NW+V3wr0tjOaeCq8hqA==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.62.3': + resolution: {integrity: sha512-2vng+FlzNUhKZxtej3IUqJgbZoQk2M/dwQM20+ULV0R/E/8tr9/P6uEf2iiGIk4HL0zMKh5Jry7mUHdUOvyGgA==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.62.3': + resolution: {integrity: sha512-LLLFZKt4/Nraf9rxDkhiU8QVgLF4WmCkfr0L4fj0fPfIZFBib0DeiFk1hhaYKd03LFAFJcxHslhDFlNJLylf5Q==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.62.3': + resolution: {integrity: sha512-WJkdQCvS9sWNOUBJZfQRKpZGFBztRzcowI+nndmflKgU4XY+3a420FgTOSKTsVqJbnzSxeT4vaJalpOaPo2YCQ==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-loong64-gnu@4.62.3': + resolution: {integrity: sha512-PwHXCCS2n64/1Ot6rP1YEYA02MGYBcQlr8CSZZyrUG2O7NH6NklYmvr9v3Jy+5e/eDeNchc/ukmKJi9LuflMIQ==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-loong64-musl@4.62.3': + resolution: {integrity: sha512-vUjxINQu3RC8NZS3ykk1gN65gIz8pAopOq2HXuZhiIxHdx7TFvDG+jgrdSgInu1Eza4/Rfi2VzZgyIgEH4WOaw==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-ppc64-gnu@4.62.3': + resolution: {integrity: sha512-wzko4aJ13+0G3kGnviCg5gnXFKd40izKsrf2uOw12US4XqprkDrmwOpeW14aSNa37V8bfPcz5Fkob6LZ3BAPmA==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-ppc64-musl@4.62.3': + resolution: {integrity: sha512-8120ue0JUMSwy11stlwnfdX3pPd+WZYGCDBwEHWtIHi6pOpZmsEF5QKB7a/UN+XFdqvobxz98kv8RTqikyCEBw==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.62.3': + resolution: {integrity: sha512-XLFHnR3tXMjbOCh2vtVJHmxt+995uJsTERQyseFDRA0xxMxyTZPLa3OIUlyFaO4mF/Lu0FjmWHCuPXJT1n/IOg==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-riscv64-musl@4.62.3': + resolution: {integrity: sha512-se6yXvNGMIl0f+RQzyh7XAmia8/9kplQx424wnG2w0C1oi6XgO6Y8otKhdXFHbHs88Ihavzmvh1NWjuovE76BQ==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.62.3': + resolution: {integrity: sha512-gNoxRefktVIiGflpONuxWWXZAzIQG++z9qHO3xKwk4WdDMuQja3JHGfE1u0i3PfPDyvhypdk+WrgIJqLhGG7sg==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.62.3': + resolution: {integrity: sha512-V4KtWtQfAFMU7+9/A/VDps/VI8CHd3cYz0L8sgJzz8qK7eY7wI4ruFD82UYIYvW9Z4DtlTfhQcsl4XyPHW5uSg==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.62.3': + resolution: {integrity: sha512-LBx9LYXvj2CBkMkjLdNAWLwH0MLMin7do2VcVo9kVPibGLkY0BQQut2fv7NVqkXqZ/CrAu9LqDHVV1xHCMpCPw==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-openbsd-x64@4.62.3': + resolution: {integrity: sha512-ABVf3Q0RCu7NcyCCOZQI0pJ3GuSdfSl8EXcy88QtdceIMIoCUdfhsJChZ64L9zVM2aJHjde1Bhn5uqSRcX9ySA==} + cpu: [x64] + os: [openbsd] + + '@rollup/rollup-openharmony-arm64@4.62.3': + resolution: {integrity: sha512-+2Cy/ldweGBLlPIKsQLF8U5N44a0KDdbrk1rAjHOM9M2K+kGdIVjHLmmrZIcx+9Ny3ke/1JomCsDI1ocb11+sg==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.62.3': + resolution: {integrity: sha512-dtZvzc8BedpSaFNy75x6uiWwAGTH+aZHDtdrqP6qk+WcLJrfti6sGje1ZJ9UxyzDLF23d/mV+PaMwuC0hL7UVA==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.62.3': + resolution: {integrity: sha512-Rj8Ra4noo+aYy7sKBggCx0407mws34kAb1ySyWuq5DAtFBQdkSwnsjCgPrhPe9cvgBKZIukpE+CVHvORCS93kQ==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.62.3': + resolution: {integrity: sha512-vp7N084ew/odXn2gi/mzm9mUkQu9l6AiN6dt4IeUM2Uvm9o+cVmP+YkqbMOteLbiGgqBBlJZjIMYVCfOOIVbVQ==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.62.3': + resolution: {integrity: sha512-MOG/3gTOn4Fwf574RVOaY61I5o6P90legkFADiTyn1hyjNydT+cerU2rLUwPdZkKKyJ+iT+K9p7WXK4LM1Ka6g==} + cpu: [x64] + os: [win32] + + '@tanstack/react-virtual@3.14.9': + resolution: {integrity: sha512-qZyr0FZDP8rDC4WBhsryIZmAd9bveJvFGUJJtskWaew6/0dTRS6wZxnR6VQ5bY2KwL3LjerrHqQLk3a0GKcPXQ==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + + '@tanstack/virtual-core@3.17.7': + resolution: {integrity: sha512-bp+v10y65sp2H7WpWfIMyxTNfl8ZVfxFTLRjPIFRryi6FV/J33z4IS53WO4pTk36KlvJ4iLiQz+oaydDC1xbcA==} + + '@testing-library/dom@10.4.1': + resolution: {integrity: sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==} + engines: {node: '>=18'} + + '@testing-library/jest-dom@6.9.1': + resolution: {integrity: sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==} + engines: {node: '>=14', npm: '>=6', yarn: '>=1'} + + '@testing-library/react@16.3.2': + resolution: {integrity: sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==} + engines: {node: '>=18'} + peerDependencies: + '@testing-library/dom': ^10.0.0 + '@types/react': ^18.0.0 || ^19.0.0 + '@types/react-dom': ^18.0.0 || ^19.0.0 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@testing-library/user-event@14.6.1': + resolution: {integrity: sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==} + engines: {node: '>=12', npm: '>=6'} + peerDependencies: + '@testing-library/dom': '>=7.21.4' + + '@types/aria-query@5.0.4': + resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==} + + '@types/babel__core@7.20.5': + resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + + '@types/babel__generator@7.27.0': + resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} + + '@types/babel__template@7.4.4': + resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + + '@types/babel__traverse@7.28.0': + resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} + + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/d3-color@3.1.3': + resolution: {integrity: sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==} + + '@types/d3-drag@3.0.7': + resolution: {integrity: sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==} + + '@types/d3-interpolate@3.0.4': + resolution: {integrity: sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==} + + '@types/d3-selection@3.0.11': + resolution: {integrity: sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==} + + '@types/d3-transition@3.0.9': + resolution: {integrity: sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==} + + '@types/d3-zoom@3.0.8': + resolution: {integrity: sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + + '@types/react-dom@19.2.4': + resolution: {integrity: sha512-Bsc+QHgp+P/F02XDzNCY9jnZNCUuLki36KT7VKrTXXLdHf+vHMNZnW1rVu5DNW/rCK+fya3DATySbLM4yhtKUw==} + peerDependencies: + '@types/react': ^19.2.0 + + '@types/react@19.2.18': + resolution: {integrity: sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w==} + + '@typescript/vfs@1.6.4': + resolution: {integrity: sha512-PJFXFS4ZJKiJ9Qiuix6Dz/OwEIqHD7Dme1UwZhTK11vR+5dqW2ACbdndWQexBzCx+CPuMe5WBYQWCsFyGlQLlQ==} + peerDependencies: + typescript: '*' + + '@vitejs/plugin-react@5.2.0': + resolution: {integrity: sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 + + '@vitest/expect@3.2.7': + resolution: {integrity: sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==} + + '@vitest/mocker@3.2.7': + resolution: {integrity: sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@3.2.7': + resolution: {integrity: sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==} + + '@vitest/runner@3.2.7': + resolution: {integrity: sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==} + + '@vitest/snapshot@3.2.7': + resolution: {integrity: sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==} + + '@vitest/spy@3.2.7': + resolution: {integrity: sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==} + + '@vitest/utils@3.2.7': + resolution: {integrity: sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==} + + '@xyflow/react@12.11.2': + resolution: {integrity: sha512-eLAlDWJfWnQEhJwGMjlWdAXO9eYllKpliUmPQlAmOLxz6mExXuzMVDUKLMquixgkrtmMFFtug3jGKmYYld12cA==} + peerDependencies: + '@types/react': '>=17' + '@types/react-dom': '>=17' + react: '>=17' + react-dom: '>=17' + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@xyflow/system@0.0.79': + resolution: {integrity: sha512-czLyOh91NF0hIzbNzwi8I6GlqG23BHh2435OddfI6uiaLH3xdrdygO93gqgH1Bv9mhy8XPFQJOBn1FTq4LvEWA==} + + agent-base@7.1.4: + resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} + engines: {node: '>= 14'} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + + aria-query@5.3.0: + resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} + + aria-query@5.3.2: + resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} + engines: {node: '>= 0.4'} + + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + + baseline-browser-mapping@2.11.9: + resolution: {integrity: sha512-cp447VUsGS07+n1Dqf7YSQ8maeJrjEhaDxTm1ZefbqDtypHBC5GzGMQbklR6IPR13Y8OAJRHZWEMtZipJLCttg==} + engines: {node: '>=6.0.0'} + hasBin: true + + bidi-js@1.0.3: + resolution: {integrity: sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==} + + browserslist@4.28.7: + resolution: {integrity: sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + + caniuse-lite@1.0.30001806: + resolution: {integrity: sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==} + + chai@5.3.3: + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} + engines: {node: '>=18'} + + check-error@2.1.3: + resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} + engines: {node: '>= 16'} + + classcat@5.0.5: + resolution: {integrity: sha512-JhZUT7JFcQy/EzW605k/ktHtncoo9vnyW/2GspNYwFlN1C/WmjuV/xtS04e9SOkL2sTdw0VAZ2UGCcQ9lR6p6w==} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + crelt@1.0.7: + resolution: {integrity: sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA==} + + css-tree@3.2.1: + resolution: {integrity: sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} + + css.escape@1.5.1: + resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} + + cssstyle@5.3.7: + resolution: {integrity: sha512-7D2EPVltRrsTkhpQmksIu+LxeWAIEk6wRDMJ1qljlv+CKHJM+cJLlfhWIzNA44eAsHXSNe3+vO6DW1yCYx8SuQ==} + engines: {node: '>=20'} + + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + + d3-color@3.1.0: + resolution: {integrity: sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==} + engines: {node: '>=12'} + + d3-dispatch@3.0.1: + resolution: {integrity: sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==} + engines: {node: '>=12'} + + d3-drag@3.0.0: + resolution: {integrity: sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==} + engines: {node: '>=12'} + + d3-ease@3.0.1: + resolution: {integrity: sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==} + engines: {node: '>=12'} + + d3-interpolate@3.0.1: + resolution: {integrity: sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==} + engines: {node: '>=12'} + + d3-selection@3.0.0: + resolution: {integrity: sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==} + engines: {node: '>=12'} + + d3-timer@3.0.1: + resolution: {integrity: sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==} + engines: {node: '>=12'} + + d3-transition@3.0.1: + resolution: {integrity: sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==} + engines: {node: '>=12'} + peerDependencies: + d3-selection: 2 - 3 + + d3-zoom@3.0.0: + resolution: {integrity: sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==} + engines: {node: '>=12'} + + data-urls@6.0.1: + resolution: {integrity: sha512-euIQENZg6x8mj3fO6o9+fOW8MimUI4PpD/fZBhJfeioZVy9TUpM4UY7KjQNVZFlqwJ0UdzRDzkycB997HEq1BQ==} + engines: {node: '>=20'} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + decimal.js@10.6.0: + resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} + + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} + engines: {node: '>=6'} + + dequal@2.0.3: + resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} + engines: {node: '>=6'} + + dom-accessibility-api@0.5.16: + resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} + + dom-accessibility-api@0.6.3: + resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==} + + electron-to-chromium@1.5.399: + resolution: {integrity: sha512-lEcqhErbHjXRvd41rnWLpzbyU/IXfIYo7QwaFWmxGeLiLyY2TBCdHnWY88vB+p3ubnihRypDm66panXl7TylLA==} + + entities@8.0.0: + resolution: {integrity: sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==} + engines: {node: '>=20.19.0'} + + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + + esbuild@0.28.1: + resolution: {integrity: sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==} + engines: {node: '>=18'} + hasBin: true + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + expect-type@1.4.0: + resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} + engines: {node: '>=12.0.0'} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + html-encoding-sniffer@6.0.0: + resolution: {integrity: sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + + http-proxy-agent@7.0.2: + resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} + engines: {node: '>= 14'} + + https-proxy-agent@7.0.6: + resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} + engines: {node: '>= 14'} + + indent-string@4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + + is-potential-custom-element-name@1.0.1: + resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + + jsdom@27.4.0: + resolution: {integrity: sha512-mjzqwWRD9Y1J1KUi7W97Gja1bwOOM5Ug0EZ6UDK3xS7j7mndrkwozHtSblfomlzyB4NepioNt+B2sOSzczVgtQ==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + peerDependencies: + canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + + loupe@3.2.1: + resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} + + lru-cache@11.5.2: + resolution: {integrity: sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==} + engines: {node: 20 || >=22} + + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + + lz-string@1.5.0: + resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} + hasBin: true + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + mdn-data@2.27.1: + resolution: {integrity: sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==} + + min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + nanoid@3.3.16: + resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + node-releases@2.0.51: + resolution: {integrity: sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==} + engines: {node: '>=18'} + + parse5@8.0.1: + resolution: {integrity: sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + pathval@2.0.1: + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} + engines: {node: '>= 14.16'} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.5: + resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} + engines: {node: '>=12'} + + postcss@8.5.25: + resolution: {integrity: sha512-DTPx3RWSSnWyzLxQnlH0rJP+EW5ekl16ZU4/psbIhA0e53kJfdgaN5vKM+xP7yJtXVu+nfdVFmlgFDEKAe4Pyw==} + engines: {node: ^10 || ^12 || >=14} + + pretty-format@27.5.1: + resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + react-dom@19.2.8: + resolution: {integrity: sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==} + peerDependencies: + react: ^19.2.8 + + react-is@17.0.2: + resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} + + react-refresh@0.18.0: + resolution: {integrity: sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==} + engines: {node: '>=0.10.0'} + + react@19.2.8: + resolution: {integrity: sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==} + engines: {node: '>=0.10.0'} + + redent@3.0.0: + resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} + engines: {node: '>=8'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + rollup@4.62.3: + resolution: {integrity: sha512-Gu0c0iH9FzgX1L1t7ByIbbS3Vmdz+6KHm/EsqmmC71gUQ82yvZRkTK6XzrFObSka91WUVdynqp6nsfilzr5k6Q==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + saxes@6.0.0: + resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} + engines: {node: '>=v12.22.7'} + + scheduler@0.27.0: + resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + std-env@3.10.0: + resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} + + strip-indent@3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + + strip-literal@3.1.0: + resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==} + + style-mod@4.1.3: + resolution: {integrity: sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ==} + + symbol-tree@3.2.4: + resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} + + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} + engines: {node: ^18.0.0 || >=20.0.0} + + tinyrainbow@2.0.0: + resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} + engines: {node: '>=14.0.0'} + + tinyspy@4.0.4: + resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} + engines: {node: '>=14.0.0'} + + tldts-core@7.4.10: + resolution: {integrity: sha512-KnQjp53ZekKgm/r3l+u8kJGGzYgrWdP8+Mql7a4vijh2WE0IrZWspQj/TpTxDho/YxO+AnOZnIjQcCD+q6iJsw==} + + tldts@7.4.10: + resolution: {integrity: sha512-GgouD1B+sWwvkaEq8vXC15DjQitxbvs12oIXELpconwm+Tg3zfcEv4jgzq3vtKverDXsg3VI8aRgNL2Nra0Iog==} + hasBin: true + + tough-cookie@6.0.2: + resolution: {integrity: sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==} + engines: {node: '>=16'} + + tr46@6.0.0: + resolution: {integrity: sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==} + engines: {node: '>=20'} + + typescript@3.9.10: + resolution: {integrity: sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==} + engines: {node: '>=4.2.0'} + hasBin: true + + typescript@5.4.5: + resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} + engines: {node: '>=14.17'} + hasBin: true + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + update-browserslist-db@1.2.3: + resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + use-sync-external-store@1.6.0: + resolution: {integrity: sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + + vite@7.3.6: + resolution: {integrity: sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + jiti: '>=1.21.0' + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@3.2.7: + resolution: {integrity: sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/debug': ^4.1.12 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 3.2.7 + '@vitest/ui': 3.2.7 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/debug': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + w3c-keyname@2.2.8: + resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==} + + w3c-xmlserializer@5.0.0: + resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} + engines: {node: '>=18'} + + webidl-conversions@8.0.1: + resolution: {integrity: sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==} + engines: {node: '>=20'} + + whatwg-mimetype@4.0.0: + resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} + engines: {node: '>=18'} + + whatwg-mimetype@5.0.0: + resolution: {integrity: sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==} + engines: {node: '>=20'} + + whatwg-url@15.1.0: + resolution: {integrity: sha512-2ytDk0kiEj/yu90JOAp44PVPUkO9+jVhyf+SybKlRHSDlvOOZhdPIrr7xTH64l4WixO2cP+wQIcgujkGBPPz6g==} + engines: {node: '>=20'} + + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + + ws@8.21.1: + resolution: {integrity: sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + xml-name-validator@5.0.0: + resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} + engines: {node: '>=18'} + + xmlchars@2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + + zustand@4.5.7: + resolution: {integrity: sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==} + engines: {node: '>=12.7.0'} + peerDependencies: + '@types/react': '>=16.8' + immer: '>=9.0.6' + react: '>=16.8' + peerDependenciesMeta: + '@types/react': + optional: true + immer: + optional: true + react: + optional: true + +snapshots: + + '@acemir/cssom@0.9.31': {} + + '@adobe/css-tools@4.5.0': {} + + '@asamuzakjp/css-color@4.1.2': + dependencies: + '@csstools/css-calc': 3.3.0(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) + '@csstools/css-color-parser': 4.1.10(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) + '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) + '@csstools/css-tokenizer': 4.0.0 + lru-cache: 11.5.2 + + '@asamuzakjp/dom-selector@6.8.1': + dependencies: + '@asamuzakjp/nwsapi': 2.3.9 + bidi-js: 1.0.3 + css-tree: 3.2.1 + is-potential-custom-element-name: 1.0.1 + lru-cache: 11.5.2 + + '@asamuzakjp/nwsapi@2.3.9': {} + + '@babel/code-frame@7.29.7': + dependencies: + '@babel/helper-validator-identifier': 7.29.7 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/compat-data@7.29.7': {} + + '@babel/core@7.29.7': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-compilation-targets': 7.29.7 + '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) + '@babel/helpers': 7.29.7 + '@babel/parser': 7.29.8 + '@babel/template': 7.29.7 + '@babel/traverse': 7.29.8 + '@babel/types': 7.29.8 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.29.8': + dependencies: + '@babel/parser': 7.29.8 + '@babel/types': 7.29.8 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + jsesc: 3.1.0 + + '@babel/helper-compilation-targets@7.29.7': + dependencies: + '@babel/compat-data': 7.29.7 + '@babel/helper-validator-option': 7.29.7 + browserslist: 4.28.7 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-globals@7.29.7': {} + + '@babel/helper-module-imports@7.29.7': + dependencies: + '@babel/traverse': 7.29.8 + '@babel/types': 7.29.8 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-module-imports': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + '@babel/traverse': 7.29.8 + transitivePeerDependencies: + - supports-color + + '@babel/helper-plugin-utils@7.29.7': {} + + '@babel/helper-string-parser@7.29.7': {} + + '@babel/helper-validator-identifier@7.29.7': {} + + '@babel/helper-validator-option@7.29.7': {} + + '@babel/helpers@7.29.7': + dependencies: + '@babel/template': 7.29.7 + '@babel/types': 7.29.8 + + '@babel/parser@7.29.8': + dependencies: + '@babel/types': 7.29.8 + + '@babel/plugin-transform-react-jsx-self@7.29.7(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-transform-react-jsx-source@7.29.7(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/runtime@7.29.7': {} + + '@babel/template@7.29.7': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/parser': 7.29.8 + '@babel/types': 7.29.8 + + '@babel/traverse@7.29.8': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-globals': 7.29.7 + '@babel/parser': 7.29.8 + '@babel/template': 7.29.7 + '@babel/types': 7.29.8 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.29.8': + dependencies: + '@babel/helper-string-parser': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + + '@bufbuild/protobuf@2.13.0': {} + + '@bufbuild/protoplugin@2.13.0': + dependencies: + '@bufbuild/protobuf': 2.13.0 + '@typescript/vfs': 1.6.4(typescript@5.4.5) + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + + '@codemirror/lang-json@6.0.2': + dependencies: + '@codemirror/language': 6.12.4 + '@lezer/json': 1.0.3 + + '@codemirror/language@6.12.4': + dependencies: + '@codemirror/state': 6.7.1 + '@codemirror/view': 6.43.7 + '@lezer/common': 1.5.2 + '@lezer/highlight': 1.2.3 + '@lezer/lr': 1.4.10 + style-mod: 4.1.3 + + '@codemirror/state@6.7.1': + dependencies: + '@marijn/find-cluster-break': 1.0.3 + + '@codemirror/view@6.43.7': + dependencies: + '@codemirror/state': 6.7.1 + crelt: 1.0.7 + style-mod: 4.1.3 + w3c-keyname: 2.2.8 + + '@csstools/color-helpers@6.1.0': {} + + '@csstools/css-calc@3.3.0(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0)': + dependencies: + '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) + '@csstools/css-tokenizer': 4.0.0 + + '@csstools/css-color-parser@4.1.10(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0)': + dependencies: + '@csstools/color-helpers': 6.1.0 + '@csstools/css-calc': 3.3.0(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) + '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) + '@csstools/css-tokenizer': 4.0.0 + + '@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0)': + dependencies: + '@csstools/css-tokenizer': 4.0.0 + + '@csstools/css-syntax-patches-for-csstree@1.1.7(css-tree@3.2.1)': + optionalDependencies: + css-tree: 3.2.1 + + '@csstools/css-tokenizer@4.0.0': {} + + '@esbuild/aix-ppc64@0.28.1': + optional: true + + '@esbuild/android-arm64@0.28.1': + optional: true + + '@esbuild/android-arm@0.28.1': + optional: true + + '@esbuild/android-x64@0.28.1': + optional: true + + '@esbuild/darwin-arm64@0.28.1': + optional: true + + '@esbuild/darwin-x64@0.28.1': + optional: true + + '@esbuild/freebsd-arm64@0.28.1': + optional: true + + '@esbuild/freebsd-x64@0.28.1': + optional: true + + '@esbuild/linux-arm64@0.28.1': + optional: true + + '@esbuild/linux-arm@0.28.1': + optional: true + + '@esbuild/linux-ia32@0.28.1': + optional: true + + '@esbuild/linux-loong64@0.28.1': + optional: true + + '@esbuild/linux-mips64el@0.28.1': + optional: true + + '@esbuild/linux-ppc64@0.28.1': + optional: true + + '@esbuild/linux-riscv64@0.28.1': + optional: true + + '@esbuild/linux-s390x@0.28.1': + optional: true + + '@esbuild/linux-x64@0.28.1': + optional: true + + '@esbuild/netbsd-arm64@0.28.1': + optional: true + + '@esbuild/netbsd-x64@0.28.1': + optional: true + + '@esbuild/openbsd-arm64@0.28.1': + optional: true + + '@esbuild/openbsd-x64@0.28.1': + optional: true + + '@esbuild/openharmony-arm64@0.28.1': + optional: true + + '@esbuild/sunos-x64@0.28.1': + optional: true + + '@esbuild/win32-arm64@0.28.1': + optional: true + + '@esbuild/win32-ia32@0.28.1': + optional: true + + '@esbuild/win32-x64@0.28.1': + optional: true + + '@exodus/bytes@1.15.1': {} + + '@jridgewell/gen-mapping@0.3.13': + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/remapping@2.3.5': + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/sourcemap-codec@1.5.5': {} + + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + + '@lezer/common@1.5.2': {} + + '@lezer/highlight@1.2.3': + dependencies: + '@lezer/common': 1.5.2 + + '@lezer/json@1.0.3': + dependencies: + '@lezer/common': 1.5.2 + '@lezer/highlight': 1.2.3 + '@lezer/lr': 1.4.10 + + '@lezer/lr@1.4.10': + dependencies: + '@lezer/common': 1.5.2 + + '@marijn/find-cluster-break@1.0.3': {} + + '@protobuf-ts/grpcweb-transport@2.11.1': + dependencies: + '@protobuf-ts/runtime': 2.11.1 + '@protobuf-ts/runtime-rpc': 2.11.1 + + '@protobuf-ts/plugin@2.11.1': + dependencies: + '@bufbuild/protobuf': 2.13.0 + '@bufbuild/protoplugin': 2.13.0 + '@protobuf-ts/protoc': 2.11.1 + '@protobuf-ts/runtime': 2.11.1 + '@protobuf-ts/runtime-rpc': 2.11.1 + typescript: 3.9.10 + transitivePeerDependencies: + - supports-color + + '@protobuf-ts/protoc@2.11.1': {} + + '@protobuf-ts/runtime-rpc@2.11.1': + dependencies: + '@protobuf-ts/runtime': 2.11.1 + + '@protobuf-ts/runtime@2.11.1': {} + + '@rolldown/pluginutils@1.0.0-rc.3': {} + + '@rollup/rollup-android-arm-eabi@4.62.3': + optional: true + + '@rollup/rollup-android-arm64@4.62.3': + optional: true + + '@rollup/rollup-darwin-arm64@4.62.3': + optional: true + + '@rollup/rollup-darwin-x64@4.62.3': + optional: true + + '@rollup/rollup-freebsd-arm64@4.62.3': + optional: true + + '@rollup/rollup-freebsd-x64@4.62.3': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.62.3': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.62.3': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.62.3': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.62.3': + optional: true + + '@rollup/rollup-linux-loong64-gnu@4.62.3': + optional: true + + '@rollup/rollup-linux-loong64-musl@4.62.3': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.62.3': + optional: true + + '@rollup/rollup-linux-ppc64-musl@4.62.3': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.62.3': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.62.3': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.62.3': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.62.3': + optional: true + + '@rollup/rollup-linux-x64-musl@4.62.3': + optional: true + + '@rollup/rollup-openbsd-x64@4.62.3': + optional: true + + '@rollup/rollup-openharmony-arm64@4.62.3': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.62.3': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.62.3': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.62.3': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.62.3': + optional: true + + '@tanstack/react-virtual@3.14.9(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': + dependencies: + '@tanstack/virtual-core': 3.17.7 + react: 19.2.8 + react-dom: 19.2.8(react@19.2.8) + + '@tanstack/virtual-core@3.17.7': {} + + '@testing-library/dom@10.4.1': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/runtime': 7.29.7 + '@types/aria-query': 5.0.4 + aria-query: 5.3.0 + dom-accessibility-api: 0.5.16 + lz-string: 1.5.0 + picocolors: 1.1.1 + pretty-format: 27.5.1 + + '@testing-library/jest-dom@6.9.1': + dependencies: + '@adobe/css-tools': 4.5.0 + aria-query: 5.3.2 + css.escape: 1.5.1 + dom-accessibility-api: 0.6.3 + picocolors: 1.1.1 + redent: 3.0.0 + + '@testing-library/react@16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@19.2.4(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': + dependencies: + '@babel/runtime': 7.29.7 + '@testing-library/dom': 10.4.1 + react: 19.2.8 + react-dom: 19.2.8(react@19.2.8) + optionalDependencies: + '@types/react': 19.2.18 + '@types/react-dom': 19.2.4(@types/react@19.2.18) + + '@testing-library/user-event@14.6.1(@testing-library/dom@10.4.1)': + dependencies: + '@testing-library/dom': 10.4.1 + + '@types/aria-query@5.0.4': {} + + '@types/babel__core@7.20.5': + dependencies: + '@babel/parser': 7.29.8 + '@babel/types': 7.29.8 + '@types/babel__generator': 7.27.0 + '@types/babel__template': 7.4.4 + '@types/babel__traverse': 7.28.0 + + '@types/babel__generator@7.27.0': + dependencies: + '@babel/types': 7.29.8 + + '@types/babel__template@7.4.4': + dependencies: + '@babel/parser': 7.29.8 + '@babel/types': 7.29.8 + + '@types/babel__traverse@7.28.0': + dependencies: + '@babel/types': 7.29.8 + + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/d3-color@3.1.3': {} + + '@types/d3-drag@3.0.7': + dependencies: + '@types/d3-selection': 3.0.11 + + '@types/d3-interpolate@3.0.4': + dependencies: + '@types/d3-color': 3.1.3 + + '@types/d3-selection@3.0.11': {} + + '@types/d3-transition@3.0.9': + dependencies: + '@types/d3-selection': 3.0.11 + + '@types/d3-zoom@3.0.8': + dependencies: + '@types/d3-interpolate': 3.0.4 + '@types/d3-selection': 3.0.11 + + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.9': {} + + '@types/react-dom@19.2.4(@types/react@19.2.18)': + dependencies: + '@types/react': 19.2.18 + + '@types/react@19.2.18': + dependencies: + csstype: 3.2.3 + + '@typescript/vfs@1.6.4(typescript@5.4.5)': + dependencies: + debug: 4.4.3 + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + + '@vitejs/plugin-react@5.2.0(vite@7.3.6)': + dependencies: + '@babel/core': 7.29.7 + '@babel/plugin-transform-react-jsx-self': 7.29.7(@babel/core@7.29.7) + '@babel/plugin-transform-react-jsx-source': 7.29.7(@babel/core@7.29.7) + '@rolldown/pluginutils': 1.0.0-rc.3 + '@types/babel__core': 7.20.5 + react-refresh: 0.18.0 + vite: 7.3.6 + transitivePeerDependencies: + - supports-color + + '@vitest/expect@3.2.7': + dependencies: + '@types/chai': 5.2.3 + '@vitest/spy': 3.2.7 + '@vitest/utils': 3.2.7 + chai: 5.3.3 + tinyrainbow: 2.0.0 + + '@vitest/mocker@3.2.7(vite@7.3.6)': + dependencies: + '@vitest/spy': 3.2.7 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + vite: 7.3.6 + + '@vitest/pretty-format@3.2.7': + dependencies: + tinyrainbow: 2.0.0 + + '@vitest/runner@3.2.7': + dependencies: + '@vitest/utils': 3.2.7 + pathe: 2.0.3 + strip-literal: 3.1.0 + + '@vitest/snapshot@3.2.7': + dependencies: + '@vitest/pretty-format': 3.2.7 + magic-string: 0.30.21 + pathe: 2.0.3 + + '@vitest/spy@3.2.7': + dependencies: + tinyspy: 4.0.4 + + '@vitest/utils@3.2.7': + dependencies: + '@vitest/pretty-format': 3.2.7 + loupe: 3.2.1 + tinyrainbow: 2.0.0 + + '@xyflow/react@12.11.2(@types/react-dom@19.2.4(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': + dependencies: + '@xyflow/system': 0.0.79 + classcat: 5.0.5 + react: 19.2.8 + react-dom: 19.2.8(react@19.2.8) + zustand: 4.5.7(@types/react@19.2.18)(react@19.2.8) + optionalDependencies: + '@types/react': 19.2.18 + '@types/react-dom': 19.2.4(@types/react@19.2.18) + transitivePeerDependencies: + - immer + + '@xyflow/system@0.0.79': + dependencies: + '@types/d3-drag': 3.0.7 + '@types/d3-interpolate': 3.0.4 + '@types/d3-selection': 3.0.11 + '@types/d3-transition': 3.0.9 + '@types/d3-zoom': 3.0.8 + d3-drag: 3.0.0 + d3-interpolate: 3.0.1 + d3-selection: 3.0.0 + d3-zoom: 3.0.0 + + agent-base@7.1.4: {} + + ansi-regex@5.0.1: {} + + ansi-styles@5.2.0: {} + + aria-query@5.3.0: + dependencies: + dequal: 2.0.3 + + aria-query@5.3.2: {} + + assertion-error@2.0.1: {} + + baseline-browser-mapping@2.11.9: {} + + bidi-js@1.0.3: + dependencies: + require-from-string: 2.0.2 + + browserslist@4.28.7: + dependencies: + baseline-browser-mapping: 2.11.9 + caniuse-lite: 1.0.30001806 + electron-to-chromium: 1.5.399 + node-releases: 2.0.51 + update-browserslist-db: 1.2.3(browserslist@4.28.7) + + cac@6.7.14: {} + + caniuse-lite@1.0.30001806: {} + + chai@5.3.3: + dependencies: + assertion-error: 2.0.1 + check-error: 2.1.3 + deep-eql: 5.0.2 + loupe: 3.2.1 + pathval: 2.0.1 + + check-error@2.1.3: {} + + classcat@5.0.5: {} + + convert-source-map@2.0.0: {} + + crelt@1.0.7: {} + + css-tree@3.2.1: + dependencies: + mdn-data: 2.27.1 + source-map-js: 1.2.1 + + css.escape@1.5.1: {} + + cssstyle@5.3.7: + dependencies: + '@asamuzakjp/css-color': 4.1.2 + '@csstools/css-syntax-patches-for-csstree': 1.1.7(css-tree@3.2.1) + css-tree: 3.2.1 + lru-cache: 11.5.2 + + csstype@3.2.3: {} + + d3-color@3.1.0: {} + + d3-dispatch@3.0.1: {} + + d3-drag@3.0.0: + dependencies: + d3-dispatch: 3.0.1 + d3-selection: 3.0.0 + + d3-ease@3.0.1: {} + + d3-interpolate@3.0.1: + dependencies: + d3-color: 3.1.0 + + d3-selection@3.0.0: {} + + d3-timer@3.0.1: {} + + d3-transition@3.0.1(d3-selection@3.0.0): + dependencies: + d3-color: 3.1.0 + d3-dispatch: 3.0.1 + d3-ease: 3.0.1 + d3-interpolate: 3.0.1 + d3-selection: 3.0.0 + d3-timer: 3.0.1 + + d3-zoom@3.0.0: + dependencies: + d3-dispatch: 3.0.1 + d3-drag: 3.0.0 + d3-interpolate: 3.0.1 + d3-selection: 3.0.0 + d3-transition: 3.0.1(d3-selection@3.0.0) + + data-urls@6.0.1: + dependencies: + whatwg-mimetype: 5.0.0 + whatwg-url: 15.1.0 + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + decimal.js@10.6.0: {} + + deep-eql@5.0.2: {} + + dequal@2.0.3: {} + + dom-accessibility-api@0.5.16: {} + + dom-accessibility-api@0.6.3: {} + + electron-to-chromium@1.5.399: {} + + entities@8.0.0: {} + + es-module-lexer@1.7.0: {} + + esbuild@0.28.1: + optionalDependencies: + '@esbuild/aix-ppc64': 0.28.1 + '@esbuild/android-arm': 0.28.1 + '@esbuild/android-arm64': 0.28.1 + '@esbuild/android-x64': 0.28.1 + '@esbuild/darwin-arm64': 0.28.1 + '@esbuild/darwin-x64': 0.28.1 + '@esbuild/freebsd-arm64': 0.28.1 + '@esbuild/freebsd-x64': 0.28.1 + '@esbuild/linux-arm': 0.28.1 + '@esbuild/linux-arm64': 0.28.1 + '@esbuild/linux-ia32': 0.28.1 + '@esbuild/linux-loong64': 0.28.1 + '@esbuild/linux-mips64el': 0.28.1 + '@esbuild/linux-ppc64': 0.28.1 + '@esbuild/linux-riscv64': 0.28.1 + '@esbuild/linux-s390x': 0.28.1 + '@esbuild/linux-x64': 0.28.1 + '@esbuild/netbsd-arm64': 0.28.1 + '@esbuild/netbsd-x64': 0.28.1 + '@esbuild/openbsd-arm64': 0.28.1 + '@esbuild/openbsd-x64': 0.28.1 + '@esbuild/openharmony-arm64': 0.28.1 + '@esbuild/sunos-x64': 0.28.1 + '@esbuild/win32-arm64': 0.28.1 + '@esbuild/win32-ia32': 0.28.1 + '@esbuild/win32-x64': 0.28.1 + + escalade@3.2.0: {} + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.9 + + expect-type@1.4.0: {} + + fdir@6.5.0(picomatch@4.0.5): + optionalDependencies: + picomatch: 4.0.5 + + fsevents@2.3.3: + optional: true + + gensync@1.0.0-beta.2: {} + + html-encoding-sniffer@6.0.0: + dependencies: + '@exodus/bytes': 1.15.1 + transitivePeerDependencies: + - '@noble/hashes' + + http-proxy-agent@7.0.2: + dependencies: + agent-base: 7.1.4 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + + https-proxy-agent@7.0.6: + dependencies: + agent-base: 7.1.4 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + + indent-string@4.0.0: {} + + is-potential-custom-element-name@1.0.1: {} + + js-tokens@4.0.0: {} + + js-tokens@9.0.1: {} + + jsdom@27.4.0: + dependencies: + '@acemir/cssom': 0.9.31 + '@asamuzakjp/dom-selector': 6.8.1 + '@exodus/bytes': 1.15.1 + cssstyle: 5.3.7 + data-urls: 6.0.1 + decimal.js: 10.6.0 + html-encoding-sniffer: 6.0.0 + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.6 + is-potential-custom-element-name: 1.0.1 + parse5: 8.0.1 + saxes: 6.0.0 + symbol-tree: 3.2.4 + tough-cookie: 6.0.2 + w3c-xmlserializer: 5.0.0 + webidl-conversions: 8.0.1 + whatwg-mimetype: 4.0.0 + whatwg-url: 15.1.0 + ws: 8.21.1 + xml-name-validator: 5.0.0 + transitivePeerDependencies: + - '@noble/hashes' + - bufferutil + - supports-color + - utf-8-validate + + jsesc@3.1.0: {} + + json5@2.2.3: {} + + loupe@3.2.1: {} + + lru-cache@11.5.2: {} + + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + + lz-string@1.5.0: {} + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + + mdn-data@2.27.1: {} + + min-indent@1.0.1: {} + + ms@2.1.3: {} + + nanoid@3.3.16: {} + + node-releases@2.0.51: {} + + parse5@8.0.1: + dependencies: + entities: 8.0.0 + + pathe@2.0.3: {} + + pathval@2.0.1: {} + + picocolors@1.1.1: {} + + picomatch@4.0.5: {} + + postcss@8.5.25: + dependencies: + nanoid: 3.3.16 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + pretty-format@27.5.1: + dependencies: + ansi-regex: 5.0.1 + ansi-styles: 5.2.0 + react-is: 17.0.2 + + punycode@2.3.1: {} + + react-dom@19.2.8(react@19.2.8): + dependencies: + react: 19.2.8 + scheduler: 0.27.0 + + react-is@17.0.2: {} + + react-refresh@0.18.0: {} + + react@19.2.8: {} + + redent@3.0.0: + dependencies: + indent-string: 4.0.0 + strip-indent: 3.0.0 + + require-from-string@2.0.2: {} + + rollup@4.62.3: + dependencies: + '@types/estree': 1.0.9 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.62.3 + '@rollup/rollup-android-arm64': 4.62.3 + '@rollup/rollup-darwin-arm64': 4.62.3 + '@rollup/rollup-darwin-x64': 4.62.3 + '@rollup/rollup-freebsd-arm64': 4.62.3 + '@rollup/rollup-freebsd-x64': 4.62.3 + '@rollup/rollup-linux-arm-gnueabihf': 4.62.3 + '@rollup/rollup-linux-arm-musleabihf': 4.62.3 + '@rollup/rollup-linux-arm64-gnu': 4.62.3 + '@rollup/rollup-linux-arm64-musl': 4.62.3 + '@rollup/rollup-linux-loong64-gnu': 4.62.3 + '@rollup/rollup-linux-loong64-musl': 4.62.3 + '@rollup/rollup-linux-ppc64-gnu': 4.62.3 + '@rollup/rollup-linux-ppc64-musl': 4.62.3 + '@rollup/rollup-linux-riscv64-gnu': 4.62.3 + '@rollup/rollup-linux-riscv64-musl': 4.62.3 + '@rollup/rollup-linux-s390x-gnu': 4.62.3 + '@rollup/rollup-linux-x64-gnu': 4.62.3 + '@rollup/rollup-linux-x64-musl': 4.62.3 + '@rollup/rollup-openbsd-x64': 4.62.3 + '@rollup/rollup-openharmony-arm64': 4.62.3 + '@rollup/rollup-win32-arm64-msvc': 4.62.3 + '@rollup/rollup-win32-ia32-msvc': 4.62.3 + '@rollup/rollup-win32-x64-gnu': 4.62.3 + '@rollup/rollup-win32-x64-msvc': 4.62.3 + fsevents: 2.3.3 + + saxes@6.0.0: + dependencies: + xmlchars: 2.2.0 + + scheduler@0.27.0: {} + + semver@6.3.1: {} + + siginfo@2.0.0: {} + + source-map-js@1.2.1: {} + + stackback@0.0.2: {} + + std-env@3.10.0: {} + + strip-indent@3.0.0: + dependencies: + min-indent: 1.0.1 + + strip-literal@3.1.0: + dependencies: + js-tokens: 9.0.1 + + style-mod@4.1.3: {} + + symbol-tree@3.2.4: {} + + tinybench@2.9.0: {} + + tinyexec@0.3.2: {} + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.5) + picomatch: 4.0.5 + + tinypool@1.1.1: {} + + tinyrainbow@2.0.0: {} + + tinyspy@4.0.4: {} + + tldts-core@7.4.10: {} + + tldts@7.4.10: + dependencies: + tldts-core: 7.4.10 + + tough-cookie@6.0.2: + dependencies: + tldts: 7.4.10 + + tr46@6.0.0: + dependencies: + punycode: 2.3.1 + + typescript@3.9.10: {} + + typescript@5.4.5: {} + + typescript@5.9.3: {} + + update-browserslist-db@1.2.3(browserslist@4.28.7): + dependencies: + browserslist: 4.28.7 + escalade: 3.2.0 + picocolors: 1.1.1 + + use-sync-external-store@1.6.0(react@19.2.8): + dependencies: + react: 19.2.8 + + vite-node@3.2.4: + dependencies: + cac: 6.7.14 + debug: 4.4.3 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 7.3.6 + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + vite@7.3.6: + dependencies: + esbuild: 0.28.1 + fdir: 6.5.0(picomatch@4.0.5) + picomatch: 4.0.5 + postcss: 8.5.25 + rollup: 4.62.3 + tinyglobby: 0.2.17 + optionalDependencies: + fsevents: 2.3.3 + + vitest@3.2.7(jsdom@27.4.0): + dependencies: + '@types/chai': 5.2.3 + '@vitest/expect': 3.2.7 + '@vitest/mocker': 3.2.7(vite@7.3.6) + '@vitest/pretty-format': 3.2.7 + '@vitest/runner': 3.2.7 + '@vitest/snapshot': 3.2.7 + '@vitest/spy': 3.2.7 + '@vitest/utils': 3.2.7 + chai: 5.3.3 + debug: 4.4.3 + expect-type: 1.4.0 + magic-string: 0.30.21 + pathe: 2.0.3 + picomatch: 4.0.5 + std-env: 3.10.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.17 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 7.3.6 + vite-node: 3.2.4 + why-is-node-running: 2.3.0 + optionalDependencies: + jsdom: 27.4.0 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + w3c-keyname@2.2.8: {} + + w3c-xmlserializer@5.0.0: + dependencies: + xml-name-validator: 5.0.0 + + webidl-conversions@8.0.1: {} + + whatwg-mimetype@4.0.0: {} + + whatwg-mimetype@5.0.0: {} + + whatwg-url@15.1.0: + dependencies: + tr46: 6.0.0 + webidl-conversions: 8.0.1 + + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + + ws@8.21.1: {} + + xml-name-validator@5.0.0: {} + + xmlchars@2.2.0: {} + + yallist@3.1.1: {} + + zustand@4.5.7(@types/react@19.2.18)(react@19.2.8): + dependencies: + use-sync-external-store: 1.6.0(react@19.2.8) + optionalDependencies: + '@types/react': 19.2.18 + react: 19.2.8 diff --git a/web/operator/src/App.tsx b/web/operator/src/App.tsx new file mode 100644 index 0000000..8bdcce7 --- /dev/null +++ b/web/operator/src/App.tsx @@ -0,0 +1,144 @@ +import { useCallback, useEffect, useMemo, useState } from "react"; + +import type { OperatorApi } from "./api"; +import { Explorer, type Selection } from "./Explorer"; +import { GraphCanvas } from "./GraphCanvas"; +import { Inspector } from "./Inspector"; +import { RunControls } from "./RunControls"; +import { useOperatorProjection } from "./state"; + +export function App({ api }: { api: OperatorApi }) { + const { state, startRun, cancelRun } = useOperatorProjection(api); + const [selection, setSelection] = useState(); + const [inspectedNode, setInspectedNode] = useState(); + + useEffect(() => { + const workflows = state.catalog?.workflows ?? []; + if (!workflows.length) { + setSelection(undefined); + return; + } + if (!selection) { + setSelection({ kind: "workflow", workflowId: workflows[0].workflowId }); + return; + } + if (!workflows.some((workflow) => workflow.workflowId === selection.workflowId)) { + setSelection({ kind: "workflow", workflowId: workflows[0].workflowId }); + } + }, [selection, state.catalog]); + + const workflow = state.catalog?.workflows.find( + (item) => item.workflowId === selection?.workflowId, + ); + const run = selection?.kind === "run" ? state.runs[selection.runId] : undefined; + const latestRun = useMemo( + () => + Object.values(state.runs) + .filter((item) => item.summary?.workflowId === workflow?.workflowId) + .sort( + (left, right) => + Number(right.summary!.createdSequence) - Number(left.summary!.createdSequence), + )[0], + [state.runs, workflow?.workflowId], + ); + const openNode = useCallback((nodeId: string) => setInspectedNode(nodeId), []); + const select = useCallback((next: Selection) => { + setSelection(next); + setInspectedNode(undefined); + }, []); + + const selectedRun = run ?? (selection?.kind === "workflow" ? latestRun : undefined); + const liveEventKey = run && inspectedNode ? `${run.summary?.runId}:${inspectedNode}` : ""; + + return ( +
+
+
+ +
+ Avalanche + Operator +
+
+
+ {workflow?.rootAlias || "Local operator"} + {workflow && <>/{workflow.displayName}} + {run?.summary && <>/{run.summary.runId}} +
+
+ + {state.connection === "live" ? "Live" : state.connection} + seq {state.sequence} +
+
+ {state.error &&
{state.error}
} +
+ +
+
+
+ + {run ? "Historical run" : "Current definition"} + +

{run?.summary?.runId || workflow?.displayName || "Operator"}

+

+ {run + ? `Recorded topology · ${run.summary?.status ?? "unknown"}` + : workflow + ? `${workflow.nodeIds.length} nodes · ${workflow.relativeFile}` + : "Waiting for a workflow catalog"} +

+
+ +
+
+ {workflow || run?.topology ? ( + + ) : ( +
+ +

No workflows discovered

+

Catalog changes will appear here as the operator scans configured targets.

+
+ )} + {run && ( +
+ Immutable run snapshot + Current workflow changes do not alter this canvas +
+ )} +
+
+ {inspectedNode && ( + setInspectedNode(undefined)} + /> + )} +
+
+ ); +} diff --git a/web/operator/src/Explorer.tsx b/web/operator/src/Explorer.tsx new file mode 100644 index 0000000..1520746 --- /dev/null +++ b/web/operator/src/Explorer.tsx @@ -0,0 +1,202 @@ +import { useState } from "react"; + +import type { + CatalogSnapshotMsg, + FlowInfoMsg, + RunSnapshotMsg, + ScanTargetMsg, +} from "./generated/operator"; + +export type Selection = + | { kind: "workflow"; workflowId: string } + | { kind: "run"; workflowId: string; runId: string }; + +interface ExplorerProps { + catalog?: CatalogSnapshotMsg; + runs: Record; + selection?: Selection; + onSelect: (selection: Selection) => void; +} + +function statusLabel(status: string) { + return status === "success" ? "✓" : status === "failed" ? "!" : status === "running" ? "●" : "·"; +} + +function WorkflowBranch({ + workflow, + runs, + selection, + onSelect, +}: { + workflow: FlowInfoMsg; + runs: RunSnapshotMsg[]; + selection?: Selection; + onSelect: (selection: Selection) => void; +}) { + const [expanded, setExpanded] = useState(true); + return ( +
+
+ + +
+ {expanded && ( +
+ {runs.map((run) => { + const summary = run.summary!; + return ( + + ); + })} + {!runs.length && No runs yet} +
+ )} +
+ ); +} + +function targetWorkflows(catalog: CatalogSnapshotMsg, target: ScanTargetMsg) { + return catalog.workflows.filter((workflow) => workflow.rootAlias === target.alias); +} + +export function Explorer({ catalog, runs, selection, onSelect }: ExplorerProps) { + const [collapsedTargets, setCollapsedTargets] = useState>({}); + if (!catalog) { + return ( + + ); + } + const targets = catalog.scanTargets.length + ? catalog.scanTargets + : [ + { + alias: "workflows", + targetPath: "Configured workflows", + kind: "directory", + }, + ]; + return ( + + ); +} diff --git a/web/operator/src/GraphCanvas.tsx b/web/operator/src/GraphCanvas.tsx new file mode 100644 index 0000000..0767369 --- /dev/null +++ b/web/operator/src/GraphCanvas.tsx @@ -0,0 +1,243 @@ +import { memo, useMemo } from "react"; +import { + Background, + Controls, + Handle, + MarkerType, + Position, + ReactFlow, + type Edge, + type Node, + type NodeProps, +} from "@xyflow/react"; + +import type { + FlowInfoMsg, + NodeSnapshotMsg, + WorkflowTopologyMsg, +} from "./generated/operator"; +import { isUnknownRecord } from "./guards"; + +interface FieldMetadata { + name: string; + type?: string; + description?: string; +} + +export interface AgentDeclaration { + instructions: string; + inputs: FieldMetadata[]; + outputs: FieldMetadata[]; + model?: unknown; + runtime?: unknown; + skills?: unknown; + tools?: unknown; +} + +interface CardData extends Record { + label: string; + nodeType: string; + status?: string; + error?: string; + duration?: string; + declaration?: AgentDeclaration; + onOpen: () => void; +} + + +function fields(value: unknown): FieldMetadata[] { + if (!Array.isArray(value)) return []; + return value.flatMap((item) => { + if (!isUnknownRecord(item) || typeof item.name !== "string") return []; + return [ + { + name: item.name, + type: typeof item.type === "string" ? item.type : undefined, + description: + typeof item.description === "string" ? item.description : undefined, + }, + ]; + }); +} + +export function parseAgentDeclaration(raw: string | undefined): AgentDeclaration | undefined { + if (!raw) return undefined; + try { + const metadata: unknown = JSON.parse(raw); + if (!isUnknownRecord(metadata)) return undefined; + const signature = isUnknownRecord(metadata.signature) ? metadata.signature : {}; + return { + instructions: + typeof signature.instructions === "string" ? signature.instructions : "", + inputs: fields(signature.inputs), + outputs: fields(signature.outputs), + model: metadata.models, + runtime: metadata.runtime, + skills: metadata.skills, + tools: metadata.tools, + }; + } catch { + return undefined; + } +} + +const WorkflowNodeCard = memo(({ data }: NodeProps>) => ( + +)); +WorkflowNodeCard.displayName = "WorkflowNodeCard"; + +function positions(topology: WorkflowTopologyMsg): Record { + const incoming = Object.fromEntries(topology.nodeIds.map((nodeId) => [nodeId, 0])); + for (const edges of Object.values(topology.graph)) { + for (const child of edges.children) incoming[child] = (incoming[child] ?? 0) + 1; + } + const depths: Record = {}; + const queue = topology.nodeIds.filter((nodeId) => incoming[nodeId] === 0); + for (const nodeId of queue) depths[nodeId] = 0; + for (let index = 0; index < queue.length; index += 1) { + const parent = queue[index]; + for (const child of topology.graph[parent]?.children ?? []) { + depths[child] = Math.max(depths[child] ?? 0, depths[parent] + 1); + incoming[child] -= 1; + if (incoming[child] === 0) queue.push(child); + } + } + const rows: Record = {}; + for (const nodeId of topology.nodeIds) { + const depth = depths[nodeId] ?? 0; + (rows[depth] ??= []).push(nodeId); + } + return Object.fromEntries( + Object.entries(rows).flatMap(([depth, nodeIds]) => + nodeIds.map((nodeId, row) => [ + nodeId, + { x: Number(depth) * 330, y: row * 220 - ((nodeIds.length - 1) * 110) }, + ]), + ), + ); +} + +function elapsed(node: NodeSnapshotMsg): string | undefined { + if (!node.startedAt) return undefined; + const end = node.endedAt || Date.now() / 1000; + const seconds = Math.max(0, end - node.startedAt); + return seconds < 60 ? `${seconds.toFixed(1)}s` : `${Math.floor(seconds / 60)}m`; +} + +interface GraphCanvasProps { + workflow?: FlowInfoMsg; + runTopology?: WorkflowTopologyMsg; + runNodes?: NodeSnapshotMsg[]; + onOpenNode: (nodeId: string) => void; +} + +export function GraphCanvas({ + workflow, + runTopology, + runNodes = [], + onOpenNode, +}: GraphCanvasProps) { + const topology = useMemo(() => { + if (runTopology) return runTopology; + if (!workflow) return undefined; + return { + nodeIds: workflow.nodeIds, + graph: workflow.graph, + nodeTypes: workflow.nodeTypes, + displayNames: workflow.displayNames, + }; + }, [runTopology, workflow]); + const graph = useMemo(() => { + if (!topology) return { nodes: [], edges: [] }; + const layout = positions(topology); + const runtimeNodes = Object.fromEntries(runNodes.map((node) => [node.nodeId, node])); + const nodes: Node[] = topology.nodeIds.map((nodeId) => { + const runtimeNode = runtimeNodes[nodeId]; + return { + id: nodeId, + type: "workflow", + position: layout[nodeId], + data: { + label: topology.displayNames[nodeId] || runtimeNode?.name || nodeId, + nodeType: topology.nodeTypes[nodeId] || runtimeNode?.nodeType || "step", + status: runtimeNode?.status, + error: runtimeNode?.error, + duration: runtimeNode ? elapsed(runtimeNode) : undefined, + declaration: workflow + ? parseAgentDeclaration(workflow.agentMetadataJson[nodeId]) + : undefined, + onOpen: () => onOpenNode(nodeId), + }, + }; + }); + const seen = new Set(); + const edges: Edge[] = []; + for (const [source, children] of Object.entries(topology.graph)) { + for (const target of children.children) { + const id = `${source}->${target}`; + if (seen.has(id)) continue; + seen.add(id); + edges.push({ + id, + source, + target, + markerEnd: { type: MarkerType.ArrowClosed }, + className: "dag-edge", + }); + } + } + return { nodes, edges }; + }, [onOpenNode, runNodes, topology, workflow]); + + return ( + + + + + ); +} diff --git a/web/operator/src/Inspector.tsx b/web/operator/src/Inspector.tsx new file mode 100644 index 0000000..d02114b --- /dev/null +++ b/web/operator/src/Inspector.tsx @@ -0,0 +1,358 @@ +import { useEffect, useMemo, useRef, useState } from "react"; +import { useVirtualizer } from "@tanstack/react-virtual"; + +import type { OperatorApi } from "./api"; +import { parseAgentDeclaration } from "./GraphCanvas"; +import type { + AgentEventDescriptorMsg, + FlowInfoMsg, + LogRecordDescriptorMsg, + NodeSnapshotMsg, + RunSnapshotMsg, +} from "./generated/operator"; +import { isUnknownRecord } from "./guards"; +import { ValueView } from "./ValueView"; + +interface InspectorProps { + api: OperatorApi; + workflow?: FlowInfoMsg; + run?: RunSnapshotMsg; + nodeId?: string; + liveEvents?: AgentEventDescriptorMsg[]; + liveLogs?: LogRecordDescriptorMsg[]; + onClose: () => void; +} + +type RunTab = "overview" | "inputs" | "output" | "trace" | "logs"; + +function JsonBlock({ value }: { value: unknown }) { + return
{JSON.stringify(value, null, 2)}
; +} + +function eventPayload(value: unknown): Record | undefined { + if (!isUnknownRecord(value)) return undefined; + return isUnknownRecord(value.data) ? value.data : value; +} + +export function Inspector({ + api, + workflow, + run, + nodeId, + liveEvents = [], + liveLogs = [], + onClose, +}: InspectorProps) { + const [tab, setTab] = useState("overview"); + const [events, setEvents] = useState([]); + const [logs, setLogs] = useState([]); + const [selectedEvent, setSelectedEvent] = useState(); + const [detail, setDetail] = useState(); + const [detailError, setDetailError] = useState(); + const [following, setFollowing] = useState(true); + const detailCache = useRef(new Map()); + const scrollParent = useRef(null); + const node: NodeSnapshotMsg | undefined = run?.nodes.find((item) => item.nodeId === nodeId); + const declaration = workflow + ? parseAgentDeclaration(workflow.agentMetadataJson[nodeId ?? ""]) + : undefined; + + useEffect(() => { + setTab("overview"); + setEvents([]); + setLogs([]); + setSelectedEvent(undefined); + setDetail(undefined); + setFollowing(true); + detailCache.current.clear(); + if (!run || !nodeId) return; + let active = true; + void Promise.all([api.listAgentEvents(run, nodeId), api.listLogs(run)]) + .then(([nextEvents, nextLogs]) => { + if (!active) return; + setEvents(nextEvents); + setLogs(nextLogs.filter((entry) => !entry.nodeId || entry.nodeId === nodeId)); + }) + .catch((error: unknown) => { + if (active) { + setDetailError(error instanceof Error ? error.message : "Details unavailable"); + } + }); + return () => { + active = false; + }; + }, [api, nodeId, run]); + + const combinedEvents = useMemo(() => { + const bySequence = new Map(); + for (const event of [...events, ...liveEvents]) bySequence.set(event.eventSequence, event); + return [...bySequence.values()].sort( + (left, right) => Number(left.eventSequence) - Number(right.eventSequence), + ); + }, [events, liveEvents]); + const turns = combinedEvents.filter((event) => event.eventKind === "iteration.recorded"); + const combinedLogs = useMemo(() => { + const bySequence = new Map(); + for (const entry of [...logs, ...liveLogs]) bySequence.set(entry.sequence, entry); + return [...bySequence.values()].sort( + (left, right) => Number(left.sequence) - Number(right.sequence), + ); + }, [liveLogs, logs]); + const virtualizer = useVirtualizer({ + count: turns.length, + getScrollElement: () => scrollParent.current, + estimateSize: () => 64, + overscan: 6, + }); + + useEffect(() => { + if (!following || !turns.length) return; + setSelectedEvent(turns.at(-1)!.eventSequence); + }, [following, turns]); + + useEffect(() => { + const descriptor = combinedEvents.find((event) => event.eventSequence === selectedEvent); + if (!descriptor?.bodyToken) { + setDetail(undefined); + return; + } + const cached = detailCache.current.get(descriptor.bodyToken); + if (cached !== undefined) { + setDetail(cached); + return; + } + let active = true; + setDetail(undefined); + setDetailError(undefined); + void api + .readDetail(descriptor.bodyToken) + .then((body) => { + if (!active) return; + detailCache.current.delete(descriptor.bodyToken); + detailCache.current.set(descriptor.bodyToken, body); + while (detailCache.current.size > 8) { + const oldest = detailCache.current.keys().next().value; + if (oldest === undefined) break; + detailCache.current.delete(oldest); + } + setDetail(body); + }) + .catch((error: unknown) => { + if (active) { + setDetailError(error instanceof Error ? error.message : "Detail unavailable"); + } + }); + return () => { + active = false; + }; + }, [api, combinedEvents, selectedEvent]); + + useEffect(() => { + const kind = + tab === "inputs" ? "run.started" : tab === "output" ? "run.succeeded" : undefined; + if (!kind) return; + const descriptor = [...combinedEvents] + .reverse() + .find((event) => event.eventKind === kind); + if (descriptor) setSelectedEvent(descriptor.eventSequence); + }, [combinedEvents, tab]); + + if (!run && workflow && nodeId) { + return ( + + ); + } + + if (!run || !node) return null; + const selectedPayload = eventPayload(detail); + const valueKey = tab === "inputs" ? "inputs" : "outputs"; + + return ( + + ); +} diff --git a/web/operator/src/RunControls.tsx b/web/operator/src/RunControls.tsx new file mode 100644 index 0000000..af6f19d --- /dev/null +++ b/web/operator/src/RunControls.tsx @@ -0,0 +1,132 @@ +import { json } from "@codemirror/lang-json"; +import { EditorState } from "@codemirror/state"; +import { EditorView, keymap } from "@codemirror/view"; +import { useEffect, useRef, useState } from "react"; + +import type { FlowInfoMsg, RunSnapshotMsg } from "./generated/operator"; +import { isUnknownRecord } from "./guards"; + +interface JsonEditorProps { + value: string; + onChange: (value: string) => void; +} + +function JsonEditor({ value, onChange }: JsonEditorProps) { + const parent = useRef(null); + useEffect(() => { + if (!parent.current) return; + const view = new EditorView({ + parent: parent.current, + state: EditorState.create({ + doc: value, + extensions: [ + json(), + keymap.of([]), + EditorView.lineWrapping, + EditorView.theme({ + "&": { backgroundColor: "#0e1112", color: "#dce4df" }, + ".cm-content": { caretColor: "#eeff8c", minHeight: "110px" }, + ".cm-gutters": { backgroundColor: "#0e1112", color: "#626b67", border: "0" }, + "&.cm-focused": { outline: "1px solid #778357" }, + }), + EditorView.updateListener.of((update) => { + if (update.docChanged) onChange(update.state.doc.toString()); + }), + ], + }), + }); + return () => view.destroy(); + }, []); + return
; +} + +interface RunControlsProps { + workflow?: FlowInfoMsg; + run?: RunSnapshotMsg; + pending?: { kind: "start" | "cancel"; target: string }; + onStart: (workflowSelector: string, input?: Record) => Promise; + onCancel: (runId: string) => Promise; +} + +export function RunControls({ + workflow, + run, + pending, + onStart, + onCancel, +}: RunControlsProps) { + const [showInput, setShowInput] = useState(false); + const [draft, setDraft] = useState("{}"); + const [error, setError] = useState(); + const active = run?.summary?.status === "pending" || run?.summary?.status === "running"; + + const start = async () => { + if (!workflow) return; + setError(undefined); + let input: Record | undefined; + if (showInput) { + try { + const parsed: unknown = JSON.parse(draft); + if (!isUnknownRecord(parsed)) throw new Error("Run input must be a JSON object"); + input = parsed; + } catch (reason) { + setError(reason instanceof Error ? reason.message : "Run input is invalid JSON"); + return; + } + } + try { + await onStart(workflow.workflowId, input); + } catch (reason) { + setError(reason instanceof Error ? reason.message : "Operator rejected the run"); + } + }; + + return ( +
+ {workflow && ( + <> + + + + )} + {active && run?.summary && ( + + )} + {showInput && workflow && ( +
+
+ Workflow input + Schema-blind JSON object +
+ +
+ )} + {error &&
{error}
} +
+ ); +} diff --git a/web/operator/src/ValueView.test.tsx b/web/operator/src/ValueView.test.tsx new file mode 100644 index 0000000..def314e --- /dev/null +++ b/web/operator/src/ValueView.test.tsx @@ -0,0 +1,30 @@ +import { render, screen } from "@testing-library/react"; +import { describe, expect, it } from "vitest"; + +import { ValueView } from "./ValueView"; + +describe("ValueView", () => { + it("renders PredictRLM file values as reported host paths", () => { + render( + , + ); + + expect(screen.getByText("PredictRLM file")).toBeInTheDocument(); + expect(screen.getByText("/tmp/reports/source.pdf")).toBeInTheDocument(); + expect(screen.getByTitle(/contents are not copied/i)).toBeInTheDocument(); + }); + + it("renders explicitly unavailable values without coercion", () => { + render( + , + ); + + expect(screen.getByText(/Unavailable · unsupported value type: socket/)).toBeInTheDocument(); + }); +}); diff --git a/web/operator/src/ValueView.tsx b/web/operator/src/ValueView.tsx new file mode 100644 index 0000000..db89d42 --- /dev/null +++ b/web/operator/src/ValueView.tsx @@ -0,0 +1,54 @@ +import { isUnknownRecord } from "./guards"; + +interface ValueViewProps { + value: unknown; + depth?: number; +} + +export function ValueView({ value, depth = 0 }: ValueViewProps) { + if (value === null) return null; + if (typeof value === "string") return {value}; + if (typeof value === "number" || typeof value === "boolean") { + return {String(value)}; + } + if (Array.isArray(value)) { + return ( +
    + {value.map((item, index) => ( +
  1. + +
  2. + ))} +
+ ); + } + if (isUnknownRecord(value)) { + if (value.kind === "predict_rlm_file" && typeof value.path === "string") { + return ( + + + + PredictRLM file + {value.path} + + + ); + } + if (value.kind === "unavailable" && typeof value.reason === "string") { + return Unavailable · {value.reason}; + } + return ( +
+ {Object.entries(value).map(([key, item]) => ( +
+
{key}
+
+ +
+
+ ))} +
+ ); + } + return Unavailable; +} diff --git a/web/operator/src/api.ts b/web/operator/src/api.ts new file mode 100644 index 0000000..6a646e0 --- /dev/null +++ b/web/operator/src/api.ts @@ -0,0 +1,172 @@ +import { GrpcWebFetchTransport } from "@protobuf-ts/grpcweb-transport"; + +import { OperatorServiceClient } from "./generated/operator.client"; +import type { + AgentEventDescriptorMsg, + CatalogSnapshotMsg, + LogRecordDescriptorMsg, + OperatorUpdateEnvelope, + RunSnapshotMsg, + RunSummaryMsg, +} from "./generated/operator"; + +export interface StructuralBaseline { + catalog: CatalogSnapshotMsg; + asOfSequence: string; + runs: RunSnapshotMsg[]; +} + +export interface OperatorApi { + getCatalog(): Promise; + loadBaseline(): Promise; + streamUpdates(operatorInstanceId: string, afterSequence: string): AsyncIterable; + listAgentEvents(snapshot: RunSnapshotMsg, nodeId: string): Promise; + listLogs(snapshot: RunSnapshotMsg): Promise; + readDetail(bodyToken: string): Promise; + startRun(workflowSelector: string, input?: Record): Promise; + cancelRun(runId: string): Promise; +} + +export class GrpcWebOperatorApi implements OperatorApi { + readonly client: OperatorServiceClient; + + constructor(baseUrl = window.location.origin) { + const transport = new GrpcWebFetchTransport({ baseUrl, format: "binary" }); + this.client = new OperatorServiceClient(transport); + } + + async getCatalog(): Promise { + return (await this.client.getCatalog({}).response); + } + + async loadBaseline(): Promise { + const catalog = await this.getCatalog(); + const summaries: RunSummaryMsg[] = []; + let pageToken = ""; + let operatorInstanceId = ""; + let asOfSequence = "0"; + do { + const page = await this.client.listRunSummaries({ + workflowSelector: "", + pageSize: 100, + pageToken, + }).response; + if (!operatorInstanceId) { + operatorInstanceId = page.operatorInstanceId; + asOfSequence = page.asOfSequence; + } else if ( + page.operatorInstanceId !== operatorInstanceId || + page.asOfSequence !== asOfSequence + ) { + throw new Error("Run baseline changed while loading pages"); + } + summaries.push(...page.runs); + pageToken = page.nextPageToken; + } while (pageToken); + + const runs = await Promise.all( + summaries.map( + async (summary) => + await this.client.getRunSnapshot({ + runId: summary.runId, + operatorInstanceId, + asOfSequence, + }).response, + ), + ); + const confirmedCatalog = await this.getCatalog(); + if ( + catalog.operatorInstanceId !== operatorInstanceId || + confirmedCatalog.operatorInstanceId !== operatorInstanceId || + catalog.revision !== confirmedCatalog.revision || + BigInt(catalog.asOfSequence) > BigInt(asOfSequence) || + BigInt(confirmedCatalog.asOfSequence) < BigInt(asOfSequence) + ) { + throw new Error("Operator state changed while loading the browser baseline"); + } + return { catalog, asOfSequence, runs }; + } + + streamUpdates( + operatorInstanceId: string, + afterSequence: string, + ): AsyncIterable { + return this.client.streamOperatorUpdates({ operatorInstanceId, afterSequence }).responses; + } + + async listAgentEvents( + snapshot: RunSnapshotMsg, + nodeId: string, + ): Promise { + const node = snapshot.nodes.find((item) => item.nodeId === nodeId); + if (!node?.eventPageToken) return []; + const events: AgentEventDescriptorMsg[] = []; + let pageToken = node.eventPageToken; + let afterEventSequence = "0"; + do { + const page = await this.client.listAgentEvents({ + pageToken, + afterEventSequence, + pageSize: 100, + }).response; + events.push(...page.events); + if (page.events.length) { + afterEventSequence = page.events.at(-1)!.eventSequence; + } + pageToken = page.nextPageToken; + } while (pageToken); + return events; + } + + async listLogs(snapshot: RunSnapshotMsg): Promise { + if (!snapshot.logPageToken) return []; + const logs: LogRecordDescriptorMsg[] = []; + let pageToken = snapshot.logPageToken; + let afterSequence = "0"; + do { + const page = await this.client.listLogs({ + pageToken, + afterSequence, + pageSize: 100, + }).response; + logs.push(...page.logs); + if (page.logs.length) afterSequence = page.logs.at(-1)!.sequence; + pageToken = page.nextPageToken; + } while (pageToken); + return logs; + } + + async readDetail(bodyToken: string): Promise { + const chunks: Uint8Array[] = []; + for await (const chunk of this.client.readDetail({ bodyToken }).responses) { + chunks.push(chunk.data); + } + const length = chunks.reduce((total, chunk) => total + chunk.length, 0); + const body = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + body.set(chunk, offset); + offset += chunk.length; + } + return JSON.parse(new TextDecoder().decode(body)); + } + + async startRun( + workflowSelector: string, + input?: Record, + ): Promise { + const response = await this.client.startRun({ + flowName: "", + workflowSelector, + runId: "", + inputJson: input === undefined ? "" : JSON.stringify(input), + contextJson: "", + inputFiles: [], + }).response; + return response.runId; + } + + async cancelRun(runId: string): Promise { + await this.client.cancelRun({ runId }).response; + } +} diff --git a/web/operator/src/generated/operator.client.ts b/web/operator/src/generated/operator.client.ts new file mode 100644 index 0000000..ef79845 --- /dev/null +++ b/web/operator/src/generated/operator.client.ts @@ -0,0 +1,179 @@ +// @generated by protobuf-ts 2.11.1 with parameter long_type_string +// @generated from protobuf file "operator.proto" (package "avalanche.operator", syntax proto3) +// tslint:disable +import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; +import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; +import { OperatorService } from "./operator"; +import type { OperatorUpdateEnvelope } from "./operator"; +import type { StreamOperatorUpdatesRequest } from "./operator"; +import type { DetailChunk } from "./operator"; +import type { ReadDetailRequest } from "./operator"; +import type { TraceChunk } from "./operator"; +import type { ReadTraceRequest } from "./operator"; +import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; +import type { AgentEventPage } from "./operator"; +import type { ListAgentEventsRequest } from "./operator"; +import type { LogPage } from "./operator"; +import type { ListLogsRequest } from "./operator"; +import type { RunSnapshotMsg } from "./operator"; +import type { GetRunSnapshotRequest } from "./operator"; +import type { RunSummaryPage } from "./operator"; +import type { ListRunSummariesRequest } from "./operator"; +import type { RunResultMsg } from "./operator"; +import type { GetRunRequest } from "./operator"; +import type { CancelRunRequest } from "./operator"; +import type { StartRunResponse } from "./operator"; +import type { StartRunRequest } from "./operator"; +import { stackIntercept } from "@protobuf-ts/runtime-rpc"; +import type { CatalogSnapshotMsg } from "./operator"; +import type { Empty } from "./operator"; +import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; +import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; +// Breaking migration: the previous full-state run APIs are replaced by bounded +// summary, snapshot, detail, and typed update APIs below. Remote operators and +// clients must upgrade together. + +// ── Service ───────────────────────────────────────────── + +/** + * @generated from protobuf service avalanche.operator.OperatorService + */ +export interface IOperatorServiceClient { + /** + * @generated from protobuf rpc: GetCatalog + */ + getCatalog(input: Empty, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: StartRun + */ + startRun(input: StartRunRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: CancelRun + */ + cancelRun(input: CancelRunRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: GetRunResult + */ + getRunResult(input: GetRunRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: ListRunSummaries + */ + listRunSummaries(input: ListRunSummariesRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: GetRunSnapshot + */ + getRunSnapshot(input: GetRunSnapshotRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: ListLogs + */ + listLogs(input: ListLogsRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: ListAgentEvents + */ + listAgentEvents(input: ListAgentEventsRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: ReadTrace + */ + readTrace(input: ReadTraceRequest, options?: RpcOptions): ServerStreamingCall; + /** + * @generated from protobuf rpc: ReadDetail + */ + readDetail(input: ReadDetailRequest, options?: RpcOptions): ServerStreamingCall; + /** + * @generated from protobuf rpc: StreamOperatorUpdates + */ + streamOperatorUpdates(input: StreamOperatorUpdatesRequest, options?: RpcOptions): ServerStreamingCall; +} +// Breaking migration: the previous full-state run APIs are replaced by bounded +// summary, snapshot, detail, and typed update APIs below. Remote operators and +// clients must upgrade together. + +// ── Service ───────────────────────────────────────────── + +/** + * @generated from protobuf service avalanche.operator.OperatorService + */ +export class OperatorServiceClient implements IOperatorServiceClient, ServiceInfo { + typeName = OperatorService.typeName; + methods = OperatorService.methods; + options = OperatorService.options; + constructor(private readonly _transport: RpcTransport) { + } + /** + * @generated from protobuf rpc: GetCatalog + */ + getCatalog(input: Empty, options?: RpcOptions): UnaryCall { + const method = this.methods[0], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: StartRun + */ + startRun(input: StartRunRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[1], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: CancelRun + */ + cancelRun(input: CancelRunRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[2], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: GetRunResult + */ + getRunResult(input: GetRunRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[3], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: ListRunSummaries + */ + listRunSummaries(input: ListRunSummariesRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[4], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: GetRunSnapshot + */ + getRunSnapshot(input: GetRunSnapshotRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[5], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: ListLogs + */ + listLogs(input: ListLogsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[6], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: ListAgentEvents + */ + listAgentEvents(input: ListAgentEventsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[7], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: ReadTrace + */ + readTrace(input: ReadTraceRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[8], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: ReadDetail + */ + readDetail(input: ReadDetailRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[9], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: StreamOperatorUpdates + */ + streamOperatorUpdates(input: StreamOperatorUpdatesRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[10], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } +} diff --git a/web/operator/src/generated/operator.ts b/web/operator/src/generated/operator.ts new file mode 100644 index 0000000..580789f --- /dev/null +++ b/web/operator/src/generated/operator.ts @@ -0,0 +1,4269 @@ +// @generated by protobuf-ts 2.11.1 with parameter long_type_string +// @generated from protobuf file "operator.proto" (package "avalanche.operator", syntax proto3) +// tslint:disable +import { ServiceType } from "@protobuf-ts/runtime-rpc"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +// ── Request / Response ────────────────────────────────── + +/** + * @generated from protobuf message avalanche.operator.Empty + */ +export interface Empty { +} +/** + * @generated from protobuf message avalanche.operator.StartRunRequest + */ +export interface StartRunRequest { + /** + * @generated from protobuf field: string flow_name = 1 + */ + flowName: string; + /** + * @generated from protobuf field: string input_json = 2 + */ + inputJson: string; + /** + * @generated from protobuf field: string context_json = 3 + */ + contextJson: string; + /** + * @generated from protobuf field: repeated avalanche.operator.FileAttachment input_files = 4 + */ + inputFiles: FileAttachment[]; + /** + * @generated from protobuf field: string run_id = 6 + */ + runId: string; + /** + * @generated from protobuf field: string workflow_selector = 7 + */ + workflowSelector: string; +} +/** + * @generated from protobuf message avalanche.operator.FileAttachment + */ +export interface FileAttachment { + /** + * @generated from protobuf field: string field_name = 1 + */ + fieldName: string; + /** + * @generated from protobuf field: string name = 2 + */ + name: string; + /** + * @generated from protobuf field: bytes content = 3 + */ + content: Uint8Array; + /** + * @generated from protobuf field: string content_type = 4 + */ + contentType: string; + /** + * @generated from protobuf field: string sha256 = 5 + */ + sha256: string; +} +/** + * @generated from protobuf message avalanche.operator.StartRunResponse + */ +export interface StartRunResponse { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; +} +/** + * @generated from protobuf message avalanche.operator.CancelRunRequest + */ +export interface CancelRunRequest { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; +} +/** + * @generated from protobuf message avalanche.operator.GetRunRequest + */ +export interface GetRunRequest { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; +} +/** + * @generated from protobuf message avalanche.operator.ListRunSummariesRequest + */ +export interface ListRunSummariesRequest { + /** + * @generated from protobuf field: string workflow_selector = 1 + */ + workflowSelector: string; + /** + * @generated from protobuf field: uint32 page_size = 2 + */ + pageSize: number; + /** + * @generated from protobuf field: string page_token = 3 + */ + pageToken: string; +} +/** + * @generated from protobuf message avalanche.operator.GetRunSnapshotRequest + */ +export interface GetRunSnapshotRequest { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; + /** + * @generated from protobuf field: string operator_instance_id = 2 + */ + operatorInstanceId: string; + /** + * @generated from protobuf field: uint64 as_of_sequence = 3 + */ + asOfSequence: string; +} +/** + * Page tokens are opaque bearer references issued by GetRunSnapshot. The current + * loopback transport does not sign them; authenticated deployments must sign or + * tenant-bind tokens and reauthorize the referenced run on every use. + * + * @generated from protobuf message avalanche.operator.ListLogsRequest + */ +export interface ListLogsRequest { + /** + * Required snapshot-issued token. after_sequence is relative to this snapshot. + * + * @generated from protobuf field: string page_token = 1 + */ + pageToken: string; + /** + * Exclusive log cursor within the snapshot identified by page_token. + * + * @generated from protobuf field: uint64 after_sequence = 2 + */ + afterSequence: string; + /** + * @generated from protobuf field: uint32 page_size = 3 + */ + pageSize: number; +} +/** + * @generated from protobuf message avalanche.operator.ListAgentEventsRequest + */ +export interface ListAgentEventsRequest { + /** + * Required snapshot-issued token. after_event_sequence is relative to this snapshot. + * + * @generated from protobuf field: string page_token = 1 + */ + pageToken: string; + /** + * Exclusive event cursor within the snapshot identified by page_token. + * + * @generated from protobuf field: uint64 after_event_sequence = 2 + */ + afterEventSequence: string; + /** + * @generated from protobuf field: uint32 page_size = 3 + */ + pageSize: number; +} +/** + * @generated from protobuf message avalanche.operator.ReadTraceRequest + */ +export interface ReadTraceRequest { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; + /** + * @generated from protobuf field: string node_id = 2 + */ + nodeId: string; + /** + * @generated from protobuf field: uint64 revision = 3 + */ + revision: string; + /** + * @generated from protobuf field: string operator_instance_id = 4 + */ + operatorInstanceId: string; +} +/** + * @generated from protobuf message avalanche.operator.ReadDetailRequest + */ +export interface ReadDetailRequest { + /** + * @generated from protobuf field: string body_token = 1 + */ + bodyToken: string; +} +/** + * @generated from protobuf message avalanche.operator.StreamOperatorUpdatesRequest + */ +export interface StreamOperatorUpdatesRequest { + /** + * @generated from protobuf field: string operator_instance_id = 1 + */ + operatorInstanceId: string; + /** + * @generated from protobuf field: uint64 after_sequence = 2 + */ + afterSequence: string; +} +// ── Data Messages ─────────────────────────────────────── + +/** + * @generated from protobuf message avalanche.operator.NodeEdges + */ +export interface NodeEdges { + /** + * @generated from protobuf field: repeated string children = 1 + */ + children: string[]; +} +/** + * @generated from protobuf message avalanche.operator.WorkflowTopologyMsg + */ +export interface WorkflowTopologyMsg { + /** + * @generated from protobuf field: repeated string node_ids = 1 + */ + nodeIds: string[]; + /** + * @generated from protobuf field: map graph = 2 + */ + graph: { + [key: string]: NodeEdges; + }; + /** + * @generated from protobuf field: map node_types = 3 + */ + nodeTypes: { + [key: string]: string; + }; + /** + * @generated from protobuf field: map display_names = 4 + */ + displayNames: { + [key: string]: string; + }; +} +/** + * @generated from protobuf message avalanche.operator.FlowInfoMsg + */ +export interface FlowInfoMsg { + /** + * @generated from protobuf field: string name = 1 + */ + name: string; + /** + * @generated from protobuf field: string file_path = 2 + */ + filePath: string; + /** + * @generated from protobuf field: repeated string node_ids = 3 + */ + nodeIds: string[]; + /** + * @generated from protobuf field: map graph = 4 + */ + graph: { + [key: string]: NodeEdges; + }; + /** + * @generated from protobuf field: map node_types = 5 + */ + nodeTypes: { + [key: string]: string; + }; + /** + * @generated from protobuf field: map display_names = 6 + */ + displayNames: { + [key: string]: string; + }; + /** + * @generated from protobuf field: string cron = 7 + */ + cron: string; + /** + * @generated from protobuf field: double next_run_at = 8 + */ + nextRunAt: number; + /** + * @generated from protobuf field: double last_run_at = 9 + */ + lastRunAt: number; + /** + * @generated from protobuf field: string workflow_id = 10 + */ + workflowId: string; + /** + * @generated from protobuf field: string display_name = 11 + */ + displayName: string; + /** + * @generated from protobuf field: string root_alias = 12 + */ + rootAlias: string; + /** + * @generated from protobuf field: string relative_file = 13 + */ + relativeFile: string; + /** + * @generated from protobuf field: string builder_symbol = 14 + */ + builderSymbol: string; + /** + * @generated from protobuf field: repeated string agent_node_ids = 15 + */ + agentNodeIds: string[]; + /** + * @generated from protobuf field: map agent_metadata_json = 16 + */ + agentMetadataJson: { + [key: string]: string; + }; + /** + * @generated from protobuf field: string webhook_path = 17 + */ + webhookPath: string; + /** + * @generated from protobuf field: string webhook_url = 18 + */ + webhookUrl: string; + /** + * @generated from protobuf field: bool webhook_active = 19 + */ + webhookActive: boolean; +} +/** + * @generated from protobuf message avalanche.operator.DiscoveryDiagnosticMsg + */ +export interface DiscoveryDiagnosticMsg { + /** + * @generated from protobuf field: string path = 1 + */ + path: string; + /** + * @generated from protobuf field: string kind = 2 + */ + kind: string; + /** + * @generated from protobuf field: string message = 3 + */ + message: string; +} +/** + * @generated from protobuf message avalanche.operator.ScanTargetMsg + */ +export interface ScanTargetMsg { + /** + * @generated from protobuf field: string alias = 1 + */ + alias: string; + /** + * @generated from protobuf field: string target_path = 2 + */ + targetPath: string; + /** + * @generated from protobuf field: string kind = 3 + */ + kind: string; +} +/** + * @generated from protobuf message avalanche.operator.CatalogSnapshotMsg + */ +export interface CatalogSnapshotMsg { + /** + * @generated from protobuf field: string operator_instance_id = 1 + */ + operatorInstanceId: string; + /** + * @generated from protobuf field: uint64 as_of_sequence = 2 + */ + asOfSequence: string; + /** + * @generated from protobuf field: uint64 revision = 3 + */ + revision: string; + /** + * @generated from protobuf field: repeated avalanche.operator.FlowInfoMsg workflows = 4 + */ + workflows: FlowInfoMsg[]; + /** + * @generated from protobuf field: repeated avalanche.operator.ScanTargetMsg scan_targets = 5 + */ + scanTargets: ScanTargetMsg[]; + /** + * @generated from protobuf field: repeated avalanche.operator.DiscoveryDiagnosticMsg diagnostics = 6 + */ + diagnostics: DiscoveryDiagnosticMsg[]; +} +/** + * @generated from protobuf message avalanche.operator.ResultFileAttachment + */ +export interface ResultFileAttachment { + /** + * @generated from protobuf field: string attachment_id = 1 + */ + attachmentId: string; + /** + * @generated from protobuf field: optional string name = 2 + */ + name?: string; + /** + * @generated from protobuf field: bytes content = 3 + */ + content: Uint8Array; + /** + * @generated from protobuf field: optional string media_type = 4 + */ + mediaType?: string; + /** + * @generated from protobuf field: string sha256 = 5 + */ + sha256: string; +} +/** + * @generated from protobuf message avalanche.operator.RunResultMsg + */ +export interface RunResultMsg { + /** + * @generated from protobuf field: string value_json = 1 + */ + valueJson: string; + /** + * @generated from protobuf field: repeated avalanche.operator.ResultFileAttachment files = 2 + */ + files: ResultFileAttachment[]; +} +/** + * @generated from protobuf message avalanche.operator.RunSummaryMsg + */ +export interface RunSummaryMsg { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; + /** + * @generated from protobuf field: string flow_name = 2 + */ + flowName: string; + /** + * @generated from protobuf field: string status = 3 + */ + status: string; + /** + * @generated from protobuf field: double started_at = 4 + */ + startedAt: number; + /** + * @generated from protobuf field: double ended_at = 5 + */ + endedAt: number; + /** + * @generated from protobuf field: string triggered_by = 6 + */ + triggeredBy: string; + /** + * @generated from protobuf field: string workflow_id = 7 + */ + workflowId: string; + /** + * @generated from protobuf field: string workflow_display_name = 8 + */ + workflowDisplayName: string; + /** + * @generated from protobuf field: uint64 created_sequence = 9 + */ + createdSequence: string; + /** + * @generated from protobuf field: uint64 revision = 10 + */ + revision: string; +} +/** + * @generated from protobuf message avalanche.operator.TraceDescriptorMsg + */ +export interface TraceDescriptorMsg { + /** + * @generated from protobuf field: string status = 1 + */ + status: string; + /** + * @generated from protobuf field: uint64 revision = 2 + */ + revision: string; + /** + * @generated from protobuf field: bool available = 3 + */ + available: boolean; + /** + * @generated from protobuf field: bool complete = 4 + */ + complete: boolean; + /** + * @generated from protobuf field: uint64 event_count = 5 + */ + eventCount: string; + /** + * @generated from protobuf field: uint64 size_bytes = 6 + */ + sizeBytes: string; + /** + * @generated from protobuf field: uint64 latest_event_sequence = 7 + */ + latestEventSequence: string; +} +/** + * @generated from protobuf message avalanche.operator.NodeSnapshotMsg + */ +export interface NodeSnapshotMsg { + /** + * @generated from protobuf field: string node_id = 1 + */ + nodeId: string; + /** + * @generated from protobuf field: string name = 2 + */ + name: string; + /** + * @generated from protobuf field: string node_type = 3 + */ + nodeType: string; + /** + * @generated from protobuf field: string status = 4 + */ + status: string; + /** + * @generated from protobuf field: double started_at = 5 + */ + startedAt: number; + /** + * @generated from protobuf field: double ended_at = 6 + */ + endedAt: number; + /** + * @generated from protobuf field: avalanche.operator.TraceDescriptorMsg trace = 7 + */ + trace?: TraceDescriptorMsg; + /** + * @generated from protobuf field: uint64 revision = 8 + */ + revision: string; + /** + * @generated from protobuf field: string event_page_token = 9 + */ + eventPageToken: string; + /** + * @generated from protobuf field: optional string error = 10 + */ + error?: string; +} +/** + * @generated from protobuf message avalanche.operator.RunSnapshotMsg + */ +export interface RunSnapshotMsg { + /** + * @generated from protobuf field: string operator_instance_id = 1 + */ + operatorInstanceId: string; + /** + * @generated from protobuf field: uint64 as_of_sequence = 2 + */ + asOfSequence: string; + /** + * @generated from protobuf field: avalanche.operator.RunSummaryMsg summary = 3 + */ + summary?: RunSummaryMsg; + /** + * @generated from protobuf field: repeated avalanche.operator.NodeSnapshotMsg nodes = 4 + */ + nodes: NodeSnapshotMsg[]; + /** + * @generated from protobuf field: uint64 latest_log_sequence = 5 + */ + latestLogSequence: string; + /** + * @generated from protobuf field: string log_page_token = 6 + */ + logPageToken: string; + /** + * @generated from protobuf field: avalanche.operator.WorkflowTopologyMsg topology = 7 + */ + topology?: WorkflowTopologyMsg; +} +/** + * @generated from protobuf message avalanche.operator.RunSummaryPage + */ +export interface RunSummaryPage { + /** + * @generated from protobuf field: string operator_instance_id = 1 + */ + operatorInstanceId: string; + /** + * @generated from protobuf field: uint64 as_of_sequence = 2 + */ + asOfSequence: string; + /** + * @generated from protobuf field: repeated avalanche.operator.RunSummaryMsg runs = 3 + */ + runs: RunSummaryMsg[]; + /** + * @generated from protobuf field: string next_page_token = 4 + */ + nextPageToken: string; +} +/** + * @generated from protobuf message avalanche.operator.LogRecordDescriptorMsg + */ +export interface LogRecordDescriptorMsg { + /** + * @generated from protobuf field: uint64 sequence = 1 + */ + sequence: string; + /** + * @generated from protobuf field: double timestamp = 2 + */ + timestamp: number; + /** + * @generated from protobuf field: string level = 3 + */ + level: string; + /** + * @generated from protobuf field: string node_id = 4 + */ + nodeId: string; + /** + * @generated from protobuf field: uint64 size_bytes = 5 + */ + sizeBytes: string; + /** + * @generated from protobuf field: string body_token = 6 + */ + bodyToken: string; +} +/** + * @generated from protobuf message avalanche.operator.LogPage + */ +export interface LogPage { + /** + * @generated from protobuf field: string operator_instance_id = 1 + */ + operatorInstanceId: string; + /** + * @generated from protobuf field: uint64 as_of_sequence = 2 + */ + asOfSequence: string; + /** + * @generated from protobuf field: repeated avalanche.operator.LogRecordDescriptorMsg logs = 3 + */ + logs: LogRecordDescriptorMsg[]; + /** + * @generated from protobuf field: string next_page_token = 4 + */ + nextPageToken: string; +} +/** + * @generated from protobuf message avalanche.operator.AgentEventDescriptorMsg + */ +export interface AgentEventDescriptorMsg { + /** + * @generated from protobuf field: uint64 event_sequence = 1 + */ + eventSequence: string; + /** + * @generated from protobuf field: uint64 size_bytes = 2 + */ + sizeBytes: string; + /** + * @generated from protobuf field: string body_token = 3 + */ + bodyToken: string; + /** + * @generated from protobuf field: string invocation_id = 4 + */ + invocationId: string; + /** + * @generated from protobuf field: string event_kind = 5 + */ + eventKind: string; + /** + * @generated from protobuf field: optional uint32 iteration = 6 + */ + iteration?: number; + /** + * @generated from protobuf field: optional uint64 duration_ms = 7 + */ + durationMs?: string; + /** + * @generated from protobuf field: bool error = 8 + */ + error: boolean; + /** + * @generated from protobuf field: uint32 tool_count = 9 + */ + toolCount: number; + /** + * @generated from protobuf field: uint32 predict_count = 10 + */ + predictCount: number; +} +/** + * @generated from protobuf message avalanche.operator.AgentEventPage + */ +export interface AgentEventPage { + /** + * @generated from protobuf field: string operator_instance_id = 1 + */ + operatorInstanceId: string; + /** + * @generated from protobuf field: uint64 as_of_sequence = 2 + */ + asOfSequence: string; + /** + * @generated from protobuf field: string run_id = 3 + */ + runId: string; + /** + * @generated from protobuf field: string node_id = 4 + */ + nodeId: string; + /** + * @generated from protobuf field: repeated avalanche.operator.AgentEventDescriptorMsg events = 5 + */ + events: AgentEventDescriptorMsg[]; + /** + * @generated from protobuf field: string next_page_token = 6 + */ + nextPageToken: string; +} +/** + * @generated from protobuf message avalanche.operator.TraceChunk + */ +export interface TraceChunk { + /** + * @generated from protobuf field: uint64 revision = 1 + */ + revision: string; + /** + * @generated from protobuf field: uint64 chunk_index = 2 + */ + chunkIndex: string; + /** + * @generated from protobuf field: bytes data = 3 + */ + data: Uint8Array; + /** + * @generated from protobuf field: bool eof = 4 + */ + eof: boolean; +} +/** + * @generated from protobuf message avalanche.operator.DetailChunk + */ +export interface DetailChunk { + /** + * @generated from protobuf field: uint64 chunk_index = 1 + */ + chunkIndex: string; + /** + * @generated from protobuf field: bytes data = 2 + */ + data: Uint8Array; + /** + * @generated from protobuf field: bool eof = 3 + */ + eof: boolean; +} +/** + * @generated from protobuf message avalanche.operator.RunCreated + */ +export interface RunCreated { + /** + * @generated from protobuf field: avalanche.operator.RunSummaryMsg summary = 1 + */ + summary?: RunSummaryMsg; + /** + * @generated from protobuf field: repeated avalanche.operator.NodeSnapshotMsg nodes = 2 + */ + nodes: NodeSnapshotMsg[]; + /** + * @generated from protobuf field: avalanche.operator.WorkflowTopologyMsg topology = 3 + */ + topology?: WorkflowTopologyMsg; +} +/** + * @generated from protobuf message avalanche.operator.RunStatusChanged + */ +export interface RunStatusChanged { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; + /** + * @generated from protobuf field: string status = 2 + */ + status: string; + /** + * @generated from protobuf field: double started_at = 3 + */ + startedAt: number; + /** + * @generated from protobuf field: double ended_at = 4 + */ + endedAt: number; + /** + * @generated from protobuf field: uint64 revision = 5 + */ + revision: string; +} +/** + * @generated from protobuf message avalanche.operator.NodeStatusChanged + */ +export interface NodeStatusChanged { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; + /** + * @generated from protobuf field: string node_id = 2 + */ + nodeId: string; + /** + * @generated from protobuf field: string status = 3 + */ + status: string; + /** + * @generated from protobuf field: double started_at = 4 + */ + startedAt: number; + /** + * @generated from protobuf field: double ended_at = 5 + */ + endedAt: number; + /** + * @generated from protobuf field: uint64 revision = 6 + */ + revision: string; + /** + * @generated from protobuf field: optional string error = 7 + */ + error?: string; +} +/** + * @generated from protobuf message avalanche.operator.LogAppended + */ +export interface LogAppended { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; + /** + * @generated from protobuf field: avalanche.operator.LogRecordDescriptorMsg log = 2 + */ + log?: LogRecordDescriptorMsg; +} +/** + * @generated from protobuf message avalanche.operator.AgentEventAppended + */ +export interface AgentEventAppended { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; + /** + * @generated from protobuf field: string node_id = 2 + */ + nodeId: string; + /** + * @generated from protobuf field: avalanche.operator.AgentEventDescriptorMsg event = 3 + */ + event?: AgentEventDescriptorMsg; +} +/** + * @generated from protobuf message avalanche.operator.TraceFinalized + */ +export interface TraceFinalized { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; + /** + * @generated from protobuf field: string node_id = 2 + */ + nodeId: string; + /** + * @generated from protobuf field: avalanche.operator.TraceDescriptorMsg trace = 3 + */ + trace?: TraceDescriptorMsg; +} +/** + * @generated from protobuf message avalanche.operator.CatalogReplaced + */ +export interface CatalogReplaced { + /** + * @generated from protobuf field: avalanche.operator.CatalogSnapshotMsg catalog = 1 + */ + catalog?: CatalogSnapshotMsg; +} +/** + * @generated from protobuf message avalanche.operator.OperatorUpdate + */ +export interface OperatorUpdate { + /** + * @generated from protobuf field: uint64 sequence = 1 + */ + sequence: string; + /** + * @generated from protobuf oneof: change + */ + change: { + oneofKind: "runCreated"; + /** + * @generated from protobuf field: avalanche.operator.RunCreated run_created = 2 + */ + runCreated: RunCreated; + } | { + oneofKind: "runStatusChanged"; + /** + * @generated from protobuf field: avalanche.operator.RunStatusChanged run_status_changed = 3 + */ + runStatusChanged: RunStatusChanged; + } | { + oneofKind: "nodeStatusChanged"; + /** + * @generated from protobuf field: avalanche.operator.NodeStatusChanged node_status_changed = 4 + */ + nodeStatusChanged: NodeStatusChanged; + } | { + oneofKind: "logAppended"; + /** + * @generated from protobuf field: avalanche.operator.LogAppended log_appended = 5 + */ + logAppended: LogAppended; + } | { + oneofKind: "agentEventAppended"; + /** + * @generated from protobuf field: avalanche.operator.AgentEventAppended agent_event_appended = 6 + */ + agentEventAppended: AgentEventAppended; + } | { + oneofKind: "traceFinalized"; + /** + * @generated from protobuf field: avalanche.operator.TraceFinalized trace_finalized = 7 + */ + traceFinalized: TraceFinalized; + } | { + oneofKind: "catalogReplaced"; + /** + * @generated from protobuf field: avalanche.operator.CatalogReplaced catalog_replaced = 8 + */ + catalogReplaced: CatalogReplaced; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf message avalanche.operator.ResetRequired + */ +export interface ResetRequired { + /** + * @generated from protobuf field: uint64 history_floor = 1 + */ + historyFloor: string; + /** + * @generated from protobuf field: uint64 latest_sequence = 2 + */ + latestSequence: string; +} +/** + * @generated from protobuf message avalanche.operator.OperatorUpdateEnvelope + */ +export interface OperatorUpdateEnvelope { + /** + * @generated from protobuf field: string operator_instance_id = 1 + */ + operatorInstanceId: string; + /** + * @generated from protobuf oneof: payload + */ + payload: { + oneofKind: "update"; + /** + * @generated from protobuf field: avalanche.operator.OperatorUpdate update = 2 + */ + update: OperatorUpdate; + } | { + oneofKind: "resetRequired"; + /** + * @generated from protobuf field: avalanche.operator.ResetRequired reset_required = 3 + */ + resetRequired: ResetRequired; + } | { + oneofKind: undefined; + }; +} +// @generated message type with reflection information, may provide speed optimized methods +class Empty$Type extends MessageType { + constructor() { + super("avalanche.operator.Empty", []); + } + create(value?: PartialMessage): Empty { + const message = globalThis.Object.create((this.messagePrototype!)); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Empty): Empty { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Empty, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.Empty + */ +export const Empty = new Empty$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StartRunRequest$Type extends MessageType { + constructor() { + super("avalanche.operator.StartRunRequest", [ + { no: 1, name: "flow_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "input_json", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "context_json", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "input_files", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => FileAttachment }, + { no: 6, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "workflow_selector", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): StartRunRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.flowName = ""; + message.inputJson = ""; + message.contextJson = ""; + message.inputFiles = []; + message.runId = ""; + message.workflowSelector = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StartRunRequest): StartRunRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string flow_name */ 1: + message.flowName = reader.string(); + break; + case /* string input_json */ 2: + message.inputJson = reader.string(); + break; + case /* string context_json */ 3: + message.contextJson = reader.string(); + break; + case /* repeated avalanche.operator.FileAttachment input_files */ 4: + message.inputFiles.push(FileAttachment.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string run_id */ 6: + message.runId = reader.string(); + break; + case /* string workflow_selector */ 7: + message.workflowSelector = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: StartRunRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string flow_name = 1; */ + if (message.flowName !== "") + writer.tag(1, WireType.LengthDelimited).string(message.flowName); + /* string input_json = 2; */ + if (message.inputJson !== "") + writer.tag(2, WireType.LengthDelimited).string(message.inputJson); + /* string context_json = 3; */ + if (message.contextJson !== "") + writer.tag(3, WireType.LengthDelimited).string(message.contextJson); + /* repeated avalanche.operator.FileAttachment input_files = 4; */ + for (let i = 0; i < message.inputFiles.length; i++) + FileAttachment.internalBinaryWrite(message.inputFiles[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* string run_id = 6; */ + if (message.runId !== "") + writer.tag(6, WireType.LengthDelimited).string(message.runId); + /* string workflow_selector = 7; */ + if (message.workflowSelector !== "") + writer.tag(7, WireType.LengthDelimited).string(message.workflowSelector); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.StartRunRequest + */ +export const StartRunRequest = new StartRunRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FileAttachment$Type extends MessageType { + constructor() { + super("avalanche.operator.FileAttachment", [ + { no: 1, name: "field_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "content", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "content_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "sha256", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): FileAttachment { + const message = globalThis.Object.create((this.messagePrototype!)); + message.fieldName = ""; + message.name = ""; + message.content = new Uint8Array(0); + message.contentType = ""; + message.sha256 = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileAttachment): FileAttachment { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string field_name */ 1: + message.fieldName = reader.string(); + break; + case /* string name */ 2: + message.name = reader.string(); + break; + case /* bytes content */ 3: + message.content = reader.bytes(); + break; + case /* string content_type */ 4: + message.contentType = reader.string(); + break; + case /* string sha256 */ 5: + message.sha256 = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FileAttachment, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string field_name = 1; */ + if (message.fieldName !== "") + writer.tag(1, WireType.LengthDelimited).string(message.fieldName); + /* string name = 2; */ + if (message.name !== "") + writer.tag(2, WireType.LengthDelimited).string(message.name); + /* bytes content = 3; */ + if (message.content.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.content); + /* string content_type = 4; */ + if (message.contentType !== "") + writer.tag(4, WireType.LengthDelimited).string(message.contentType); + /* string sha256 = 5; */ + if (message.sha256 !== "") + writer.tag(5, WireType.LengthDelimited).string(message.sha256); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.FileAttachment + */ +export const FileAttachment = new FileAttachment$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StartRunResponse$Type extends MessageType { + constructor() { + super("avalanche.operator.StartRunResponse", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): StartRunResponse { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StartRunResponse): StartRunResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: StartRunResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.StartRunResponse + */ +export const StartRunResponse = new StartRunResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CancelRunRequest$Type extends MessageType { + constructor() { + super("avalanche.operator.CancelRunRequest", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): CancelRunRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CancelRunRequest): CancelRunRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CancelRunRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.CancelRunRequest + */ +export const CancelRunRequest = new CancelRunRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetRunRequest$Type extends MessageType { + constructor() { + super("avalanche.operator.GetRunRequest", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): GetRunRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRunRequest): GetRunRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: GetRunRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.GetRunRequest + */ +export const GetRunRequest = new GetRunRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListRunSummariesRequest$Type extends MessageType { + constructor() { + super("avalanche.operator.ListRunSummariesRequest", [ + { no: 1, name: "workflow_selector", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "page_size", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 3, name: "page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ListRunSummariesRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.workflowSelector = ""; + message.pageSize = 0; + message.pageToken = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListRunSummariesRequest): ListRunSummariesRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string workflow_selector */ 1: + message.workflowSelector = reader.string(); + break; + case /* uint32 page_size */ 2: + message.pageSize = reader.uint32(); + break; + case /* string page_token */ 3: + message.pageToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListRunSummariesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string workflow_selector = 1; */ + if (message.workflowSelector !== "") + writer.tag(1, WireType.LengthDelimited).string(message.workflowSelector); + /* uint32 page_size = 2; */ + if (message.pageSize !== 0) + writer.tag(2, WireType.Varint).uint32(message.pageSize); + /* string page_token = 3; */ + if (message.pageToken !== "") + writer.tag(3, WireType.LengthDelimited).string(message.pageToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.ListRunSummariesRequest + */ +export const ListRunSummariesRequest = new ListRunSummariesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetRunSnapshotRequest$Type extends MessageType { + constructor() { + super("avalanche.operator.GetRunSnapshotRequest", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "operator_instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "as_of_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + ]); + } + create(value?: PartialMessage): GetRunSnapshotRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + message.operatorInstanceId = ""; + message.asOfSequence = "0"; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRunSnapshotRequest): GetRunSnapshotRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + case /* string operator_instance_id */ 2: + message.operatorInstanceId = reader.string(); + break; + case /* uint64 as_of_sequence */ 3: + message.asOfSequence = reader.uint64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: GetRunSnapshotRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + /* string operator_instance_id = 2; */ + if (message.operatorInstanceId !== "") + writer.tag(2, WireType.LengthDelimited).string(message.operatorInstanceId); + /* uint64 as_of_sequence = 3; */ + if (message.asOfSequence !== "0") + writer.tag(3, WireType.Varint).uint64(message.asOfSequence); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.GetRunSnapshotRequest + */ +export const GetRunSnapshotRequest = new GetRunSnapshotRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListLogsRequest$Type extends MessageType { + constructor() { + super("avalanche.operator.ListLogsRequest", [ + { no: 1, name: "page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "after_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "page_size", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): ListLogsRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.pageToken = ""; + message.afterSequence = "0"; + message.pageSize = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListLogsRequest): ListLogsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string page_token */ 1: + message.pageToken = reader.string(); + break; + case /* uint64 after_sequence */ 2: + message.afterSequence = reader.uint64().toString(); + break; + case /* uint32 page_size */ 3: + message.pageSize = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListLogsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string page_token = 1; */ + if (message.pageToken !== "") + writer.tag(1, WireType.LengthDelimited).string(message.pageToken); + /* uint64 after_sequence = 2; */ + if (message.afterSequence !== "0") + writer.tag(2, WireType.Varint).uint64(message.afterSequence); + /* uint32 page_size = 3; */ + if (message.pageSize !== 0) + writer.tag(3, WireType.Varint).uint32(message.pageSize); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.ListLogsRequest + */ +export const ListLogsRequest = new ListLogsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListAgentEventsRequest$Type extends MessageType { + constructor() { + super("avalanche.operator.ListAgentEventsRequest", [ + { no: 1, name: "page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "after_event_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "page_size", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): ListAgentEventsRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.pageToken = ""; + message.afterEventSequence = "0"; + message.pageSize = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListAgentEventsRequest): ListAgentEventsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string page_token */ 1: + message.pageToken = reader.string(); + break; + case /* uint64 after_event_sequence */ 2: + message.afterEventSequence = reader.uint64().toString(); + break; + case /* uint32 page_size */ 3: + message.pageSize = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListAgentEventsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string page_token = 1; */ + if (message.pageToken !== "") + writer.tag(1, WireType.LengthDelimited).string(message.pageToken); + /* uint64 after_event_sequence = 2; */ + if (message.afterEventSequence !== "0") + writer.tag(2, WireType.Varint).uint64(message.afterEventSequence); + /* uint32 page_size = 3; */ + if (message.pageSize !== 0) + writer.tag(3, WireType.Varint).uint32(message.pageSize); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.ListAgentEventsRequest + */ +export const ListAgentEventsRequest = new ListAgentEventsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReadTraceRequest$Type extends MessageType { + constructor() { + super("avalanche.operator.ReadTraceRequest", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "node_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "revision", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "operator_instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ReadTraceRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + message.nodeId = ""; + message.revision = "0"; + message.operatorInstanceId = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReadTraceRequest): ReadTraceRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + case /* string node_id */ 2: + message.nodeId = reader.string(); + break; + case /* uint64 revision */ 3: + message.revision = reader.uint64().toString(); + break; + case /* string operator_instance_id */ 4: + message.operatorInstanceId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ReadTraceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + /* string node_id = 2; */ + if (message.nodeId !== "") + writer.tag(2, WireType.LengthDelimited).string(message.nodeId); + /* uint64 revision = 3; */ + if (message.revision !== "0") + writer.tag(3, WireType.Varint).uint64(message.revision); + /* string operator_instance_id = 4; */ + if (message.operatorInstanceId !== "") + writer.tag(4, WireType.LengthDelimited).string(message.operatorInstanceId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.ReadTraceRequest + */ +export const ReadTraceRequest = new ReadTraceRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReadDetailRequest$Type extends MessageType { + constructor() { + super("avalanche.operator.ReadDetailRequest", [ + { no: 1, name: "body_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ReadDetailRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.bodyToken = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReadDetailRequest): ReadDetailRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string body_token */ 1: + message.bodyToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ReadDetailRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string body_token = 1; */ + if (message.bodyToken !== "") + writer.tag(1, WireType.LengthDelimited).string(message.bodyToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.ReadDetailRequest + */ +export const ReadDetailRequest = new ReadDetailRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StreamOperatorUpdatesRequest$Type extends MessageType { + constructor() { + super("avalanche.operator.StreamOperatorUpdatesRequest", [ + { no: 1, name: "operator_instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "after_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + ]); + } + create(value?: PartialMessage): StreamOperatorUpdatesRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.operatorInstanceId = ""; + message.afterSequence = "0"; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StreamOperatorUpdatesRequest): StreamOperatorUpdatesRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string operator_instance_id */ 1: + message.operatorInstanceId = reader.string(); + break; + case /* uint64 after_sequence */ 2: + message.afterSequence = reader.uint64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: StreamOperatorUpdatesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string operator_instance_id = 1; */ + if (message.operatorInstanceId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.operatorInstanceId); + /* uint64 after_sequence = 2; */ + if (message.afterSequence !== "0") + writer.tag(2, WireType.Varint).uint64(message.afterSequence); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.StreamOperatorUpdatesRequest + */ +export const StreamOperatorUpdatesRequest = new StreamOperatorUpdatesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NodeEdges$Type extends MessageType { + constructor() { + super("avalanche.operator.NodeEdges", [ + { no: 1, name: "children", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): NodeEdges { + const message = globalThis.Object.create((this.messagePrototype!)); + message.children = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeEdges): NodeEdges { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string children */ 1: + message.children.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: NodeEdges, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string children = 1; */ + for (let i = 0; i < message.children.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.children[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.NodeEdges + */ +export const NodeEdges = new NodeEdges$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class WorkflowTopologyMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.WorkflowTopologyMsg", [ + { no: 1, name: "node_ids", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "graph", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => NodeEdges } }, + { no: 3, name: "node_types", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }, + { no: 4, name: "display_names", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } } + ]); + } + create(value?: PartialMessage): WorkflowTopologyMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.nodeIds = []; + message.graph = {}; + message.nodeTypes = {}; + message.displayNames = {}; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WorkflowTopologyMsg): WorkflowTopologyMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string node_ids */ 1: + message.nodeIds.push(reader.string()); + break; + case /* map graph */ 2: + this.binaryReadMap2(message.graph, reader, options); + break; + case /* map node_types */ 3: + this.binaryReadMap3(message.nodeTypes, reader, options); + break; + case /* map display_names */ 4: + this.binaryReadMap4(message.displayNames, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap2(map: WorkflowTopologyMsg["graph"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof WorkflowTopologyMsg["graph"] | undefined, val: WorkflowTopologyMsg["graph"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = NodeEdges.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for avalanche.operator.WorkflowTopologyMsg.graph"); + } + } + map[key ?? ""] = val ?? NodeEdges.create(); + } + private binaryReadMap3(map: WorkflowTopologyMsg["nodeTypes"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof WorkflowTopologyMsg["nodeTypes"] | undefined, val: WorkflowTopologyMsg["nodeTypes"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.string(); + break; + default: throw new globalThis.Error("unknown map entry field for avalanche.operator.WorkflowTopologyMsg.node_types"); + } + } + map[key ?? ""] = val ?? ""; + } + private binaryReadMap4(map: WorkflowTopologyMsg["displayNames"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof WorkflowTopologyMsg["displayNames"] | undefined, val: WorkflowTopologyMsg["displayNames"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.string(); + break; + default: throw new globalThis.Error("unknown map entry field for avalanche.operator.WorkflowTopologyMsg.display_names"); + } + } + map[key ?? ""] = val ?? ""; + } + internalBinaryWrite(message: WorkflowTopologyMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string node_ids = 1; */ + for (let i = 0; i < message.nodeIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.nodeIds[i]); + /* map graph = 2; */ + for (let k of globalThis.Object.keys(message.graph)) { + writer.tag(2, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + NodeEdges.internalBinaryWrite(message.graph[k], writer, options); + writer.join().join(); + } + /* map node_types = 3; */ + for (let k of globalThis.Object.keys(message.nodeTypes)) + writer.tag(3, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.nodeTypes[k]).join(); + /* map display_names = 4; */ + for (let k of globalThis.Object.keys(message.displayNames)) + writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.displayNames[k]).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.WorkflowTopologyMsg + */ +export const WorkflowTopologyMsg = new WorkflowTopologyMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FlowInfoMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.FlowInfoMsg", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "file_path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "node_ids", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "graph", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => NodeEdges } }, + { no: 5, name: "node_types", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }, + { no: 6, name: "display_names", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }, + { no: 7, name: "cron", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "next_run_at", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 9, name: "last_run_at", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 10, name: "workflow_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: "display_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: "root_alias", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 13, name: "relative_file", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 14, name: "builder_symbol", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 15, name: "agent_node_ids", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 16, name: "agent_metadata_json", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }, + { no: 17, name: "webhook_path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 18, name: "webhook_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 19, name: "webhook_active", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): FlowInfoMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.name = ""; + message.filePath = ""; + message.nodeIds = []; + message.graph = {}; + message.nodeTypes = {}; + message.displayNames = {}; + message.cron = ""; + message.nextRunAt = 0; + message.lastRunAt = 0; + message.workflowId = ""; + message.displayName = ""; + message.rootAlias = ""; + message.relativeFile = ""; + message.builderSymbol = ""; + message.agentNodeIds = []; + message.agentMetadataJson = {}; + message.webhookPath = ""; + message.webhookUrl = ""; + message.webhookActive = false; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FlowInfoMsg): FlowInfoMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* string file_path */ 2: + message.filePath = reader.string(); + break; + case /* repeated string node_ids */ 3: + message.nodeIds.push(reader.string()); + break; + case /* map graph */ 4: + this.binaryReadMap4(message.graph, reader, options); + break; + case /* map node_types */ 5: + this.binaryReadMap5(message.nodeTypes, reader, options); + break; + case /* map display_names */ 6: + this.binaryReadMap6(message.displayNames, reader, options); + break; + case /* string cron */ 7: + message.cron = reader.string(); + break; + case /* double next_run_at */ 8: + message.nextRunAt = reader.double(); + break; + case /* double last_run_at */ 9: + message.lastRunAt = reader.double(); + break; + case /* string workflow_id */ 10: + message.workflowId = reader.string(); + break; + case /* string display_name */ 11: + message.displayName = reader.string(); + break; + case /* string root_alias */ 12: + message.rootAlias = reader.string(); + break; + case /* string relative_file */ 13: + message.relativeFile = reader.string(); + break; + case /* string builder_symbol */ 14: + message.builderSymbol = reader.string(); + break; + case /* repeated string agent_node_ids */ 15: + message.agentNodeIds.push(reader.string()); + break; + case /* map agent_metadata_json */ 16: + this.binaryReadMap16(message.agentMetadataJson, reader, options); + break; + case /* string webhook_path */ 17: + message.webhookPath = reader.string(); + break; + case /* string webhook_url */ 18: + message.webhookUrl = reader.string(); + break; + case /* bool webhook_active */ 19: + message.webhookActive = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap4(map: FlowInfoMsg["graph"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof FlowInfoMsg["graph"] | undefined, val: FlowInfoMsg["graph"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = NodeEdges.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for avalanche.operator.FlowInfoMsg.graph"); + } + } + map[key ?? ""] = val ?? NodeEdges.create(); + } + private binaryReadMap5(map: FlowInfoMsg["nodeTypes"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof FlowInfoMsg["nodeTypes"] | undefined, val: FlowInfoMsg["nodeTypes"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.string(); + break; + default: throw new globalThis.Error("unknown map entry field for avalanche.operator.FlowInfoMsg.node_types"); + } + } + map[key ?? ""] = val ?? ""; + } + private binaryReadMap6(map: FlowInfoMsg["displayNames"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof FlowInfoMsg["displayNames"] | undefined, val: FlowInfoMsg["displayNames"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.string(); + break; + default: throw new globalThis.Error("unknown map entry field for avalanche.operator.FlowInfoMsg.display_names"); + } + } + map[key ?? ""] = val ?? ""; + } + private binaryReadMap16(map: FlowInfoMsg["agentMetadataJson"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof FlowInfoMsg["agentMetadataJson"] | undefined, val: FlowInfoMsg["agentMetadataJson"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.string(); + break; + default: throw new globalThis.Error("unknown map entry field for avalanche.operator.FlowInfoMsg.agent_metadata_json"); + } + } + map[key ?? ""] = val ?? ""; + } + internalBinaryWrite(message: FlowInfoMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* string file_path = 2; */ + if (message.filePath !== "") + writer.tag(2, WireType.LengthDelimited).string(message.filePath); + /* repeated string node_ids = 3; */ + for (let i = 0; i < message.nodeIds.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.nodeIds[i]); + /* map graph = 4; */ + for (let k of globalThis.Object.keys(message.graph)) { + writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + NodeEdges.internalBinaryWrite(message.graph[k], writer, options); + writer.join().join(); + } + /* map node_types = 5; */ + for (let k of globalThis.Object.keys(message.nodeTypes)) + writer.tag(5, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.nodeTypes[k]).join(); + /* map display_names = 6; */ + for (let k of globalThis.Object.keys(message.displayNames)) + writer.tag(6, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.displayNames[k]).join(); + /* string cron = 7; */ + if (message.cron !== "") + writer.tag(7, WireType.LengthDelimited).string(message.cron); + /* double next_run_at = 8; */ + if (message.nextRunAt !== 0) + writer.tag(8, WireType.Bit64).double(message.nextRunAt); + /* double last_run_at = 9; */ + if (message.lastRunAt !== 0) + writer.tag(9, WireType.Bit64).double(message.lastRunAt); + /* string workflow_id = 10; */ + if (message.workflowId !== "") + writer.tag(10, WireType.LengthDelimited).string(message.workflowId); + /* string display_name = 11; */ + if (message.displayName !== "") + writer.tag(11, WireType.LengthDelimited).string(message.displayName); + /* string root_alias = 12; */ + if (message.rootAlias !== "") + writer.tag(12, WireType.LengthDelimited).string(message.rootAlias); + /* string relative_file = 13; */ + if (message.relativeFile !== "") + writer.tag(13, WireType.LengthDelimited).string(message.relativeFile); + /* string builder_symbol = 14; */ + if (message.builderSymbol !== "") + writer.tag(14, WireType.LengthDelimited).string(message.builderSymbol); + /* repeated string agent_node_ids = 15; */ + for (let i = 0; i < message.agentNodeIds.length; i++) + writer.tag(15, WireType.LengthDelimited).string(message.agentNodeIds[i]); + /* map agent_metadata_json = 16; */ + for (let k of globalThis.Object.keys(message.agentMetadataJson)) + writer.tag(16, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.agentMetadataJson[k]).join(); + /* string webhook_path = 17; */ + if (message.webhookPath !== "") + writer.tag(17, WireType.LengthDelimited).string(message.webhookPath); + /* string webhook_url = 18; */ + if (message.webhookUrl !== "") + writer.tag(18, WireType.LengthDelimited).string(message.webhookUrl); + /* bool webhook_active = 19; */ + if (message.webhookActive !== false) + writer.tag(19, WireType.Varint).bool(message.webhookActive); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.FlowInfoMsg + */ +export const FlowInfoMsg = new FlowInfoMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DiscoveryDiagnosticMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.DiscoveryDiagnosticMsg", [ + { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "kind", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): DiscoveryDiagnosticMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.path = ""; + message.kind = ""; + message.message = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiscoveryDiagnosticMsg): DiscoveryDiagnosticMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string path */ 1: + message.path = reader.string(); + break; + case /* string kind */ 2: + message.kind = reader.string(); + break; + case /* string message */ 3: + message.message = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DiscoveryDiagnosticMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string path = 1; */ + if (message.path !== "") + writer.tag(1, WireType.LengthDelimited).string(message.path); + /* string kind = 2; */ + if (message.kind !== "") + writer.tag(2, WireType.LengthDelimited).string(message.kind); + /* string message = 3; */ + if (message.message !== "") + writer.tag(3, WireType.LengthDelimited).string(message.message); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.DiscoveryDiagnosticMsg + */ +export const DiscoveryDiagnosticMsg = new DiscoveryDiagnosticMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ScanTargetMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.ScanTargetMsg", [ + { no: 1, name: "alias", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "target_path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "kind", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ScanTargetMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.alias = ""; + message.targetPath = ""; + message.kind = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ScanTargetMsg): ScanTargetMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string alias */ 1: + message.alias = reader.string(); + break; + case /* string target_path */ 2: + message.targetPath = reader.string(); + break; + case /* string kind */ 3: + message.kind = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ScanTargetMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string alias = 1; */ + if (message.alias !== "") + writer.tag(1, WireType.LengthDelimited).string(message.alias); + /* string target_path = 2; */ + if (message.targetPath !== "") + writer.tag(2, WireType.LengthDelimited).string(message.targetPath); + /* string kind = 3; */ + if (message.kind !== "") + writer.tag(3, WireType.LengthDelimited).string(message.kind); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.ScanTargetMsg + */ +export const ScanTargetMsg = new ScanTargetMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CatalogSnapshotMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.CatalogSnapshotMsg", [ + { no: 1, name: "operator_instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "as_of_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "revision", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "workflows", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => FlowInfoMsg }, + { no: 5, name: "scan_targets", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ScanTargetMsg }, + { no: 6, name: "diagnostics", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => DiscoveryDiagnosticMsg } + ]); + } + create(value?: PartialMessage): CatalogSnapshotMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.operatorInstanceId = ""; + message.asOfSequence = "0"; + message.revision = "0"; + message.workflows = []; + message.scanTargets = []; + message.diagnostics = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CatalogSnapshotMsg): CatalogSnapshotMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string operator_instance_id */ 1: + message.operatorInstanceId = reader.string(); + break; + case /* uint64 as_of_sequence */ 2: + message.asOfSequence = reader.uint64().toString(); + break; + case /* uint64 revision */ 3: + message.revision = reader.uint64().toString(); + break; + case /* repeated avalanche.operator.FlowInfoMsg workflows */ 4: + message.workflows.push(FlowInfoMsg.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated avalanche.operator.ScanTargetMsg scan_targets */ 5: + message.scanTargets.push(ScanTargetMsg.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated avalanche.operator.DiscoveryDiagnosticMsg diagnostics */ 6: + message.diagnostics.push(DiscoveryDiagnosticMsg.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CatalogSnapshotMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string operator_instance_id = 1; */ + if (message.operatorInstanceId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.operatorInstanceId); + /* uint64 as_of_sequence = 2; */ + if (message.asOfSequence !== "0") + writer.tag(2, WireType.Varint).uint64(message.asOfSequence); + /* uint64 revision = 3; */ + if (message.revision !== "0") + writer.tag(3, WireType.Varint).uint64(message.revision); + /* repeated avalanche.operator.FlowInfoMsg workflows = 4; */ + for (let i = 0; i < message.workflows.length; i++) + FlowInfoMsg.internalBinaryWrite(message.workflows[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* repeated avalanche.operator.ScanTargetMsg scan_targets = 5; */ + for (let i = 0; i < message.scanTargets.length; i++) + ScanTargetMsg.internalBinaryWrite(message.scanTargets[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* repeated avalanche.operator.DiscoveryDiagnosticMsg diagnostics = 6; */ + for (let i = 0; i < message.diagnostics.length; i++) + DiscoveryDiagnosticMsg.internalBinaryWrite(message.diagnostics[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.CatalogSnapshotMsg + */ +export const CatalogSnapshotMsg = new CatalogSnapshotMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ResultFileAttachment$Type extends MessageType { + constructor() { + super("avalanche.operator.ResultFileAttachment", [ + { no: 1, name: "attachment_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "content", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "media_type", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "sha256", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ResultFileAttachment { + const message = globalThis.Object.create((this.messagePrototype!)); + message.attachmentId = ""; + message.content = new Uint8Array(0); + message.sha256 = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResultFileAttachment): ResultFileAttachment { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string attachment_id */ 1: + message.attachmentId = reader.string(); + break; + case /* optional string name */ 2: + message.name = reader.string(); + break; + case /* bytes content */ 3: + message.content = reader.bytes(); + break; + case /* optional string media_type */ 4: + message.mediaType = reader.string(); + break; + case /* string sha256 */ 5: + message.sha256 = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ResultFileAttachment, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string attachment_id = 1; */ + if (message.attachmentId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.attachmentId); + /* optional string name = 2; */ + if (message.name !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.name); + /* bytes content = 3; */ + if (message.content.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.content); + /* optional string media_type = 4; */ + if (message.mediaType !== undefined) + writer.tag(4, WireType.LengthDelimited).string(message.mediaType); + /* string sha256 = 5; */ + if (message.sha256 !== "") + writer.tag(5, WireType.LengthDelimited).string(message.sha256); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.ResultFileAttachment + */ +export const ResultFileAttachment = new ResultFileAttachment$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RunResultMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.RunResultMsg", [ + { no: 1, name: "value_json", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "files", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ResultFileAttachment } + ]); + } + create(value?: PartialMessage): RunResultMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.valueJson = ""; + message.files = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RunResultMsg): RunResultMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string value_json */ 1: + message.valueJson = reader.string(); + break; + case /* repeated avalanche.operator.ResultFileAttachment files */ 2: + message.files.push(ResultFileAttachment.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RunResultMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string value_json = 1; */ + if (message.valueJson !== "") + writer.tag(1, WireType.LengthDelimited).string(message.valueJson); + /* repeated avalanche.operator.ResultFileAttachment files = 2; */ + for (let i = 0; i < message.files.length; i++) + ResultFileAttachment.internalBinaryWrite(message.files[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.RunResultMsg + */ +export const RunResultMsg = new RunResultMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RunSummaryMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.RunSummaryMsg", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "flow_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "status", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "started_at", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 5, name: "ended_at", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 6, name: "triggered_by", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "workflow_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "workflow_display_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: "created_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 10, name: "revision", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + ]); + } + create(value?: PartialMessage): RunSummaryMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + message.flowName = ""; + message.status = ""; + message.startedAt = 0; + message.endedAt = 0; + message.triggeredBy = ""; + message.workflowId = ""; + message.workflowDisplayName = ""; + message.createdSequence = "0"; + message.revision = "0"; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RunSummaryMsg): RunSummaryMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + case /* string flow_name */ 2: + message.flowName = reader.string(); + break; + case /* string status */ 3: + message.status = reader.string(); + break; + case /* double started_at */ 4: + message.startedAt = reader.double(); + break; + case /* double ended_at */ 5: + message.endedAt = reader.double(); + break; + case /* string triggered_by */ 6: + message.triggeredBy = reader.string(); + break; + case /* string workflow_id */ 7: + message.workflowId = reader.string(); + break; + case /* string workflow_display_name */ 8: + message.workflowDisplayName = reader.string(); + break; + case /* uint64 created_sequence */ 9: + message.createdSequence = reader.uint64().toString(); + break; + case /* uint64 revision */ 10: + message.revision = reader.uint64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RunSummaryMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + /* string flow_name = 2; */ + if (message.flowName !== "") + writer.tag(2, WireType.LengthDelimited).string(message.flowName); + /* string status = 3; */ + if (message.status !== "") + writer.tag(3, WireType.LengthDelimited).string(message.status); + /* double started_at = 4; */ + if (message.startedAt !== 0) + writer.tag(4, WireType.Bit64).double(message.startedAt); + /* double ended_at = 5; */ + if (message.endedAt !== 0) + writer.tag(5, WireType.Bit64).double(message.endedAt); + /* string triggered_by = 6; */ + if (message.triggeredBy !== "") + writer.tag(6, WireType.LengthDelimited).string(message.triggeredBy); + /* string workflow_id = 7; */ + if (message.workflowId !== "") + writer.tag(7, WireType.LengthDelimited).string(message.workflowId); + /* string workflow_display_name = 8; */ + if (message.workflowDisplayName !== "") + writer.tag(8, WireType.LengthDelimited).string(message.workflowDisplayName); + /* uint64 created_sequence = 9; */ + if (message.createdSequence !== "0") + writer.tag(9, WireType.Varint).uint64(message.createdSequence); + /* uint64 revision = 10; */ + if (message.revision !== "0") + writer.tag(10, WireType.Varint).uint64(message.revision); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.RunSummaryMsg + */ +export const RunSummaryMsg = new RunSummaryMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TraceDescriptorMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.TraceDescriptorMsg", [ + { no: 1, name: "status", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "revision", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "available", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: "complete", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "event_count", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 6, name: "size_bytes", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 7, name: "latest_event_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + ]); + } + create(value?: PartialMessage): TraceDescriptorMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.status = ""; + message.revision = "0"; + message.available = false; + message.complete = false; + message.eventCount = "0"; + message.sizeBytes = "0"; + message.latestEventSequence = "0"; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TraceDescriptorMsg): TraceDescriptorMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string status */ 1: + message.status = reader.string(); + break; + case /* uint64 revision */ 2: + message.revision = reader.uint64().toString(); + break; + case /* bool available */ 3: + message.available = reader.bool(); + break; + case /* bool complete */ 4: + message.complete = reader.bool(); + break; + case /* uint64 event_count */ 5: + message.eventCount = reader.uint64().toString(); + break; + case /* uint64 size_bytes */ 6: + message.sizeBytes = reader.uint64().toString(); + break; + case /* uint64 latest_event_sequence */ 7: + message.latestEventSequence = reader.uint64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TraceDescriptorMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string status = 1; */ + if (message.status !== "") + writer.tag(1, WireType.LengthDelimited).string(message.status); + /* uint64 revision = 2; */ + if (message.revision !== "0") + writer.tag(2, WireType.Varint).uint64(message.revision); + /* bool available = 3; */ + if (message.available !== false) + writer.tag(3, WireType.Varint).bool(message.available); + /* bool complete = 4; */ + if (message.complete !== false) + writer.tag(4, WireType.Varint).bool(message.complete); + /* uint64 event_count = 5; */ + if (message.eventCount !== "0") + writer.tag(5, WireType.Varint).uint64(message.eventCount); + /* uint64 size_bytes = 6; */ + if (message.sizeBytes !== "0") + writer.tag(6, WireType.Varint).uint64(message.sizeBytes); + /* uint64 latest_event_sequence = 7; */ + if (message.latestEventSequence !== "0") + writer.tag(7, WireType.Varint).uint64(message.latestEventSequence); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.TraceDescriptorMsg + */ +export const TraceDescriptorMsg = new TraceDescriptorMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NodeSnapshotMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.NodeSnapshotMsg", [ + { no: 1, name: "node_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "node_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "status", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "started_at", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 6, name: "ended_at", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 7, name: "trace", kind: "message", T: () => TraceDescriptorMsg }, + { no: 8, name: "revision", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 9, name: "event_page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: "error", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): NodeSnapshotMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.nodeId = ""; + message.name = ""; + message.nodeType = ""; + message.status = ""; + message.startedAt = 0; + message.endedAt = 0; + message.revision = "0"; + message.eventPageToken = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeSnapshotMsg): NodeSnapshotMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string node_id */ 1: + message.nodeId = reader.string(); + break; + case /* string name */ 2: + message.name = reader.string(); + break; + case /* string node_type */ 3: + message.nodeType = reader.string(); + break; + case /* string status */ 4: + message.status = reader.string(); + break; + case /* double started_at */ 5: + message.startedAt = reader.double(); + break; + case /* double ended_at */ 6: + message.endedAt = reader.double(); + break; + case /* avalanche.operator.TraceDescriptorMsg trace */ 7: + message.trace = TraceDescriptorMsg.internalBinaryRead(reader, reader.uint32(), options, message.trace); + break; + case /* uint64 revision */ 8: + message.revision = reader.uint64().toString(); + break; + case /* string event_page_token */ 9: + message.eventPageToken = reader.string(); + break; + case /* optional string error */ 10: + message.error = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: NodeSnapshotMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string node_id = 1; */ + if (message.nodeId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.nodeId); + /* string name = 2; */ + if (message.name !== "") + writer.tag(2, WireType.LengthDelimited).string(message.name); + /* string node_type = 3; */ + if (message.nodeType !== "") + writer.tag(3, WireType.LengthDelimited).string(message.nodeType); + /* string status = 4; */ + if (message.status !== "") + writer.tag(4, WireType.LengthDelimited).string(message.status); + /* double started_at = 5; */ + if (message.startedAt !== 0) + writer.tag(5, WireType.Bit64).double(message.startedAt); + /* double ended_at = 6; */ + if (message.endedAt !== 0) + writer.tag(6, WireType.Bit64).double(message.endedAt); + /* avalanche.operator.TraceDescriptorMsg trace = 7; */ + if (message.trace) + TraceDescriptorMsg.internalBinaryWrite(message.trace, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* uint64 revision = 8; */ + if (message.revision !== "0") + writer.tag(8, WireType.Varint).uint64(message.revision); + /* string event_page_token = 9; */ + if (message.eventPageToken !== "") + writer.tag(9, WireType.LengthDelimited).string(message.eventPageToken); + /* optional string error = 10; */ + if (message.error !== undefined) + writer.tag(10, WireType.LengthDelimited).string(message.error); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.NodeSnapshotMsg + */ +export const NodeSnapshotMsg = new NodeSnapshotMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RunSnapshotMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.RunSnapshotMsg", [ + { no: 1, name: "operator_instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "as_of_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "summary", kind: "message", T: () => RunSummaryMsg }, + { no: 4, name: "nodes", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => NodeSnapshotMsg }, + { no: 5, name: "latest_log_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 6, name: "log_page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "topology", kind: "message", T: () => WorkflowTopologyMsg } + ]); + } + create(value?: PartialMessage): RunSnapshotMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.operatorInstanceId = ""; + message.asOfSequence = "0"; + message.nodes = []; + message.latestLogSequence = "0"; + message.logPageToken = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RunSnapshotMsg): RunSnapshotMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string operator_instance_id */ 1: + message.operatorInstanceId = reader.string(); + break; + case /* uint64 as_of_sequence */ 2: + message.asOfSequence = reader.uint64().toString(); + break; + case /* avalanche.operator.RunSummaryMsg summary */ 3: + message.summary = RunSummaryMsg.internalBinaryRead(reader, reader.uint32(), options, message.summary); + break; + case /* repeated avalanche.operator.NodeSnapshotMsg nodes */ 4: + message.nodes.push(NodeSnapshotMsg.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* uint64 latest_log_sequence */ 5: + message.latestLogSequence = reader.uint64().toString(); + break; + case /* string log_page_token */ 6: + message.logPageToken = reader.string(); + break; + case /* avalanche.operator.WorkflowTopologyMsg topology */ 7: + message.topology = WorkflowTopologyMsg.internalBinaryRead(reader, reader.uint32(), options, message.topology); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RunSnapshotMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string operator_instance_id = 1; */ + if (message.operatorInstanceId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.operatorInstanceId); + /* uint64 as_of_sequence = 2; */ + if (message.asOfSequence !== "0") + writer.tag(2, WireType.Varint).uint64(message.asOfSequence); + /* avalanche.operator.RunSummaryMsg summary = 3; */ + if (message.summary) + RunSummaryMsg.internalBinaryWrite(message.summary, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* repeated avalanche.operator.NodeSnapshotMsg nodes = 4; */ + for (let i = 0; i < message.nodes.length; i++) + NodeSnapshotMsg.internalBinaryWrite(message.nodes[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* uint64 latest_log_sequence = 5; */ + if (message.latestLogSequence !== "0") + writer.tag(5, WireType.Varint).uint64(message.latestLogSequence); + /* string log_page_token = 6; */ + if (message.logPageToken !== "") + writer.tag(6, WireType.LengthDelimited).string(message.logPageToken); + /* avalanche.operator.WorkflowTopologyMsg topology = 7; */ + if (message.topology) + WorkflowTopologyMsg.internalBinaryWrite(message.topology, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.RunSnapshotMsg + */ +export const RunSnapshotMsg = new RunSnapshotMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RunSummaryPage$Type extends MessageType { + constructor() { + super("avalanche.operator.RunSummaryPage", [ + { no: 1, name: "operator_instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "as_of_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "runs", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RunSummaryMsg }, + { no: 4, name: "next_page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): RunSummaryPage { + const message = globalThis.Object.create((this.messagePrototype!)); + message.operatorInstanceId = ""; + message.asOfSequence = "0"; + message.runs = []; + message.nextPageToken = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RunSummaryPage): RunSummaryPage { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string operator_instance_id */ 1: + message.operatorInstanceId = reader.string(); + break; + case /* uint64 as_of_sequence */ 2: + message.asOfSequence = reader.uint64().toString(); + break; + case /* repeated avalanche.operator.RunSummaryMsg runs */ 3: + message.runs.push(RunSummaryMsg.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string next_page_token */ 4: + message.nextPageToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RunSummaryPage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string operator_instance_id = 1; */ + if (message.operatorInstanceId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.operatorInstanceId); + /* uint64 as_of_sequence = 2; */ + if (message.asOfSequence !== "0") + writer.tag(2, WireType.Varint).uint64(message.asOfSequence); + /* repeated avalanche.operator.RunSummaryMsg runs = 3; */ + for (let i = 0; i < message.runs.length; i++) + RunSummaryMsg.internalBinaryWrite(message.runs[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* string next_page_token = 4; */ + if (message.nextPageToken !== "") + writer.tag(4, WireType.LengthDelimited).string(message.nextPageToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.RunSummaryPage + */ +export const RunSummaryPage = new RunSummaryPage$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LogRecordDescriptorMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.LogRecordDescriptorMsg", [ + { no: 1, name: "sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "timestamp", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 3, name: "level", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "node_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "size_bytes", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 6, name: "body_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): LogRecordDescriptorMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.sequence = "0"; + message.timestamp = 0; + message.level = ""; + message.nodeId = ""; + message.sizeBytes = "0"; + message.bodyToken = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LogRecordDescriptorMsg): LogRecordDescriptorMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 sequence */ 1: + message.sequence = reader.uint64().toString(); + break; + case /* double timestamp */ 2: + message.timestamp = reader.double(); + break; + case /* string level */ 3: + message.level = reader.string(); + break; + case /* string node_id */ 4: + message.nodeId = reader.string(); + break; + case /* uint64 size_bytes */ 5: + message.sizeBytes = reader.uint64().toString(); + break; + case /* string body_token */ 6: + message.bodyToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: LogRecordDescriptorMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 sequence = 1; */ + if (message.sequence !== "0") + writer.tag(1, WireType.Varint).uint64(message.sequence); + /* double timestamp = 2; */ + if (message.timestamp !== 0) + writer.tag(2, WireType.Bit64).double(message.timestamp); + /* string level = 3; */ + if (message.level !== "") + writer.tag(3, WireType.LengthDelimited).string(message.level); + /* string node_id = 4; */ + if (message.nodeId !== "") + writer.tag(4, WireType.LengthDelimited).string(message.nodeId); + /* uint64 size_bytes = 5; */ + if (message.sizeBytes !== "0") + writer.tag(5, WireType.Varint).uint64(message.sizeBytes); + /* string body_token = 6; */ + if (message.bodyToken !== "") + writer.tag(6, WireType.LengthDelimited).string(message.bodyToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.LogRecordDescriptorMsg + */ +export const LogRecordDescriptorMsg = new LogRecordDescriptorMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LogPage$Type extends MessageType { + constructor() { + super("avalanche.operator.LogPage", [ + { no: 1, name: "operator_instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "as_of_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "logs", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => LogRecordDescriptorMsg }, + { no: 4, name: "next_page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): LogPage { + const message = globalThis.Object.create((this.messagePrototype!)); + message.operatorInstanceId = ""; + message.asOfSequence = "0"; + message.logs = []; + message.nextPageToken = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LogPage): LogPage { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string operator_instance_id */ 1: + message.operatorInstanceId = reader.string(); + break; + case /* uint64 as_of_sequence */ 2: + message.asOfSequence = reader.uint64().toString(); + break; + case /* repeated avalanche.operator.LogRecordDescriptorMsg logs */ 3: + message.logs.push(LogRecordDescriptorMsg.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string next_page_token */ 4: + message.nextPageToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: LogPage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string operator_instance_id = 1; */ + if (message.operatorInstanceId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.operatorInstanceId); + /* uint64 as_of_sequence = 2; */ + if (message.asOfSequence !== "0") + writer.tag(2, WireType.Varint).uint64(message.asOfSequence); + /* repeated avalanche.operator.LogRecordDescriptorMsg logs = 3; */ + for (let i = 0; i < message.logs.length; i++) + LogRecordDescriptorMsg.internalBinaryWrite(message.logs[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* string next_page_token = 4; */ + if (message.nextPageToken !== "") + writer.tag(4, WireType.LengthDelimited).string(message.nextPageToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.LogPage + */ +export const LogPage = new LogPage$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AgentEventDescriptorMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.AgentEventDescriptorMsg", [ + { no: 1, name: "event_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "size_bytes", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "body_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "invocation_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "event_kind", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "iteration", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }, + { no: 7, name: "duration_ms", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 8, name: "error", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: "tool_count", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 10, name: "predict_count", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): AgentEventDescriptorMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.eventSequence = "0"; + message.sizeBytes = "0"; + message.bodyToken = ""; + message.invocationId = ""; + message.eventKind = ""; + message.error = false; + message.toolCount = 0; + message.predictCount = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AgentEventDescriptorMsg): AgentEventDescriptorMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 event_sequence */ 1: + message.eventSequence = reader.uint64().toString(); + break; + case /* uint64 size_bytes */ 2: + message.sizeBytes = reader.uint64().toString(); + break; + case /* string body_token */ 3: + message.bodyToken = reader.string(); + break; + case /* string invocation_id */ 4: + message.invocationId = reader.string(); + break; + case /* string event_kind */ 5: + message.eventKind = reader.string(); + break; + case /* optional uint32 iteration */ 6: + message.iteration = reader.uint32(); + break; + case /* optional uint64 duration_ms */ 7: + message.durationMs = reader.uint64().toString(); + break; + case /* bool error */ 8: + message.error = reader.bool(); + break; + case /* uint32 tool_count */ 9: + message.toolCount = reader.uint32(); + break; + case /* uint32 predict_count */ 10: + message.predictCount = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AgentEventDescriptorMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 event_sequence = 1; */ + if (message.eventSequence !== "0") + writer.tag(1, WireType.Varint).uint64(message.eventSequence); + /* uint64 size_bytes = 2; */ + if (message.sizeBytes !== "0") + writer.tag(2, WireType.Varint).uint64(message.sizeBytes); + /* string body_token = 3; */ + if (message.bodyToken !== "") + writer.tag(3, WireType.LengthDelimited).string(message.bodyToken); + /* string invocation_id = 4; */ + if (message.invocationId !== "") + writer.tag(4, WireType.LengthDelimited).string(message.invocationId); + /* string event_kind = 5; */ + if (message.eventKind !== "") + writer.tag(5, WireType.LengthDelimited).string(message.eventKind); + /* optional uint32 iteration = 6; */ + if (message.iteration !== undefined) + writer.tag(6, WireType.Varint).uint32(message.iteration); + /* optional uint64 duration_ms = 7; */ + if (message.durationMs !== undefined) + writer.tag(7, WireType.Varint).uint64(message.durationMs); + /* bool error = 8; */ + if (message.error !== false) + writer.tag(8, WireType.Varint).bool(message.error); + /* uint32 tool_count = 9; */ + if (message.toolCount !== 0) + writer.tag(9, WireType.Varint).uint32(message.toolCount); + /* uint32 predict_count = 10; */ + if (message.predictCount !== 0) + writer.tag(10, WireType.Varint).uint32(message.predictCount); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.AgentEventDescriptorMsg + */ +export const AgentEventDescriptorMsg = new AgentEventDescriptorMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AgentEventPage$Type extends MessageType { + constructor() { + super("avalanche.operator.AgentEventPage", [ + { no: 1, name: "operator_instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "as_of_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "node_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "events", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => AgentEventDescriptorMsg }, + { no: 6, name: "next_page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): AgentEventPage { + const message = globalThis.Object.create((this.messagePrototype!)); + message.operatorInstanceId = ""; + message.asOfSequence = "0"; + message.runId = ""; + message.nodeId = ""; + message.events = []; + message.nextPageToken = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AgentEventPage): AgentEventPage { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string operator_instance_id */ 1: + message.operatorInstanceId = reader.string(); + break; + case /* uint64 as_of_sequence */ 2: + message.asOfSequence = reader.uint64().toString(); + break; + case /* string run_id */ 3: + message.runId = reader.string(); + break; + case /* string node_id */ 4: + message.nodeId = reader.string(); + break; + case /* repeated avalanche.operator.AgentEventDescriptorMsg events */ 5: + message.events.push(AgentEventDescriptorMsg.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string next_page_token */ 6: + message.nextPageToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AgentEventPage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string operator_instance_id = 1; */ + if (message.operatorInstanceId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.operatorInstanceId); + /* uint64 as_of_sequence = 2; */ + if (message.asOfSequence !== "0") + writer.tag(2, WireType.Varint).uint64(message.asOfSequence); + /* string run_id = 3; */ + if (message.runId !== "") + writer.tag(3, WireType.LengthDelimited).string(message.runId); + /* string node_id = 4; */ + if (message.nodeId !== "") + writer.tag(4, WireType.LengthDelimited).string(message.nodeId); + /* repeated avalanche.operator.AgentEventDescriptorMsg events = 5; */ + for (let i = 0; i < message.events.length; i++) + AgentEventDescriptorMsg.internalBinaryWrite(message.events[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* string next_page_token = 6; */ + if (message.nextPageToken !== "") + writer.tag(6, WireType.LengthDelimited).string(message.nextPageToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.AgentEventPage + */ +export const AgentEventPage = new AgentEventPage$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TraceChunk$Type extends MessageType { + constructor() { + super("avalanche.operator.TraceChunk", [ + { no: 1, name: "revision", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "chunk_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "eof", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): TraceChunk { + const message = globalThis.Object.create((this.messagePrototype!)); + message.revision = "0"; + message.chunkIndex = "0"; + message.data = new Uint8Array(0); + message.eof = false; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TraceChunk): TraceChunk { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 revision */ 1: + message.revision = reader.uint64().toString(); + break; + case /* uint64 chunk_index */ 2: + message.chunkIndex = reader.uint64().toString(); + break; + case /* bytes data */ 3: + message.data = reader.bytes(); + break; + case /* bool eof */ 4: + message.eof = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TraceChunk, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 revision = 1; */ + if (message.revision !== "0") + writer.tag(1, WireType.Varint).uint64(message.revision); + /* uint64 chunk_index = 2; */ + if (message.chunkIndex !== "0") + writer.tag(2, WireType.Varint).uint64(message.chunkIndex); + /* bytes data = 3; */ + if (message.data.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.data); + /* bool eof = 4; */ + if (message.eof !== false) + writer.tag(4, WireType.Varint).bool(message.eof); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.TraceChunk + */ +export const TraceChunk = new TraceChunk$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DetailChunk$Type extends MessageType { + constructor() { + super("avalanche.operator.DetailChunk", [ + { no: 1, name: "chunk_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "eof", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): DetailChunk { + const message = globalThis.Object.create((this.messagePrototype!)); + message.chunkIndex = "0"; + message.data = new Uint8Array(0); + message.eof = false; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DetailChunk): DetailChunk { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 chunk_index */ 1: + message.chunkIndex = reader.uint64().toString(); + break; + case /* bytes data */ 2: + message.data = reader.bytes(); + break; + case /* bool eof */ 3: + message.eof = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DetailChunk, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 chunk_index = 1; */ + if (message.chunkIndex !== "0") + writer.tag(1, WireType.Varint).uint64(message.chunkIndex); + /* bytes data = 2; */ + if (message.data.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.data); + /* bool eof = 3; */ + if (message.eof !== false) + writer.tag(3, WireType.Varint).bool(message.eof); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.DetailChunk + */ +export const DetailChunk = new DetailChunk$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RunCreated$Type extends MessageType { + constructor() { + super("avalanche.operator.RunCreated", [ + { no: 1, name: "summary", kind: "message", T: () => RunSummaryMsg }, + { no: 2, name: "nodes", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => NodeSnapshotMsg }, + { no: 3, name: "topology", kind: "message", T: () => WorkflowTopologyMsg } + ]); + } + create(value?: PartialMessage): RunCreated { + const message = globalThis.Object.create((this.messagePrototype!)); + message.nodes = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RunCreated): RunCreated { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* avalanche.operator.RunSummaryMsg summary */ 1: + message.summary = RunSummaryMsg.internalBinaryRead(reader, reader.uint32(), options, message.summary); + break; + case /* repeated avalanche.operator.NodeSnapshotMsg nodes */ 2: + message.nodes.push(NodeSnapshotMsg.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* avalanche.operator.WorkflowTopologyMsg topology */ 3: + message.topology = WorkflowTopologyMsg.internalBinaryRead(reader, reader.uint32(), options, message.topology); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RunCreated, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* avalanche.operator.RunSummaryMsg summary = 1; */ + if (message.summary) + RunSummaryMsg.internalBinaryWrite(message.summary, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* repeated avalanche.operator.NodeSnapshotMsg nodes = 2; */ + for (let i = 0; i < message.nodes.length; i++) + NodeSnapshotMsg.internalBinaryWrite(message.nodes[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* avalanche.operator.WorkflowTopologyMsg topology = 3; */ + if (message.topology) + WorkflowTopologyMsg.internalBinaryWrite(message.topology, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.RunCreated + */ +export const RunCreated = new RunCreated$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RunStatusChanged$Type extends MessageType { + constructor() { + super("avalanche.operator.RunStatusChanged", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "status", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "started_at", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 4, name: "ended_at", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 5, name: "revision", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + ]); + } + create(value?: PartialMessage): RunStatusChanged { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + message.status = ""; + message.startedAt = 0; + message.endedAt = 0; + message.revision = "0"; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RunStatusChanged): RunStatusChanged { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + case /* string status */ 2: + message.status = reader.string(); + break; + case /* double started_at */ 3: + message.startedAt = reader.double(); + break; + case /* double ended_at */ 4: + message.endedAt = reader.double(); + break; + case /* uint64 revision */ 5: + message.revision = reader.uint64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RunStatusChanged, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + /* string status = 2; */ + if (message.status !== "") + writer.tag(2, WireType.LengthDelimited).string(message.status); + /* double started_at = 3; */ + if (message.startedAt !== 0) + writer.tag(3, WireType.Bit64).double(message.startedAt); + /* double ended_at = 4; */ + if (message.endedAt !== 0) + writer.tag(4, WireType.Bit64).double(message.endedAt); + /* uint64 revision = 5; */ + if (message.revision !== "0") + writer.tag(5, WireType.Varint).uint64(message.revision); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.RunStatusChanged + */ +export const RunStatusChanged = new RunStatusChanged$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NodeStatusChanged$Type extends MessageType { + constructor() { + super("avalanche.operator.NodeStatusChanged", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "node_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "status", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "started_at", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 5, name: "ended_at", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 6, name: "revision", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 7, name: "error", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): NodeStatusChanged { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + message.nodeId = ""; + message.status = ""; + message.startedAt = 0; + message.endedAt = 0; + message.revision = "0"; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeStatusChanged): NodeStatusChanged { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + case /* string node_id */ 2: + message.nodeId = reader.string(); + break; + case /* string status */ 3: + message.status = reader.string(); + break; + case /* double started_at */ 4: + message.startedAt = reader.double(); + break; + case /* double ended_at */ 5: + message.endedAt = reader.double(); + break; + case /* uint64 revision */ 6: + message.revision = reader.uint64().toString(); + break; + case /* optional string error */ 7: + message.error = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: NodeStatusChanged, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + /* string node_id = 2; */ + if (message.nodeId !== "") + writer.tag(2, WireType.LengthDelimited).string(message.nodeId); + /* string status = 3; */ + if (message.status !== "") + writer.tag(3, WireType.LengthDelimited).string(message.status); + /* double started_at = 4; */ + if (message.startedAt !== 0) + writer.tag(4, WireType.Bit64).double(message.startedAt); + /* double ended_at = 5; */ + if (message.endedAt !== 0) + writer.tag(5, WireType.Bit64).double(message.endedAt); + /* uint64 revision = 6; */ + if (message.revision !== "0") + writer.tag(6, WireType.Varint).uint64(message.revision); + /* optional string error = 7; */ + if (message.error !== undefined) + writer.tag(7, WireType.LengthDelimited).string(message.error); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.NodeStatusChanged + */ +export const NodeStatusChanged = new NodeStatusChanged$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LogAppended$Type extends MessageType { + constructor() { + super("avalanche.operator.LogAppended", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "log", kind: "message", T: () => LogRecordDescriptorMsg } + ]); + } + create(value?: PartialMessage): LogAppended { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LogAppended): LogAppended { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + case /* avalanche.operator.LogRecordDescriptorMsg log */ 2: + message.log = LogRecordDescriptorMsg.internalBinaryRead(reader, reader.uint32(), options, message.log); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: LogAppended, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + /* avalanche.operator.LogRecordDescriptorMsg log = 2; */ + if (message.log) + LogRecordDescriptorMsg.internalBinaryWrite(message.log, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.LogAppended + */ +export const LogAppended = new LogAppended$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AgentEventAppended$Type extends MessageType { + constructor() { + super("avalanche.operator.AgentEventAppended", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "node_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "event", kind: "message", T: () => AgentEventDescriptorMsg } + ]); + } + create(value?: PartialMessage): AgentEventAppended { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + message.nodeId = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AgentEventAppended): AgentEventAppended { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + case /* string node_id */ 2: + message.nodeId = reader.string(); + break; + case /* avalanche.operator.AgentEventDescriptorMsg event */ 3: + message.event = AgentEventDescriptorMsg.internalBinaryRead(reader, reader.uint32(), options, message.event); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AgentEventAppended, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + /* string node_id = 2; */ + if (message.nodeId !== "") + writer.tag(2, WireType.LengthDelimited).string(message.nodeId); + /* avalanche.operator.AgentEventDescriptorMsg event = 3; */ + if (message.event) + AgentEventDescriptorMsg.internalBinaryWrite(message.event, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.AgentEventAppended + */ +export const AgentEventAppended = new AgentEventAppended$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TraceFinalized$Type extends MessageType { + constructor() { + super("avalanche.operator.TraceFinalized", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "node_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "trace", kind: "message", T: () => TraceDescriptorMsg } + ]); + } + create(value?: PartialMessage): TraceFinalized { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + message.nodeId = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TraceFinalized): TraceFinalized { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + case /* string node_id */ 2: + message.nodeId = reader.string(); + break; + case /* avalanche.operator.TraceDescriptorMsg trace */ 3: + message.trace = TraceDescriptorMsg.internalBinaryRead(reader, reader.uint32(), options, message.trace); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TraceFinalized, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + /* string node_id = 2; */ + if (message.nodeId !== "") + writer.tag(2, WireType.LengthDelimited).string(message.nodeId); + /* avalanche.operator.TraceDescriptorMsg trace = 3; */ + if (message.trace) + TraceDescriptorMsg.internalBinaryWrite(message.trace, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.TraceFinalized + */ +export const TraceFinalized = new TraceFinalized$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CatalogReplaced$Type extends MessageType { + constructor() { + super("avalanche.operator.CatalogReplaced", [ + { no: 1, name: "catalog", kind: "message", T: () => CatalogSnapshotMsg } + ]); + } + create(value?: PartialMessage): CatalogReplaced { + const message = globalThis.Object.create((this.messagePrototype!)); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CatalogReplaced): CatalogReplaced { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* avalanche.operator.CatalogSnapshotMsg catalog */ 1: + message.catalog = CatalogSnapshotMsg.internalBinaryRead(reader, reader.uint32(), options, message.catalog); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CatalogReplaced, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* avalanche.operator.CatalogSnapshotMsg catalog = 1; */ + if (message.catalog) + CatalogSnapshotMsg.internalBinaryWrite(message.catalog, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.CatalogReplaced + */ +export const CatalogReplaced = new CatalogReplaced$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OperatorUpdate$Type extends MessageType { + constructor() { + super("avalanche.operator.OperatorUpdate", [ + { no: 1, name: "sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "run_created", kind: "message", oneof: "change", T: () => RunCreated }, + { no: 3, name: "run_status_changed", kind: "message", oneof: "change", T: () => RunStatusChanged }, + { no: 4, name: "node_status_changed", kind: "message", oneof: "change", T: () => NodeStatusChanged }, + { no: 5, name: "log_appended", kind: "message", oneof: "change", T: () => LogAppended }, + { no: 6, name: "agent_event_appended", kind: "message", oneof: "change", T: () => AgentEventAppended }, + { no: 7, name: "trace_finalized", kind: "message", oneof: "change", T: () => TraceFinalized }, + { no: 8, name: "catalog_replaced", kind: "message", oneof: "change", T: () => CatalogReplaced } + ]); + } + create(value?: PartialMessage): OperatorUpdate { + const message = globalThis.Object.create((this.messagePrototype!)); + message.sequence = "0"; + message.change = { oneofKind: undefined }; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OperatorUpdate): OperatorUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 sequence */ 1: + message.sequence = reader.uint64().toString(); + break; + case /* avalanche.operator.RunCreated run_created */ 2: + message.change = { + oneofKind: "runCreated", + runCreated: RunCreated.internalBinaryRead(reader, reader.uint32(), options, (message.change as any).runCreated) + }; + break; + case /* avalanche.operator.RunStatusChanged run_status_changed */ 3: + message.change = { + oneofKind: "runStatusChanged", + runStatusChanged: RunStatusChanged.internalBinaryRead(reader, reader.uint32(), options, (message.change as any).runStatusChanged) + }; + break; + case /* avalanche.operator.NodeStatusChanged node_status_changed */ 4: + message.change = { + oneofKind: "nodeStatusChanged", + nodeStatusChanged: NodeStatusChanged.internalBinaryRead(reader, reader.uint32(), options, (message.change as any).nodeStatusChanged) + }; + break; + case /* avalanche.operator.LogAppended log_appended */ 5: + message.change = { + oneofKind: "logAppended", + logAppended: LogAppended.internalBinaryRead(reader, reader.uint32(), options, (message.change as any).logAppended) + }; + break; + case /* avalanche.operator.AgentEventAppended agent_event_appended */ 6: + message.change = { + oneofKind: "agentEventAppended", + agentEventAppended: AgentEventAppended.internalBinaryRead(reader, reader.uint32(), options, (message.change as any).agentEventAppended) + }; + break; + case /* avalanche.operator.TraceFinalized trace_finalized */ 7: + message.change = { + oneofKind: "traceFinalized", + traceFinalized: TraceFinalized.internalBinaryRead(reader, reader.uint32(), options, (message.change as any).traceFinalized) + }; + break; + case /* avalanche.operator.CatalogReplaced catalog_replaced */ 8: + message.change = { + oneofKind: "catalogReplaced", + catalogReplaced: CatalogReplaced.internalBinaryRead(reader, reader.uint32(), options, (message.change as any).catalogReplaced) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: OperatorUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 sequence = 1; */ + if (message.sequence !== "0") + writer.tag(1, WireType.Varint).uint64(message.sequence); + /* avalanche.operator.RunCreated run_created = 2; */ + if (message.change.oneofKind === "runCreated") + RunCreated.internalBinaryWrite(message.change.runCreated, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* avalanche.operator.RunStatusChanged run_status_changed = 3; */ + if (message.change.oneofKind === "runStatusChanged") + RunStatusChanged.internalBinaryWrite(message.change.runStatusChanged, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* avalanche.operator.NodeStatusChanged node_status_changed = 4; */ + if (message.change.oneofKind === "nodeStatusChanged") + NodeStatusChanged.internalBinaryWrite(message.change.nodeStatusChanged, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* avalanche.operator.LogAppended log_appended = 5; */ + if (message.change.oneofKind === "logAppended") + LogAppended.internalBinaryWrite(message.change.logAppended, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* avalanche.operator.AgentEventAppended agent_event_appended = 6; */ + if (message.change.oneofKind === "agentEventAppended") + AgentEventAppended.internalBinaryWrite(message.change.agentEventAppended, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* avalanche.operator.TraceFinalized trace_finalized = 7; */ + if (message.change.oneofKind === "traceFinalized") + TraceFinalized.internalBinaryWrite(message.change.traceFinalized, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* avalanche.operator.CatalogReplaced catalog_replaced = 8; */ + if (message.change.oneofKind === "catalogReplaced") + CatalogReplaced.internalBinaryWrite(message.change.catalogReplaced, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.OperatorUpdate + */ +export const OperatorUpdate = new OperatorUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ResetRequired$Type extends MessageType { + constructor() { + super("avalanche.operator.ResetRequired", [ + { no: 1, name: "history_floor", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "latest_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + ]); + } + create(value?: PartialMessage): ResetRequired { + const message = globalThis.Object.create((this.messagePrototype!)); + message.historyFloor = "0"; + message.latestSequence = "0"; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResetRequired): ResetRequired { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 history_floor */ 1: + message.historyFloor = reader.uint64().toString(); + break; + case /* uint64 latest_sequence */ 2: + message.latestSequence = reader.uint64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ResetRequired, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 history_floor = 1; */ + if (message.historyFloor !== "0") + writer.tag(1, WireType.Varint).uint64(message.historyFloor); + /* uint64 latest_sequence = 2; */ + if (message.latestSequence !== "0") + writer.tag(2, WireType.Varint).uint64(message.latestSequence); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.ResetRequired + */ +export const ResetRequired = new ResetRequired$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OperatorUpdateEnvelope$Type extends MessageType { + constructor() { + super("avalanche.operator.OperatorUpdateEnvelope", [ + { no: 1, name: "operator_instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "update", kind: "message", oneof: "payload", T: () => OperatorUpdate }, + { no: 3, name: "reset_required", kind: "message", oneof: "payload", T: () => ResetRequired } + ]); + } + create(value?: PartialMessage): OperatorUpdateEnvelope { + const message = globalThis.Object.create((this.messagePrototype!)); + message.operatorInstanceId = ""; + message.payload = { oneofKind: undefined }; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OperatorUpdateEnvelope): OperatorUpdateEnvelope { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string operator_instance_id */ 1: + message.operatorInstanceId = reader.string(); + break; + case /* avalanche.operator.OperatorUpdate update */ 2: + message.payload = { + oneofKind: "update", + update: OperatorUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.payload as any).update) + }; + break; + case /* avalanche.operator.ResetRequired reset_required */ 3: + message.payload = { + oneofKind: "resetRequired", + resetRequired: ResetRequired.internalBinaryRead(reader, reader.uint32(), options, (message.payload as any).resetRequired) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: OperatorUpdateEnvelope, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string operator_instance_id = 1; */ + if (message.operatorInstanceId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.operatorInstanceId); + /* avalanche.operator.OperatorUpdate update = 2; */ + if (message.payload.oneofKind === "update") + OperatorUpdate.internalBinaryWrite(message.payload.update, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* avalanche.operator.ResetRequired reset_required = 3; */ + if (message.payload.oneofKind === "resetRequired") + ResetRequired.internalBinaryWrite(message.payload.resetRequired, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.OperatorUpdateEnvelope + */ +export const OperatorUpdateEnvelope = new OperatorUpdateEnvelope$Type(); +/** + * @generated ServiceType for protobuf service avalanche.operator.OperatorService + */ +export const OperatorService = new ServiceType("avalanche.operator.OperatorService", [ + { name: "GetCatalog", options: {}, I: Empty, O: CatalogSnapshotMsg }, + { name: "StartRun", options: {}, I: StartRunRequest, O: StartRunResponse }, + { name: "CancelRun", options: {}, I: CancelRunRequest, O: Empty }, + { name: "GetRunResult", options: {}, I: GetRunRequest, O: RunResultMsg }, + { name: "ListRunSummaries", options: {}, I: ListRunSummariesRequest, O: RunSummaryPage }, + { name: "GetRunSnapshot", options: {}, I: GetRunSnapshotRequest, O: RunSnapshotMsg }, + { name: "ListLogs", options: {}, I: ListLogsRequest, O: LogPage }, + { name: "ListAgentEvents", options: {}, I: ListAgentEventsRequest, O: AgentEventPage }, + { name: "ReadTrace", serverStreaming: true, options: {}, I: ReadTraceRequest, O: TraceChunk }, + { name: "ReadDetail", serverStreaming: true, options: {}, I: ReadDetailRequest, O: DetailChunk }, + { name: "StreamOperatorUpdates", serverStreaming: true, options: {}, I: StreamOperatorUpdatesRequest, O: OperatorUpdateEnvelope } +]); diff --git a/web/operator/src/guards.ts b/web/operator/src/guards.ts new file mode 100644 index 0000000..3b1609e --- /dev/null +++ b/web/operator/src/guards.ts @@ -0,0 +1,3 @@ +export function isUnknownRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} diff --git a/web/operator/src/main.tsx b/web/operator/src/main.tsx new file mode 100644 index 0000000..10df294 --- /dev/null +++ b/web/operator/src/main.tsx @@ -0,0 +1,16 @@ +import "@xyflow/react/dist/style.css"; +import { StrictMode } from "react"; +import { createRoot } from "react-dom/client"; + +import { GrpcWebOperatorApi } from "./api"; +import { App } from "./App"; +import "./styles.css"; + +const root = document.getElementById("root"); +if (!root) throw new Error("Operator UI root element is missing"); + +createRoot(root).render( + + + , +); diff --git a/web/operator/src/state.test.ts b/web/operator/src/state.test.ts new file mode 100644 index 0000000..afc1cb5 --- /dev/null +++ b/web/operator/src/state.test.ts @@ -0,0 +1,170 @@ +import { describe, expect, it } from "vitest"; + +import type { StructuralBaseline } from "./api"; +import { + CatalogSnapshotMsg, + FlowInfoMsg, + NodeSnapshotMsg, + OperatorUpdateEnvelope, + RunSnapshotMsg, + RunSummaryMsg, + WorkflowTopologyMsg, +} from "./generated/operator"; +import { emptyProjection, projectionReducer } from "./state"; + +const workflow = FlowInfoMsg.create({ + name: "orders", + displayName: "Orders", + workflowId: "flows.py::orders", + rootAlias: "examples", + relativeFile: "flows.py", + nodeIds: ["fetch"], + graph: { fetch: { children: [] } }, + nodeTypes: { fetch: "step" }, + displayNames: { fetch: "Fetch" }, +}); +const summary = RunSummaryMsg.create({ + runId: "run-1", + flowName: "orders", + workflowId: workflow.workflowId, + workflowDisplayName: workflow.displayName, + status: "running", + createdSequence: "1", + revision: "1", +}); +const node = NodeSnapshotMsg.create({ + nodeId: "fetch", + name: "Fetch", + nodeType: "step", + status: "running", + revision: "1", +}); +const topology = WorkflowTopologyMsg.create({ + nodeIds: ["fetch"], + graph: { fetch: { children: [] } }, + nodeTypes: { fetch: "step" }, + displayNames: { fetch: "Fetch" }, +}); +const baseline: StructuralBaseline = { + catalog: CatalogSnapshotMsg.create({ + operatorInstanceId: "operator-1", + asOfSequence: "1", + revision: "1", + workflows: [workflow], + }), + asOfSequence: "1", + runs: [ + RunSnapshotMsg.create({ + operatorInstanceId: "operator-1", + asOfSequence: "1", + summary, + nodes: [node], + topology, + }), + ], +}; + +describe("projectionReducer", () => { + it("installs an authoritative replaceable baseline", () => { + const state = projectionReducer(emptyProjection, { type: "baseline", baseline }); + + expect(state.catalog?.revision).toBe("1"); + expect(state.runs[summary.runId].topology).toEqual(topology); + expect(state.operatorInstanceId).toBe("operator-1"); + expect(state.sequence).toBe("1"); + }); + + it("applies ordered run and node changes without replacing recorded topology", () => { + let state = projectionReducer(emptyProjection, { type: "baseline", baseline }); + state = projectionReducer(state, { + type: "envelope", + envelope: OperatorUpdateEnvelope.create({ + operatorInstanceId: "operator-1", + payload: { + oneofKind: "update", + update: { + sequence: "2", + change: { + oneofKind: "nodeStatusChanged", + nodeStatusChanged: { + runId: summary.runId, + nodeId: "fetch", + status: "failed", + startedAt: 10, + endedAt: 12, + revision: "2", + error: "source unavailable", + }, + }, + }, + }, + }), + }); + + expect(state.runs[summary.runId].nodes[0]).toMatchObject({ + status: "failed", + error: "source unavailable", + }); + expect(state.runs[summary.runId].topology).toEqual(topology); + }); + + it("replaces the current catalog without mutating historical runs", () => { + const initial = projectionReducer(emptyProjection, { type: "baseline", baseline }); + const changedWorkflow = FlowInfoMsg.create({ + ...workflow, + nodeIds: ["fetch", "store"], + displayNames: { fetch: "Fetch", store: "Store" }, + }); + const state = projectionReducer(initial, { + type: "envelope", + envelope: OperatorUpdateEnvelope.create({ + operatorInstanceId: "operator-1", + payload: { + oneofKind: "update", + update: { + sequence: "2", + change: { + oneofKind: "catalogReplaced", + catalogReplaced: { + catalog: CatalogSnapshotMsg.create({ + operatorInstanceId: "operator-1", + asOfSequence: "2", + revision: "2", + workflows: [changedWorkflow], + }), + }, + }, + }, + }, + }), + }); + + expect(state.catalog?.workflows[0].nodeIds).toEqual(["fetch", "store"]); + expect(state.runs[summary.runId].topology?.nodeIds).toEqual(["fetch"]); + }); + + it("rejects sequence gaps and reset notices", () => { + const state = projectionReducer(emptyProjection, { type: "baseline", baseline }); + const gap = OperatorUpdateEnvelope.create({ + operatorInstanceId: "operator-1", + payload: { + oneofKind: "update", + update: { sequence: "3", change: { oneofKind: undefined } }, + }, + }); + const reset = OperatorUpdateEnvelope.create({ + operatorInstanceId: "operator-1", + payload: { + oneofKind: "resetRequired", + resetRequired: { historyFloor: "2", latestSequence: "8" }, + }, + }); + + expect(() => projectionReducer(state, { type: "envelope", envelope: gap })).toThrow( + "update gap", + ); + expect(() => projectionReducer(state, { type: "envelope", envelope: reset })).toThrow( + "structural reset", + ); + }); +}); diff --git a/web/operator/src/state.ts b/web/operator/src/state.ts new file mode 100644 index 0000000..a65539b --- /dev/null +++ b/web/operator/src/state.ts @@ -0,0 +1,256 @@ +import { useCallback, useEffect, useReducer, useRef } from "react"; + +import type { OperatorApi, StructuralBaseline } from "./api"; +import type { + AgentEventDescriptorMsg, + CatalogSnapshotMsg, + LogRecordDescriptorMsg, + OperatorUpdateEnvelope, + RunSnapshotMsg, +} from "./generated/operator"; + +export interface OperatorProjection { + catalog?: CatalogSnapshotMsg; + runs: Record; + liveEvents: Record; + liveLogs: Record; + operatorInstanceId: string; + sequence: string; + connection: "connecting" | "live" | "reconnecting"; + error?: string; + action?: { kind: "start" | "cancel"; target: string }; +} + +type ProjectionAction = + | { type: "baseline"; baseline: StructuralBaseline } + | { type: "envelope"; envelope: OperatorUpdateEnvelope } + | { type: "connection"; connection: OperatorProjection["connection"]; error?: string } + | { type: "action"; action?: OperatorProjection["action"] }; + +export const emptyProjection: OperatorProjection = { + runs: {}, + liveEvents: {}, + liveLogs: {}, + operatorInstanceId: "", + sequence: "0", + connection: "connecting", +}; + +export function projectionReducer( + state: OperatorProjection, + action: ProjectionAction, +): OperatorProjection { + if (action.type === "baseline") { + const runs = Object.fromEntries( + action.baseline.runs + .filter((run) => run.summary) + .map((run) => [run.summary!.runId, run]), + ); + return { + ...emptyProjection, + catalog: action.baseline.catalog, + runs, + operatorInstanceId: action.baseline.catalog.operatorInstanceId, + sequence: action.baseline.asOfSequence, + connection: "live", + }; + } + if (action.type === "connection") { + return { ...state, connection: action.connection, error: action.error }; + } + if (action.type === "action") return { ...state, action: action.action }; + + const { envelope } = action; + if (envelope.operatorInstanceId !== state.operatorInstanceId) { + throw new Error("Operator epoch changed"); + } + if (envelope.payload.oneofKind !== "update") { + throw new Error("Operator requested a structural reset"); + } + const update = envelope.payload.update; + if (BigInt(update.sequence) !== BigInt(state.sequence) + 1n) { + throw new Error(`Operator update gap after sequence ${state.sequence}`); + } + const next: OperatorProjection = { ...state, sequence: update.sequence, error: undefined }; + const change = update.change; + if (change.oneofKind === "catalogReplaced") { + if (change.catalogReplaced.catalog) next.catalog = change.catalogReplaced.catalog; + return next; + } + if (change.oneofKind === "runCreated" && change.runCreated.summary) { + const summary = change.runCreated.summary; + next.runs = { + ...state.runs, + [summary.runId]: { + operatorInstanceId: state.operatorInstanceId, + asOfSequence: update.sequence, + summary, + nodes: change.runCreated.nodes, + latestLogSequence: "0", + logPageToken: "", + topology: change.runCreated.topology, + }, + }; + return next; + } + const runId = + change.oneofKind === "runStatusChanged" + ? change.runStatusChanged.runId + : change.oneofKind === "nodeStatusChanged" + ? change.nodeStatusChanged.runId + : change.oneofKind === "logAppended" + ? change.logAppended.runId + : change.oneofKind === "agentEventAppended" + ? change.agentEventAppended.runId + : change.oneofKind === "traceFinalized" + ? change.traceFinalized.runId + : ""; + const run = state.runs[runId]; + if (!run) throw new Error(`Operator update referenced unknown run ${runId}`); + + if (change.oneofKind === "runStatusChanged" && run.summary) { + next.runs = { + ...state.runs, + [runId]: { + ...run, + summary: { + ...run.summary, + status: change.runStatusChanged.status, + startedAt: change.runStatusChanged.startedAt, + endedAt: change.runStatusChanged.endedAt, + revision: change.runStatusChanged.revision, + }, + }, + }; + } else if (change.oneofKind === "nodeStatusChanged") { + const changed = change.nodeStatusChanged; + next.runs = { + ...state.runs, + [runId]: { + ...run, + nodes: run.nodes.map((node) => + node.nodeId === changed.nodeId + ? { + ...node, + status: changed.status, + startedAt: changed.startedAt, + endedAt: changed.endedAt, + revision: changed.revision, + error: changed.error, + } + : node, + ), + }, + }; + } else if (change.oneofKind === "logAppended" && change.logAppended.log) { + next.liveLogs = { + ...state.liveLogs, + [runId]: [...(state.liveLogs[runId] ?? []), change.logAppended.log], + }; + } else if ( + change.oneofKind === "agentEventAppended" && + change.agentEventAppended.event + ) { + const key = `${runId}:${change.agentEventAppended.nodeId}`; + next.liveEvents = { + ...state.liveEvents, + [key]: [...(state.liveEvents[key] ?? []), change.agentEventAppended.event], + }; + } else if (change.oneofKind === "traceFinalized" && change.traceFinalized.trace) { + next.runs = { + ...state.runs, + [runId]: { + ...run, + nodes: run.nodes.map((node) => + node.nodeId === change.traceFinalized.nodeId + ? { ...node, trace: change.traceFinalized.trace } + : node, + ), + }, + }; + } + return next; +} + + +export function useOperatorProjection(api: OperatorApi) { + const [state, dispatch] = useReducer(projectionReducer, emptyProjection); + const generation = useRef(0); + + const reconcile = useCallback(async () => { + const baseline = await api.loadBaseline(); + dispatch({ type: "baseline", baseline }); + return baseline; + }, [api]); + + useEffect(() => { + const currentGeneration = ++generation.current; + let stopped = false; + const run = async () => { + let retryMilliseconds = 250; + while (!stopped && generation.current === currentGeneration) { + try { + dispatch({ type: "connection", connection: "connecting" }); + const baseline = await api.loadBaseline(); + if (stopped) return; + dispatch({ type: "baseline", baseline }); + retryMilliseconds = 250; + let sequence = baseline.asOfSequence; + for await (const envelope of api.streamUpdates( + baseline.catalog.operatorInstanceId, + sequence, + )) { + if (stopped) return; + if (envelope.payload.oneofKind !== "update") break; + if (BigInt(envelope.payload.update.sequence) !== BigInt(sequence) + 1n) break; + dispatch({ type: "envelope", envelope }); + sequence = envelope.payload.update.sequence; + } + dispatch({ type: "connection", connection: "reconnecting" }); + } catch (error) { + if (stopped) return; + dispatch({ + type: "connection", + connection: "reconnecting", + error: error instanceof Error ? error.message : "Operator connection failed", + }); + const { promise, resolve } = Promise.withResolvers(); + window.setTimeout(resolve, retryMilliseconds); + await promise; + retryMilliseconds = Math.min(retryMilliseconds * 2, 4000); + } + } + }; + void run(); + return () => { + stopped = true; + generation.current += 1; + }; + }, [api]); + + const startRun = useCallback( + async (workflowSelector: string, input?: Record) => { + dispatch({ type: "action", action: { kind: "start", target: workflowSelector } }); + try { + return await api.startRun(workflowSelector, input); + } finally { + dispatch({ type: "action", action: undefined }); + } + }, + [api], + ); + + const cancelRun = useCallback( + async (runId: string) => { + dispatch({ type: "action", action: { kind: "cancel", target: runId } }); + try { + await api.cancelRun(runId); + } finally { + dispatch({ type: "action", action: undefined }); + } + }, + [api], + ); + + return { state, reconcile, startRun, cancelRun }; +} diff --git a/web/operator/src/styles.css b/web/operator/src/styles.css new file mode 100644 index 0000000..cb00655 --- /dev/null +++ b/web/operator/src/styles.css @@ -0,0 +1,225 @@ +:root { + color: #dce4df; + background: #0d1011; + font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif; + font-synthesis: none; + --panel: #131718; + --panel-raised: #181d1e; + --line: rgba(217, 232, 224, 0.1); + --muted: #87918d; + --acid: #d9ed72; + --mint: #79dab7; + --amber: #f0bd68; + --red: #f18378; +} + +* { box-sizing: border-box; } +html, body, #root { width: 100%; height: 100%; margin: 0; overflow: hidden; } +button, input { font: inherit; } +button { color: inherit; } +code, pre, .eyebrow, small { font-family: "DM Mono", monospace; } + +.app-shell { height: 100%; display: grid; grid-template-rows: 58px auto 1fr; } +.topbar { + display: grid; grid-template-columns: 260px 1fr auto; align-items: center; + padding: 0 20px; border-bottom: 1px solid var(--line); background: #101314; + z-index: 10; +} +.brand { display: flex; align-items: center; gap: 11px; } +.brand-mark { + width: 30px; height: 30px; display: grid; place-items: center; color: #101314; + background: var(--acid); font-weight: 800; clip-path: polygon(50% 0, 100% 100%, 0 100%); + padding-top: 8px; +} +.brand div { display: flex; align-items: baseline; gap: 7px; } +.brand strong { font-size: 15px; letter-spacing: -0.02em; } +.brand span:last-child { color: var(--muted); font: 11px "DM Mono"; text-transform: uppercase; } +.breadcrumb { display: flex; justify-content: center; gap: 9px; color: var(--muted); font-size: 12px; } +.breadcrumb i { opacity: 0.4; } +.breadcrumb strong { color: #cfd8d3; font-weight: 500; } +.connection { display: flex; align-items: center; gap: 8px; font: 11px "DM Mono"; text-transform: capitalize; } +.connection > span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); } +.connection-live > span { background: var(--mint); box-shadow: 0 0 10px var(--mint); } +.connection small { color: #59615e; margin-left: 5px; } +.connection-error, .action-error, .error-banner { + background: #4c2525; color: #ffd4cf; padding: 8px 18px; font-size: 12px; + border-bottom: 1px solid #813c37; +} + +.workspace { min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr); } +.workspace.with-inspector { grid-template-columns: 280px minmax(0, 1fr) 410px; } +.explorer { background: var(--panel); border-right: 1px solid var(--line); overflow: auto; min-width: 0; } +.explorer > header { padding: 22px 18px 14px; position: relative; } +.eyebrow { display: block; color: var(--acid); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; } +h1, h2, h3, p { margin-top: 0; } +.explorer h2 { margin: 5px 0 0; font-size: 17px; } +.catalog-revision { position: absolute; right: 18px; bottom: 17px; color: #67706c; font: 9px "DM Mono"; } +.target-list { padding: 4px 10px 30px; } +.target { border-top: 1px solid var(--line); padding-top: 7px; margin-top: 4px; } +.target-heading, .tree-row, .tree-select, .run-select { width: 100%; min-width: 0; } +.target-heading, .tree-select, .run-select, .tree-disclosure { + background: none; border: 0; cursor: pointer; text-align: left; +} +.target-heading { display: grid; grid-template-columns: 12px 22px minmax(0,1fr); gap: 5px; align-items: center; padding: 8px 5px; } +.target-heading > span:first-child { color: #5e6763; } +.target-kind { width: 20px; height: 20px; border: 1px solid #49524e; border-radius: 3px; display: grid; place-items: center; font: 9px "DM Mono"; color: #a8b1ad; } +.target-heading strong, .target-heading small, .tree-select strong, .tree-select small, .run-select strong, .run-select small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.target-heading strong { font-size: 11px; font-weight: 600; } +.target-heading small { color: #5f6965; font-size: 8px; margin-top: 2px; } +.workflow-list { border-left: 1px solid #303637; margin-left: 16px; padding-left: 7px; } +.tree-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: stretch; } +.tree-disclosure { color: #5f6865; text-align: center; padding: 0; } +.tree-select { display: grid; grid-template-columns: 23px minmax(0, 1fr); gap: 4px; padding: 8px; border-radius: 4px; } +.tree-select:hover, .run-select:hover, .tree-select.active, .run-select.active { background: #202627; } +.tree-select.active { box-shadow: inset 2px 0 var(--acid); } +.workflow-glyph { color: var(--acid); font-size: 16px; } +.tree-select strong { font-size: 11px; font-weight: 600; } +.tree-select small, .run-select small { color: #68716e; font-size: 8px; margin-top: 3px; } +.run-branches { margin-left: 28px; border-left: 1px dashed #303637; padding: 3px 0 6px 8px; } +.run-select { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 5px; align-items: center; padding: 7px; border-radius: 4px; } +.run-select strong { font: 9px "DM Mono"; } +.run-dot { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font: 9px "DM Mono"; background: #252c2a; color: var(--muted); } +.run-dot.status-success { color: var(--mint); } +.run-dot.status-failed { color: var(--red); } +.run-dot.status-running { color: var(--acid); } +.no-runs { display: block; color: #525a57; padding: 7px; font: 8px "DM Mono"; } +.diagnostics { margin: 0 12px 12px; padding: 9px; background: #34291c; border: 1px solid #5d472b; border-radius: 4px; font-size: 10px; } +.diagnostics summary { color: var(--amber); cursor: pointer; } +.diagnostics div { margin-top: 9px; border-top: 1px solid #5d472b; padding-top: 8px; } +.diagnostics strong, .diagnostics span { display: block; } +.diagnostics span { color: #ac9473; font: 8px "DM Mono"; overflow: hidden; text-overflow: ellipsis; } +.diagnostics p { color: #d4bd9b; margin: 4px 0 0; } +.skeleton { padding: 20px; } +.skeleton div { height: 38px; background: #1b2021; margin-bottom: 9px; animation: pulse 1.2s infinite alternate; } +@keyframes pulse { to { opacity: .45; } } + +.canvas-shell { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr; background: #0f1213; } +.view-header { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; border-bottom: 1px solid var(--line); } +.view-header h1 { margin: 4px 0 2px; font-size: 22px; letter-spacing: -.035em; } +.view-header p { margin: 0; color: var(--muted); font-size: 11px; } +.canvas { position: relative; min-height: 0; } +.blueprint-canvas { background: radial-gradient(circle at 55% 35%, rgba(72, 97, 86, .14), transparent 45%), #0f1213; } +.run-canvas { background: radial-gradient(circle at 55% 35%, rgba(89, 76, 62, .13), transparent 45%), #111313; } +.react-flow__controls { background: #1b2021; border: 1px solid var(--line); box-shadow: none; } +.react-flow__controls-button { background: #1b2021; border-bottom-color: var(--line); fill: #aeb8b3; } +.react-flow__controls-button:hover { background: #272e2f; } +.react-flow__edge-path { stroke: #66736d; stroke-width: 1.4; } +.react-flow__arrowhead polyline { stroke: #66736d; fill: #66736d; } +.node-card { width: 248px; min-height: 102px; position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 15px; text-align: left; background: #171c1d; border: 1px solid #47514d; border-radius: 6px; box-shadow: 0 14px 30px rgba(0,0,0,.25); cursor: pointer; } +.node-card:hover { border-color: var(--acid); transform: translateY(-1px); } +.node-card.blueprint { background: linear-gradient(145deg, #18201f, #15191a); } +.node-card strong { font-size: 13px; } +.node-kicker { color: #78827e; font: 8px "DM Mono"; letter-spacing: .12em; text-transform: uppercase; } +.node-status { position: absolute; right: 12px; top: 12px; font: 8px "DM Mono"; text-transform: uppercase; color: var(--muted); } +.node-duration { color: var(--muted); font: 9px "DM Mono"; } +.node-error { color: #ffaaa2; background: rgba(118,44,40,.25); padding: 5px; border-radius: 3px; font-size: 9px; max-height: 42px; overflow: hidden; } +.node-card.status-success { border-color: #426b5c; } +.node-card.status-failed { border-color: #984d47; } +.node-card.status-running { border-color: #9aa64f; box-shadow: 0 0 0 1px rgba(217,237,114,.12), 0 14px 30px rgba(0,0,0,.25); } +.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; border-top: 1px solid var(--line); padding-top: 8px; } +.field-grid > span { min-width: 0; } +.field-grid small { display: block; color: #68726e; font-size: 7px; text-transform: uppercase; margin-bottom: 3px; } +.field { display: block; color: #b2bdb7; font: 8px "DM Mono"; overflow: hidden; text-overflow: ellipsis; } +.react-flow__handle { width: 7px; height: 7px; background: var(--acid); border: 1px solid #101314; } +.historical-badge { position: absolute; right: 18px; bottom: 18px; z-index: 5; padding: 9px 12px; background: rgba(26, 24, 21, .92); border: 1px solid #665642; color: #9d8f7c; font-size: 9px; border-radius: 4px; } +.historical-badge span { display: block; color: var(--amber); font: 8px "DM Mono"; text-transform: uppercase; margin-bottom: 3px; } +.empty-state { height: 100%; display: grid; place-content: center; text-align: center; color: #66706c; } +.empty-state > span { color: var(--acid); font-size: 40px; } +.empty-state h2 { color: #c6cfca; margin: 8px 0; } +.empty-state p { max-width: 390px; font-size: 12px; } + +.inspector { min-width: 0; background: var(--panel-raised); border-left: 1px solid var(--line); overflow: hidden; display: grid; grid-template-rows: auto auto 1fr; } +.inspector > header { display: flex; justify-content: space-between; align-items: start; padding: 19px 20px 14px; border-bottom: 1px solid var(--line); } +.inspector h2 { margin: 4px 0 5px; font-size: 18px; } +.icon-button { width: 30px; height: 30px; background: none; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-size: 19px; } +.icon-button:hover { border-color: #69736f; } +.status-pill { display: inline-flex; padding: 3px 7px; border: 1px solid #48514e; border-radius: 20px; color: var(--muted); font: 8px "DM Mono"; text-transform: uppercase; } +.status-pill.status-failed { color: var(--red); border-color: #75413d; } +.status-pill.status-success { color: var(--mint); border-color: #355e50; } +.inspector-tabs { display: flex; overflow-x: auto; padding: 0 10px; border-bottom: 1px solid var(--line); } +.inspector-tabs button { padding: 11px 9px 9px; background: none; border: 0; border-bottom: 2px solid transparent; color: #727c77; font: 8px "DM Mono"; text-transform: uppercase; cursor: pointer; } +.inspector-tabs button.active { color: var(--acid); border-bottom-color: var(--acid); } +.inspector-body { overflow: auto; padding: 18px 20px 30px; } +.inspector-body section { margin-bottom: 23px; } +.inspector-body h3 { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #a3ada8; } +.instructions { color: #c4cdc8; white-space: pre-wrap; font-size: 12px; line-height: 1.65; } +.signature-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } +.field-detail { border-top: 1px solid var(--line); padding: 8px 0; } +.field-detail strong, .field-detail code { display: block; font-size: 10px; } +.field-detail code { color: #79837f; font-size: 8px; margin-top: 2px; } +.field-detail p { color: #78817d; font-size: 9px; margin: 4px 0 0; } +.json-block { padding: 11px; background: #101415; border: 1px solid var(--line); border-radius: 4px; overflow: auto; color: #aab5af; font-size: 9px; white-space: pre-wrap; } +.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } +.metric-grid > div { background: #111516; border: 1px solid var(--line); padding: 10px; } +.metric-grid small, .metric-grid strong { display: block; } +.metric-grid small { color: #68716e; font-size: 7px; text-transform: uppercase; } +.metric-grid strong { margin-top: 5px; font-size: 11px; } +.node-failure { padding: 10px; background: #3a2020; border: 1px solid #713d39; color: #ffc1ba; font-size: 10px; } +.trace-header, .value-object { margin: 0; } +.trace-header > div, .value-object > div { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 10px; border-top: 1px solid var(--line); padding: 7px 0; } +.trace-header dt, .value-object dt { color: #727c77; font: 8px "DM Mono"; } +.trace-header dd, .value-object dd { margin: 0; font-size: 10px; min-width: 0; } +.empty-copy { color: #69736e; font-size: 11px; } +.trace-layout { display: grid; grid-template-rows: auto 220px auto; gap: 12px; } +.trace-toolbar { display: flex; justify-content: space-between; align-items: center; } +.trace-toolbar h3 { margin: 0 0 3px; } +.trace-toolbar span { color: #69736e; font: 8px "DM Mono"; } +.toggle { background: none; border: 1px solid #48514d; color: #818b86; border-radius: 20px; padding: 5px 8px; font: 8px "DM Mono"; cursor: pointer; } +.toggle.active { color: var(--acid); border-color: #77834a; } +.turn-list { height: 220px; overflow: auto; border: 1px solid var(--line); background: #111516; } +.turn-row { position: absolute; left: 0; top: 0; width: 100%; height: 60px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px; background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; } +.turn-row:hover, .turn-row.active { background: #202627; } +.turn-row.active { box-shadow: inset 2px 0 var(--acid); } +.turn-row.failed { box-shadow: inset 2px 0 var(--red); } +.turn-row strong { font-size: 10px; } +.turn-row span, .turn-row small { color: #78817d; font: 8px "DM Mono"; } +.turn-row small { grid-column: 1 / -1; } +.turn-detail { border-top: 1px solid var(--line); padding-top: 12px; } +.value-object .value-object { border-left: 1px solid #313837; padding-left: 8px; } +.value-string { color: #c4d99d; white-space: pre-wrap; overflow-wrap: anywhere; } +.value-scalar { color: #82c8cc; } +.value-null { color: #68716e; } +.value-unavailable { color: var(--amber); font-size: 9px; } +.value-list { margin: 0; padding-left: 20px; } +.value-list li { margin: 5px 0; } +.file-value { display: flex; gap: 9px; padding: 9px; border: 1px solid #5f6441; background: #22251a; border-radius: 4px; color: var(--acid); } +.file-value small, .file-value code { display: block; } +.file-value small { color: #919976; font-size: 7px; text-transform: uppercase; } +.file-value code { margin-top: 3px; font-size: 9px; overflow-wrap: anywhere; } +.log-list { margin-bottom: 12px; } +.log-list button { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; gap: 7px; padding: 7px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: #929c97; text-align: left; font: 8px "DM Mono"; cursor: pointer; } +.log-list button:hover { background: #202627; } +.log-level { text-transform: uppercase; } +.level-error { color: var(--red); } +.level-warning { color: var(--amber); } + +.run-controls { display: flex; align-items: center; gap: 7px; position: relative; } +.run-button, .cancel-button, .input-toggle { border-radius: 4px; padding: 8px 13px; cursor: pointer; font-size: 10px; } +.run-button { background: var(--acid); border: 1px solid var(--acid); color: #111412; font-weight: 700; } +.cancel-button { background: #3a2221; border: 1px solid #71403c; color: #f2a39b; } +.input-toggle { background: transparent; border: 1px solid #3c4541; color: #89938e; } +.input-toggle.active { color: var(--acid); border-color: #6e7848; } +.run-controls button:disabled { opacity: .5; cursor: wait; } +.input-popover { position: absolute; z-index: 20; right: 0; top: 43px; width: 390px; padding: 13px; background: #15191a; border: 1px solid #4a5450; box-shadow: 0 18px 50px rgba(0,0,0,.5); } +.input-popover > div:first-child { display: flex; justify-content: space-between; margin-bottom: 9px; } +.input-popover strong { font-size: 11px; } +.input-popover span { color: #6d7672; font: 8px "DM Mono"; } +.json-editor { border: 1px solid var(--line); font-size: 10px; } +.action-error { position: absolute; z-index: 21; right: 0; top: 44px; width: 390px; border: 1px solid #813c37; } +.input-popover + .action-error { top: 205px; } + +@media (max-width: 1000px) { + .workspace, .workspace.with-inspector { grid-template-columns: 230px minmax(0, 1fr); } + .inspector { position: fixed; z-index: 30; right: 0; top: 58px; bottom: 0; width: min(420px, calc(100vw - 230px)); box-shadow: -20px 0 50px rgba(0,0,0,.45); } + .topbar { grid-template-columns: 210px 1fr auto; } +} + +@media (max-width: 700px) { + .workspace, .workspace.with-inspector { grid-template-columns: 1fr; } + .explorer { display: none; } + .breadcrumb { display: none; } + .topbar { grid-template-columns: 1fr auto; } + .view-header { align-items: flex-start; padding: 13px 16px; } + .inspector { width: 100vw; top: 58px; } + .input-popover, .action-error { width: calc(100vw - 32px); } +} diff --git a/web/operator/src/test/setup.ts b/web/operator/src/test/setup.ts new file mode 100644 index 0000000..f149f27 --- /dev/null +++ b/web/operator/src/test/setup.ts @@ -0,0 +1 @@ +import "@testing-library/jest-dom/vitest"; diff --git a/web/operator/tsconfig.app.json b/web/operator/tsconfig.app.json new file mode 100644 index 0000000..419946d --- /dev/null +++ b/web/operator/tsconfig.app.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ES2024", + "useDefineForClassFields": true, + "lib": ["ES2024", "DOM", "DOM.Iterable"], + "allowJs": false, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "types": ["vitest/globals", "@testing-library/jest-dom"] + }, + "include": ["src"] +} diff --git a/web/operator/tsconfig.json b/web/operator/tsconfig.json new file mode 100644 index 0000000..1ffef60 --- /dev/null +++ b/web/operator/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/web/operator/tsconfig.node.json b/web/operator/tsconfig.node.json new file mode 100644 index 0000000..315eb15 --- /dev/null +++ b/web/operator/tsconfig.node.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "composite": true, + "noEmit": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true + }, + "include": ["vite.config.ts"] +} diff --git a/web/operator/tsconfig.node.tsbuildinfo b/web/operator/tsconfig.node.tsbuildinfo new file mode 100644 index 0000000..ebc26a6 --- /dev/null +++ b/web/operator/tsconfig.node.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["./node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.d.ts","./node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","./node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.d.ts","./node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","./node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.scripthost.d.ts","./node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","./node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","./node_modules/.pnpm/vite@7.3.6/node_modules/vite/types/hmrPayload.d.ts","./node_modules/.pnpm/vite@7.3.6/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts","./node_modules/.pnpm/vite@7.3.6/node_modules/vite/types/customEvent.d.ts","./node_modules/.pnpm/@types+estree@1.0.9/node_modules/@types/estree/index.d.ts","./node_modules/.pnpm/rollup@4.62.3/node_modules/rollup/dist/rollup.d.ts","./node_modules/.pnpm/rollup@4.62.3/node_modules/rollup/dist/parseAst.d.ts","./node_modules/.pnpm/vite@7.3.6/node_modules/vite/types/hot.d.ts","./node_modules/.pnpm/vite@7.3.6/node_modules/vite/dist/node/module-runner.d.ts","./node_modules/.pnpm/esbuild@0.28.1/node_modules/esbuild/lib/main.d.ts","./node_modules/.pnpm/vite@7.3.6/node_modules/vite/types/internal/terserOptions.d.ts","./node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/source-map.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/previous-map.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/input.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/css-syntax-error.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/declaration.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/root.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/warning.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/lazy-result.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/no-work-result.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/processor.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/result.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/document.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/rule.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/node.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/comment.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/container.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/at-rule.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/list.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/postcss.d.ts","./node_modules/.pnpm/postcss@8.5.25/node_modules/postcss/lib/postcss.d.mts","./node_modules/.pnpm/vite@7.3.6/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts","./node_modules/.pnpm/vite@7.3.6/node_modules/vite/types/internal/lightningcssOptions.d.ts","./node_modules/.pnpm/vite@7.3.6/node_modules/vite/types/importGlob.d.ts","./node_modules/.pnpm/vite@7.3.6/node_modules/vite/types/metadata.d.ts","./node_modules/.pnpm/vite@7.3.6/node_modules/vite/dist/node/index.d.ts","./node_modules/.pnpm/@babel+types@7.29.8/node_modules/@babel/types/lib/index.d.ts","./node_modules/.pnpm/@types+babel__generator@7.27.0/node_modules/@types/babel__generator/index.d.ts","./node_modules/.pnpm/@babel+parser@7.29.8/node_modules/@babel/parser/typings/babel-parser.d.ts","./node_modules/.pnpm/@types+babel__template@7.4.4/node_modules/@types/babel__template/index.d.ts","./node_modules/.pnpm/@types+babel__traverse@7.28.0/node_modules/@types/babel__traverse/index.d.ts","./node_modules/.pnpm/@types+babel__core@7.20.5/node_modules/@types/babel__core/index.d.ts","./node_modules/.pnpm/@vitejs+plugin-react@5.2.0_vite@7.3.6/node_modules/@vitejs/plugin-react/dist/index.d.ts","./node_modules/.pnpm/@vitest+spy@3.2.7/node_modules/@vitest/spy/dist/index.d.ts","./node_modules/.pnpm/@vitest+pretty-format@3.2.7/node_modules/@vitest/pretty-format/dist/index.d.ts","./node_modules/.pnpm/@vitest+utils@3.2.7/node_modules/@vitest/utils/dist/types.d.ts","./node_modules/.pnpm/@vitest+utils@3.2.7/node_modules/@vitest/utils/dist/helpers.d.ts","./node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/index-8b61d5bc.d.ts","./node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.d.ts","./node_modules/.pnpm/@vitest+utils@3.2.7/node_modules/@vitest/utils/dist/index.d.ts","./node_modules/.pnpm/@vitest+utils@3.2.7/node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts","./node_modules/.pnpm/@vitest+utils@3.2.7/node_modules/@vitest/utils/dist/diff.d.ts","./node_modules/.pnpm/@vitest+expect@3.2.7/node_modules/@vitest/expect/dist/index.d.ts","./node_modules/.pnpm/@vitest+runner@3.2.7/node_modules/@vitest/runner/dist/tasks.d-CkscK4of.d.ts","./node_modules/.pnpm/@vitest+runner@3.2.7/node_modules/@vitest/runner/dist/types.d.ts","./node_modules/.pnpm/@vitest+utils@3.2.7/node_modules/@vitest/utils/dist/error.d.ts","./node_modules/.pnpm/@vitest+runner@3.2.7/node_modules/@vitest/runner/dist/index.d.ts","./node_modules/.pnpm/vitest@3.2.7_jsdom@27.4.0/node_modules/vitest/optional-types.d.ts","./node_modules/.pnpm/vitest@3.2.7_jsdom@27.4.0/node_modules/vitest/dist/chunks/environment.d.cL3nLXbE.d.ts","./node_modules/.pnpm/@vitest+mocker@3.2.7_vite@7.3.6/node_modules/@vitest/mocker/dist/registry.d-D765pazg.d.ts","./node_modules/.pnpm/@vitest+mocker@3.2.7_vite@7.3.6/node_modules/@vitest/mocker/dist/types.d-D_aRZRdy.d.ts","./node_modules/.pnpm/@vitest+mocker@3.2.7_vite@7.3.6/node_modules/@vitest/mocker/dist/index.d.ts","./node_modules/.pnpm/@vitest+utils@3.2.7/node_modules/@vitest/utils/dist/source-map.d.ts","./node_modules/.pnpm/vite-node@3.2.4/node_modules/vite-node/dist/trace-mapping.d-DLVdEqOp.d.ts","./node_modules/.pnpm/vite-node@3.2.4/node_modules/vite-node/dist/index.d-DGmxD2U7.d.ts","./node_modules/.pnpm/vite-node@3.2.4/node_modules/vite-node/dist/index.d.ts","./node_modules/.pnpm/@vitest+snapshot@3.2.7/node_modules/@vitest/snapshot/dist/environment.d-DHdQ1Csl.d.ts","./node_modules/.pnpm/@vitest+snapshot@3.2.7/node_modules/@vitest/snapshot/dist/rawSnapshot.d-lFsMJFUd.d.ts","./node_modules/.pnpm/@vitest+snapshot@3.2.7/node_modules/@vitest/snapshot/dist/index.d.ts","./node_modules/.pnpm/@vitest+snapshot@3.2.7/node_modules/@vitest/snapshot/dist/environment.d.ts","./node_modules/.pnpm/vitest@3.2.7_jsdom@27.4.0/node_modules/vitest/dist/chunks/config.d.BKdhh7Zx.d.ts","./node_modules/.pnpm/vitest@3.2.7_jsdom@27.4.0/node_modules/vitest/dist/chunks/worker.d.CUgIPz9V.d.ts","./node_modules/.pnpm/@types+deep-eql@4.0.2/node_modules/@types/deep-eql/index.d.ts","./node_modules/.pnpm/assertion-error@2.0.1/node_modules/assertion-error/index.d.ts","./node_modules/.pnpm/@types+chai@5.2.3/node_modules/@types/chai/index.d.ts","./node_modules/.pnpm/@vitest+runner@3.2.7/node_modules/@vitest/runner/dist/utils.d.ts","./node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.d.ts","./node_modules/.pnpm/vitest@3.2.7_jsdom@27.4.0/node_modules/vitest/dist/chunks/benchmark.d.BwvBVTda.d.ts","./node_modules/.pnpm/vite-node@3.2.4/node_modules/vite-node/dist/client.d.ts","./node_modules/.pnpm/vitest@3.2.7_jsdom@27.4.0/node_modules/vitest/dist/chunks/coverage.d.S9RMNXIe.d.ts","./node_modules/.pnpm/@vitest+snapshot@3.2.7/node_modules/@vitest/snapshot/dist/manager.d.ts","./node_modules/.pnpm/vitest@3.2.7_jsdom@27.4.0/node_modules/vitest/dist/chunks/reporters.d.BuRON0I0.d.ts","./node_modules/.pnpm/vitest@3.2.7_jsdom@27.4.0/node_modules/vitest/dist/chunks/vite.d.BnOPPc46.d.ts","./node_modules/.pnpm/vitest@3.2.7_jsdom@27.4.0/node_modules/vitest/dist/config.d.ts","./node_modules/.pnpm/vitest@3.2.7_jsdom@27.4.0/node_modules/vitest/config.d.ts","./vite.config.ts","./node_modules/.pnpm/@types+react@19.2.18/node_modules/@types/react/global.d.ts","./node_modules/.pnpm/csstype@3.2.3/node_modules/csstype/index.d.ts","./node_modules/.pnpm/@types+react@19.2.18/node_modules/@types/react/index.d.ts","./node_modules/.pnpm/@types+react-dom@19.2.4_@types+react@19.2.18/node_modules/@types/react-dom/index.d.ts"],"fileIdsList":[[43],[43,44,45,46,47],[43,45],[79,80],[95],[93,94],[42,48,89],[50,55,56,58],[66,67],[56,58,60,61,62],[56],[56,58,60],[56,60],[73],[51,73,74],[51,73],[51,57],[52],[51,52,53,55],[51],[33],[31,33],[22,30,31,32,34,36],[20],[23,28,33,36],[19,36],[23,24,27,28,29,36],[23,24,25,27,28,36],[20,21,22,23,24,28,29,30,32,33,34,36],[36],[18,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35],[18,36],[23,25,26,28,29,36],[27,36],[28,29,33,36],[21,31],[12,41,42],[11,12],[54],[70,71],[70],[8],[8,9,10,12,13,15,16,17,37,38,39,40,41,42],[8,9,10,14],[10],[12,42],[59,90],[63,82,83],[51,58,63,75,76],[85],[64],[42,51,56,58,63,65,68,69,72,75,77,78,81,84,86,87,89],[42,88,89],[63,65,72,75,77],[42,51,56,58,63,64,65,68,69,72,75,76,77,78,81,82,83,84,85,86,87,88,89],[49,91]],"fileInfos":[{"version":"a7297ff837fcdf174a9524925966429eb8e5feecc2cc55cc06574e6b092c1eaa","impliedFormat":1},{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a7ca8df4f2931bef2aa4118078584d84a0b16539598eaadf7dce9104dfaa381c","impliedFormat":1},{"version":"10073cdcf56982064c5337787cc59b79586131e1b28c106ede5bff362f912b70","impliedFormat":99},{"version":"72950913f4900b680f44d8cab6dd1ea0311698fc1eefb014eb9cdfc37ac4a734","impliedFormat":1},{"version":"751764bb94219b4ce8f5475dc35d3de2e432fea01a0c9610cd7f69ad05e398c6","impliedFormat":1},{"version":"21944c138a48dc23382cb6558b1d4498908faad2104ba7ff390ba8b27c06f3c0","affectsGlobalScope":true,"impliedFormat":1},{"version":"a660aa95476042d3fdcc1343cf6bb8fdf24772d31712b1db321c5a4dcc325434","impliedFormat":1},{"version":"36977c14a7f7bfc8c0426ae4343875689949fb699f3f84ecbe5b300ebf9a2c55","impliedFormat":1},{"version":"ff0a83c9a0489a627e264ffcb63f2264b935b20a502afa3a018848139e3d8575","impliedFormat":99},{"version":"161c8e0690c46021506e32fda85956d785b70f309ae97011fd27374c065cac9b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f582b0fcbf1eea9b318ab92fb89ea9ab2ebb84f9b60af89328a91155e1afce72","impliedFormat":1},{"version":"402e5c534fb2b85fa771170595db3ac0dd532112c8fa44fc23f233bc6967488b","impliedFormat":1},{"version":"52dcc257df5119fb66d864625112ce5033ac51a4c2afe376a0b299d2f7f76e4a","impliedFormat":1},{"version":"e5bab5f871ef708d52d47b3e5d0aa72a08ee7a152f33931d9a60809711a2a9a3","impliedFormat":1},{"version":"e16dc2a81595736024a206c7d5c8a39bfe2e6039208ef29981d0d95434ba8fcf","impliedFormat":1},{"version":"cc4a4903fb698ca1d961d4c10dce658aa3a479faf40509d526f122b044eaf6a4","impliedFormat":1},{"version":"19ee8416e6473ed6c7adb868fa796b5653cf0fa2a337658e677eaa0d134388c3","impliedFormat":1},{"version":"1328ab4e442614b28cdb3d4b414cf68325c0da0dca07287a338d0654b7a00261","impliedFormat":1},{"version":"a039dc21f045919f3cbee2ec13812cc6cc3eebc99dae4be00973230f468d19a6","impliedFormat":1},{"version":"3fbe57af01460e49dcd29df55d6931e1672bc6f1be0fb073d11410bc16f9037d","impliedFormat":1},{"version":"f760be449e8562ec5c09bb5187e8e1eabf3c113c0c58cddda53ef8c69f3e2131","impliedFormat":1},{"version":"44325ed13294fce6ab825b82947bbeed2611db7dad9d9135260192f375e5a189","impliedFormat":1},{"version":"e392e8fb5b514eafc585601c1d781485aa6dd6a320e75daf1064a4c6918a1b45","impliedFormat":1},{"version":"46e4a36e8ddbdfb4e7330e11c81c970dc8b218611df9183d39c41c5f8c653b55","impliedFormat":1},{"version":"3cc8a3d123b6b232d48d34b51b785f9da8d193f5b5817fa521fcd2f3b9315c55","impliedFormat":1},{"version":"6332f565867cf4a740a70e30f31cefba37ef7cebcf74f22eab8d744fde6d193e","impliedFormat":1},{"version":"2977b7884aedc895a1d0c9c210c7cf3272c29d6959a08a6fa3ff71e0aff08175","impliedFormat":1},{"version":"17f2922d41ddd032830a91371c948cd9ce903b35c95adca72271a54584f19b0b","impliedFormat":1},{"version":"3eed76ede2a1a14d7c9bb0a642041282dcc264811139d3dd275c9fe14efc9840","impliedFormat":1},{"version":"354a7f8e1287d9d6b7561bc97fdd8cbc2f7c1dd79e4cb37b942e8a5cfaff1085","impliedFormat":1},{"version":"8d369483f0c2b9ee388129cfdb6a43bc8112b377e86a41884bd06e19ce04f4c1","impliedFormat":99},{"version":"960bd764c62ac43edc24eaa2af958a4b4f1fa5d27df5237e176d0143b36a39c6","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ec16d7a4e366c06a4573d299e15fe6207fc080f41beac5da06f4af33ea9761e","impliedFormat":1},{"version":"59f8dc89b9e724a6a667f52cdf4b90b6816ae6c9842ce176d38fcc973669009e","affectsGlobalScope":true,"impliedFormat":1},{"version":"e4af494f7a14b226bbe732e9c130d8811f8c7025911d7c58dd97121a85519715","impliedFormat":1},{"version":"cbb1c5ba5dbabe42c19ca31b83e48fec95895484fe1d1a8fb649b69ea224c5b8","impliedFormat":99},{"version":"69d4b61c408556b97b796782a1110f7e01a03ed80f31741f2c59b722185830ed","impliedFormat":1},{"version":"b6d03c9cfe2cf0ba4c673c209fcd7c46c815b2619fd2aad59fc4229aaef2ed43","impliedFormat":1},{"version":"e6ca59368dce5a594dcde9bbb6ae640d668fa6c28c31639dd2a75b731bb036a2","impliedFormat":1},{"version":"670a76db379b27c8ff42f1ba927828a22862e2ab0b0908e38b671f0e912cc5ed","impliedFormat":1},{"version":"13b77ab19ef7aadd86a1e54f2f08ea23a6d74e102909e3c00d31f231ed040f62","impliedFormat":1},{"version":"069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","impliedFormat":1},{"version":"ef94438f848be3a3b0033013bf64753f771f983c1e205e4a06675eb253ca7cd2","impliedFormat":99},{"version":"04471dc55f802c29791cc75edda8c4dd2a121f71c2401059da61eff83099e8ab","impliedFormat":99},{"version":"5c54a34e3d91727f7ae840bfe4d5d1c9a2f93c54cb7b6063d06ee4a6c3322656","impliedFormat":99},{"version":"db4da53b03596668cf6cc9484834e5de3833b9e7e64620cf08399fe069cd398d","impliedFormat":99},{"version":"ac7c28f153820c10850457994db1462d8c8e462f253b828ad942a979f726f2f9","impliedFormat":99},{"version":"f9b028d3c3891dd817e24d53102132b8f696269309605e6ed4f0db2c113bbd82","impliedFormat":99},{"version":"fb7c8d90e52e2884509166f96f3d591020c7b7977ab473b746954b0c8d100960","impliedFormat":99},{"version":"0bff51d6ed0c9093f6955b9d8258ce152ddb273359d50a897d8baabcb34de2c4","impliedFormat":99},{"version":"ef13c73d6157a32933c612d476c1524dd674cf5b9a88571d7d6a0d147544d529","impliedFormat":99},{"version":"13918e2b81c4288695f9b1f3dcc2468caf0f848d5c1f3dc00071c619d34ff63a","impliedFormat":99},{"version":"120a80aa556732f684db3ed61aeff1d6671e1655bd6cba0aa88b22b88ac9a6b1","affectsGlobalScope":true,"impliedFormat":99},{"version":"45cec9a1ba6549060552eead8959d47226048e0b71c7d0702ae58b7e16a28912","impliedFormat":99},{"version":"6907b09850f86610e7a528348c15484c1e1c09a18a9c1e98861399dfe4b18b46","impliedFormat":99},{"version":"12deea8eaa7a4fc1a2908e67da99831e5c5a6b46ad4f4f948fd4759314ea2b80","impliedFormat":99},{"version":"f0a8b376568a18f9a4976ecb0855187672b16b96c4df1c183a7e52dc1b5d98e8","impliedFormat":99},{"version":"8124828a11be7db984fcdab052fd4ff756b18edcfa8d71118b55388176210923","impliedFormat":99},{"version":"092944a8c05f9b96579161e88c6f211d5304a76bd2c47f8d4c30053269146bc8","impliedFormat":99},{"version":"b34b5f6b506abb206b1ea73c6a332b9ee9c8c98be0f6d17cdbda9430ecc1efab","impliedFormat":99},{"version":"75d4c746c3d16af0df61e7b0afe9606475a23335d9f34fcc525d388c21e9058b","impliedFormat":99},{"version":"fa959bf357232201c32566f45d97e70538c75a093c940af594865d12f31d4912","impliedFormat":99},{"version":"d2c52abd76259fc39a30dfae70a2e5ce77fd23144457a7ff1b64b03de6e3aec7","impliedFormat":99},{"version":"e6233e1c976265e85aa8ad76c3881febe6264cb06ae3136f0257e1eab4a6cc5a","impliedFormat":99},{"version":"f73e2335e568014e279927321770da6fe26facd4ac96cdc22a56687f1ecbb58e","impliedFormat":99},{"version":"317878f156f976d487e21fd1d58ad0461ee0a09185d5b0a43eedf2a56eb7e4ea","impliedFormat":99},{"version":"324ac98294dab54fbd580c7d0e707d94506d7b2c3d5efe981a8495f02cf9ad96","impliedFormat":99},{"version":"9ec72eb493ff209b470467e24264116b6a8616484bca438091433a545dfba17e","impliedFormat":99},{"version":"d6ee22aba183d5fc0c7b8617f77ee82ecadc2c14359cc51271c135e23f6ed51f","impliedFormat":99},{"version":"49747416f08b3ba50500a215e7a55d75268b84e31e896a40313c8053e8dec908","impliedFormat":99},{"version":"5e91172586d1be7d1508d1a40c8bf76161f6f4179d1c25158a20599f9fb26a66","impliedFormat":99},{"version":"09d215b379a93f8cbb6caf9e9f5d7b4d48042295ee697e7e4771288c7917a21e","impliedFormat":99},{"version":"427fe2004642504828c1476d0af4270e6ad4db6de78c0b5da3e4c5ca95052a99","impliedFormat":1},{"version":"2eeffcee5c1661ddca53353929558037b8cf305ffb86a803512982f99bcab50d","impliedFormat":99},{"version":"9afb4cb864d297e4092a79ee2871b5d3143ea14153f62ef0bb04ede25f432030","affectsGlobalScope":true,"impliedFormat":99},{"version":"891694d3694abd66f0b8872997b85fd8e52bc51632ce0f8128c96962b443189f","impliedFormat":99},{"version":"69bf2422313487956e4dacf049f30cb91b34968912058d244cb19e4baa24da97","impliedFormat":99},{"version":"971a2c327ff166c770c5fb35699575ba2d13bba1f6d2757309c9be4b30036c8e","impliedFormat":99},{"version":"4f45e8effab83434a78d17123b01124259fbd1e335732135c213955d85222234","impliedFormat":99},{"version":"7bd51996fb7717941cbe094b05adc0d80b9503b350a77b789bbb0fc786f28053","impliedFormat":99},{"version":"b62006bbc815fe8190c7aee262aad6bff993e3f9ade70d7057dfceab6de79d2f","impliedFormat":99},{"version":"ab80d2cb170a92c61ca8c822d0db0fc50eb15c7c6cf1a24cb01852a5a15a7db8","impliedFormat":99},{"version":"210955af8573671abebb6e1391d134d82fbcff130aa68922ea1e839f8f48a0ad","impliedFormat":99},{"version":"78a8f2e95e2904914c509e4bbc68e626f8b8ff8f30ca96cffc7a795fa17394f5","impliedFormat":99},{"version":"7bbff6783e96c691a41a7cf12dd5486b8166a01b0c57d071dbcfca55c9525ec4","impliedFormat":99},"ef9d81de2a35bc66450b866797ebfed08643188b029a84b7c7ad03a055f96f07",{"version":"7e29f41b158de217f94cb9676bf9cbd0cd9b5a46e1985141ed36e075c52bf6ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"814d5c7384f3ca276e9dc4bcfde5545801a3ea0bfae09916b3336774e662fd1b","impliedFormat":1},{"version":"be1cc4d94ea60cbe567bc29ed479d42587bf1e6cba490f123d329976b0fe4ee5","impliedFormat":1}],"root":[92],"options":{"composite":true,"module":99,"skipLibCheck":true,"strict":true},"referencedMap":[[45,1],[48,2],[44,1],[46,3],[47,1],[81,4],[96,5],[95,6],[49,7],[59,8],[68,9],[63,10],[60,11],[61,12],[82,13],[76,14],[75,15],[87,15],[74,16],[58,17],[62,17],[53,18],[56,19],[69,18],[57,20],[34,21],[32,22],[33,23],[21,24],[22,22],[29,25],[20,26],[25,27],[26,28],[31,29],[37,30],[36,31],[19,32],[27,33],[28,34],[23,35],[30,21],[24,36],[13,37],[12,38],[55,39],[85,40],[71,41],[72,40],[9,42],[42,43],[15,44],[10,42],[14,45],[41,46],[91,47],[84,48],[77,49],[86,50],[65,51],[88,52],[89,53],[78,54],[90,55],[92,56]],"affectedFilesPendingEmit":[[92,17]],"emitSignatures":[92],"version":"5.9.3"} \ No newline at end of file diff --git a/web/operator/vite.config.ts b/web/operator/vite.config.ts new file mode 100644 index 0000000..a69c0b1 --- /dev/null +++ b/web/operator/vite.config.ts @@ -0,0 +1,37 @@ +import react from "@vitejs/plugin-react"; +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + plugins: [react()], + base: "/", + build: { + outDir: "../../src/runtime/operator/web_assets", + emptyOutDir: true, + sourcemap: false, + rollupOptions: { + output: { + manualChunks: { + graph: ["@xyflow/react"], + editor: ["@codemirror/lang-json", "@codemirror/state", "@codemirror/view"], + protobuf: [ + "@protobuf-ts/grpcweb-transport", + "@protobuf-ts/runtime", + "@protobuf-ts/runtime-rpc", + ], + }, + }, + }, + }, + server: { + port: 5173, + proxy: { + "/avalanche.operator.OperatorService": { + target: "http://127.0.0.1:7435", + }, + }, + }, + test: { + environment: "jsdom", + setupFiles: "./src/test/setup.ts", + }, +}); From 40d59fe2b701b08f46ecc02aa6694c27fff8da7b Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Fri, 31 Jul 2026 20:25:12 +0000 Subject: [PATCH 07/25] Expose versioned agent run metadata --- src/runtime/operator/convert.py | 42 +++- src/runtime/operator/models.py | 30 +-- src/runtime/operator/operator.py | 79 ++++++++ src/runtime/operator/proto/operator.proto | 14 ++ src/runtime/operator/proto/operator_pb2.py | 150 +++++++------- src/runtime/operator/proto/operator_pb2.pyi | 39 +++- src/runtime/operator/registry.py | 43 ++-- src/runtime/operator/run_worker.py | 2 + .../web_assets/assets/index-BBkdXJIH.js | 9 - ...{index-BADaCtIl.css => index-BqN1_lQb.css} | 2 +- .../web_assets/assets/index-mLerAYW4.js | 9 + src/runtime/operator/web_assets/index.html | 4 +- test/operator_tests/test_operator.py | 17 ++ test/operator_tests/test_protocol_contract.py | 12 ++ web/operator/src/GraphCanvas.tsx | 1 + web/operator/src/Inspector.test.tsx | 153 +++++++++++++++ web/operator/src/Inspector.tsx | 52 ++++- web/operator/src/generated/operator.ts | 183 +++++++++++++++++- web/operator/src/styles.css | 4 + 19 files changed, 718 insertions(+), 127 deletions(-) delete mode 100644 src/runtime/operator/web_assets/assets/index-BBkdXJIH.js rename src/runtime/operator/web_assets/assets/{index-BADaCtIl.css => index-BqN1_lQb.css} (83%) create mode 100644 src/runtime/operator/web_assets/assets/index-mLerAYW4.js create mode 100644 web/operator/src/Inspector.test.tsx diff --git a/src/runtime/operator/convert.py b/src/runtime/operator/convert.py index 6993e71..4a19b31 100644 --- a/src/runtime/operator/convert.py +++ b/src/runtime/operator/convert.py @@ -26,6 +26,7 @@ ScanTargetInfo, TraceDescriptor, TraceFinalized, + TraceHeader, WorkflowDiscoveryDiagnostic, WorkflowInfo, WorkflowTopology, @@ -155,6 +156,7 @@ def workflow_topology_to_proto(topology: WorkflowTopology) -> pb.WorkflowTopolog graph={parent: pb.NodeEdges(children=children) for parent, children in topology.graph}, node_types=dict(topology.node_types), display_names=dict(topology.display_names), + agent_metadata_json=dict(topology.agent_metadata_json), ) @@ -165,11 +167,45 @@ def workflow_topology_from_proto(msg: pb.WorkflowTopologyMsg) -> WorkflowTopolog graph=tuple((node_id, tuple(msg.graph[node_id].children)) for node_id in node_ids), node_types=tuple((node_id, msg.node_types[node_id]) for node_id in node_ids), display_names=tuple((node_id, msg.display_names[node_id]) for node_id in node_ids), + agent_metadata_json=tuple( + (node_id, msg.agent_metadata_json[node_id]) + for node_id in node_ids + if node_id in msg.agent_metadata_json + ), + ) + + +def trace_header_to_proto(header: TraceHeader) -> pb.TraceHeaderMsg: + message = pb.TraceHeaderMsg( + status=header.status, + model=header.model, + iterations=header.iterations, + max_iterations=header.max_iterations, + duration_ms=header.duration_ms, + usage_json=header.usage_json, + ) + if header.sub_model is not None: + message.sub_model = header.sub_model + if header.telemetry_json is not None: + message.telemetry_json = header.telemetry_json + return message + + +def trace_header_from_proto(msg: pb.TraceHeaderMsg) -> TraceHeader: + return TraceHeader( + status=msg.status, + model=msg.model, + sub_model=msg.sub_model if msg.HasField("sub_model") else None, + iterations=msg.iterations, + max_iterations=msg.max_iterations, + duration_ms=msg.duration_ms, + usage_json=msg.usage_json, + telemetry_json=msg.telemetry_json if msg.HasField("telemetry_json") else None, ) def trace_descriptor_to_proto(descriptor: TraceDescriptor) -> pb.TraceDescriptorMsg: - return pb.TraceDescriptorMsg( + message = pb.TraceDescriptorMsg( status=descriptor.status, revision=descriptor.revision, available=descriptor.available, @@ -178,6 +214,9 @@ def trace_descriptor_to_proto(descriptor: TraceDescriptor) -> pb.TraceDescriptor size_bytes=descriptor.size_bytes, latest_event_sequence=descriptor.latest_event_sequence, ) + if descriptor.header is not None: + message.header.CopyFrom(trace_header_to_proto(descriptor.header)) + return message def trace_descriptor_from_proto(msg: pb.TraceDescriptorMsg) -> TraceDescriptor: @@ -189,6 +228,7 @@ def trace_descriptor_from_proto(msg: pb.TraceDescriptorMsg) -> TraceDescriptor: event_count=msg.event_count, size_bytes=msg.size_bytes, latest_event_sequence=msg.latest_event_sequence, + header=trace_header_from_proto(msg.header) if msg.HasField("header") else None, ) diff --git a/src/runtime/operator/models.py b/src/runtime/operator/models.py index 1068318..fcafead 100644 --- a/src/runtime/operator/models.py +++ b/src/runtime/operator/models.py @@ -49,6 +49,7 @@ class WorkflowTopology: graph: tuple[tuple[str, tuple[str, ...]], ...] = () node_types: tuple[tuple[str, str], ...] = () display_names: tuple[tuple[str, str], ...] = () + agent_metadata_json: tuple[tuple[str, str], ...] = () @dataclass @@ -100,6 +101,20 @@ def elapsed(self) -> float | None: return end - self.started_at +@dataclass(frozen=True) +class TraceHeader: + """RunTrace metadata retained separately from iteration and evidence bodies.""" + + status: str + model: str + sub_model: str | None + iterations: int + max_iterations: int + duration_ms: int + usage_json: str + telemetry_json: str | None = None + + @dataclass(frozen=True) class TraceDescriptor: """Location metadata for agent detail stored outside structural run state.""" @@ -111,6 +126,7 @@ class TraceDescriptor: event_count: int = 0 size_bytes: int = 0 latest_event_sequence: int = 0 + header: TraceHeader | None = None @dataclass(frozen=True) @@ -290,20 +306,6 @@ class FinalizedTrace: data: bytes -@dataclass(frozen=True) -class TraceHeader: - """RunTrace metadata retained separately from iteration and evidence bodies.""" - - status: str - model: str - sub_model: str | None - iterations: int - max_iterations: int - duration_ms: int - usage_json: str - telemetry_json: str | None = None - - @dataclass(frozen=True) class ScanTargetInfo: """One normalized workflow discovery target exposed to clients.""" diff --git a/src/runtime/operator/operator.py b/src/runtime/operator/operator.py index 0219c1a..2ed1d7a 100644 --- a/src/runtime/operator/operator.py +++ b/src/runtime/operator/operator.py @@ -60,6 +60,7 @@ SequencedLogEntry, TraceDescriptor, TraceFinalized, + TraceHeader, WorkflowInfo, WorkflowTopology, ) @@ -1405,6 +1406,11 @@ def _run_from_prepared( display_names=tuple( (node_id, prepared["display_names"][node_id]) for node_id in node_ids ), + agent_metadata_json=tuple( + (node_id, prepared["agent_metadata_json"][node_id]) + for node_id in node_ids + if node_id in prepared["agent_metadata_json"] + ), ) run = RunState( run_id=run_id, @@ -1803,6 +1809,7 @@ def _record_agent_evidence_event_locked( if not isinstance(trace, dict): return None _validate_agent_detail_depth(trace) + header = _trace_header_from_payload(trace) trace_header = { name: value for name, value in trace.items() @@ -1841,6 +1848,7 @@ def _record_agent_evidence_event_locked( latest_event_sequence=( projected_events[-1].event_sequence if projected_events else 0 ), + header=header, ) message = f"Agent trace {status}" if status == "error": @@ -2607,6 +2615,68 @@ def walk(item: object, depth: int) -> None: walk(value, 0) +def _trace_header_from_payload(trace: dict[str, Any]) -> TraceHeader | None: + """Validate the stable PredictRLM RunTrace header at the coordinator boundary.""" + if "model" not in trace: + return None + + status = trace.get("status") + if type(status) is not str or not status or len(status) > _MAX_EVENT_FIELD_LENGTH: + raise _CoordinatorProtocolError( + "agent trace header field 'status' must be a non-empty bounded string" + ) + model = trace.get("model") + if type(model) is not str or not model or len(model) > _MAX_EVENT_FIELD_LENGTH: + raise _CoordinatorProtocolError( + "agent trace header field 'model' must be a non-empty bounded string" + ) + sub_model = trace.get("sub_model") + if sub_model is not None and ( + type(sub_model) is not str or len(sub_model) > _MAX_EVENT_FIELD_LENGTH + ): + raise _CoordinatorProtocolError( + "agent trace header field 'sub_model' must be a bounded string or null" + ) + + iterations = trace.get("iterations") + if type(iterations) is not int or iterations < 0: + raise _CoordinatorProtocolError( + "agent trace header field 'iterations' must be a non-negative integer" + ) + max_iterations = trace.get("max_iterations") + if type(max_iterations) is not int or max_iterations < 0: + raise _CoordinatorProtocolError( + "agent trace header field 'max_iterations' must be a non-negative integer" + ) + duration_ms = trace.get("duration_ms") + if type(duration_ms) is not int or duration_ms < 0: + raise _CoordinatorProtocolError( + "agent trace header field 'duration_ms' must be a non-negative integer" + ) + + usage = trace.get("usage") + if not isinstance(usage, dict): + raise _CoordinatorProtocolError("agent trace header field 'usage' must be an object") + telemetry = trace.get("telemetry_ref") + if telemetry is not None and not isinstance(telemetry, dict): + raise _CoordinatorProtocolError( + "agent trace header field 'telemetry_ref' must be an object or null" + ) + + return TraceHeader( + status=status, + model=model, + sub_model=sub_model, + iterations=iterations, + max_iterations=max_iterations, + duration_ms=duration_ms, + usage_json=json.dumps(usage, separators=(",", ":")), + telemetry_json=( + json.dumps(telemetry, separators=(",", ":")) if telemetry is not None else None + ), + ) + + def _validate_preparation_event(event: object) -> str: event_type = _event_type(event) if event_type == "prepared": @@ -2619,6 +2689,7 @@ def _validate_preparation_event(event: object) -> str: "node_types", "display_names", "display_name", + "agent_metadata_json", }, ) node_ids = _required_field(event, "node_ids") @@ -2636,6 +2707,7 @@ def _validate_preparation_event(event: object) -> str: _graph_mapping(event, "graph") node_types = _string_mapping(event, "node_types") display_names = _string_mapping(event, "display_names") + agent_metadata_json = _string_mapping(event, "agent_metadata_json") for node_id in node_ids: if node_id not in node_types: raise _CoordinatorProtocolError( @@ -2645,6 +2717,13 @@ def _validate_preparation_event(event: object) -> str: raise _CoordinatorProtocolError( f"field 'display_names' is missing node {_bounded_ascii(node_id)}" ) + unknown_agent_nodes = set(agent_metadata_json).difference(node_ids) + if unknown_agent_nodes: + unknown = min(unknown_agent_nodes) + raise _CoordinatorProtocolError( + f"field 'agent_metadata_json' references unknown node " + f"{_bounded_ascii(unknown)}" + ) display_name = event.get("display_name") if display_name is not None and ( type(display_name) is not str or len(display_name) > _MAX_EVENT_FIELD_LENGTH diff --git a/src/runtime/operator/proto/operator.proto b/src/runtime/operator/proto/operator.proto index d77409e..f79c193 100644 --- a/src/runtime/operator/proto/operator.proto +++ b/src/runtime/operator/proto/operator.proto @@ -114,6 +114,7 @@ message WorkflowTopologyMsg { map graph = 2; map node_types = 3; map display_names = 4; + map agent_metadata_json = 5; } message FlowInfoMsg { @@ -185,6 +186,18 @@ message RunSummaryMsg { uint64 revision = 10; } +message TraceHeaderMsg { + string status = 1; + string model = 2; + optional string sub_model = 3; + uint64 iterations = 4; + uint64 max_iterations = 5; + uint64 duration_ms = 6; + string usage_json = 7; + optional string telemetry_json = 8; +} + + message TraceDescriptorMsg { string status = 1; uint64 revision = 2; @@ -193,6 +206,7 @@ message TraceDescriptorMsg { uint64 event_count = 5; uint64 size_bytes = 6; uint64 latest_event_sequence = 7; + TraceHeaderMsg header = 8; } message NodeSnapshotMsg { diff --git a/src/runtime/operator/proto/operator_pb2.py b/src/runtime/operator/proto/operator_pb2.py index f29d212..d2cff4b 100644 --- a/src/runtime/operator/proto/operator_pb2.py +++ b/src/runtime/operator/proto/operator_pb2.py @@ -24,7 +24,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eoperator.proto\x12\x12\x61valanche.operator\"\x07\n\x05\x45mpty\"\xb2\x01\n\x0fStartRunRequest\x12\x11\n\tflow_name\x18\x01 \x01(\t\x12\x12\n\ninput_json\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_json\x18\x03 \x01(\t\x12\x37\n\x0binput_files\x18\x04 \x03(\x0b\x32\".avalanche.operator.FileAttachment\x12\x0e\n\x06run_id\x18\x06 \x01(\t\x12\x19\n\x11workflow_selector\x18\x07 \x01(\t\"i\n\x0e\x46ileAttachment\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x04 \x01(\t\x12\x0e\n\x06sha256\x18\x05 \x01(\t\"\"\n\x10StartRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\"\n\x10\x43\x61ncelRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"[\n\x17ListRunSummariesRequest\x12\x19\n\x11workflow_selector\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x12\n\npage_token\x18\x03 \x01(\t\"]\n\x15GetRunSnapshotRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x1c\n\x14operator_instance_id\x18\x02 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x03 \x01(\x04\"P\n\x0fListLogsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"]\n\x16ListAgentEventsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x1c\n\x14\x61\x66ter_event_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"c\n\x10ReadTraceRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x1c\n\x14operator_instance_id\x18\x04 \x01(\t\"\'\n\x11ReadDetailRequest\x12\x12\n\nbody_token\x18\x01 \x01(\t\"T\n\x1cStreamOperatorUpdatesRequest\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\"\x1d\n\tNodeEdges\x12\x10\n\x08\x63hildren\x18\x01 \x03(\t\"\xbc\x03\n\x13WorkflowTopologyMsg\x12\x10\n\x08node_ids\x18\x01 \x03(\t\x12\x41\n\x05graph\x18\x02 \x03(\x0b\x32\x32.avalanche.operator.WorkflowTopologyMsg.GraphEntry\x12J\n\nnode_types\x18\x03 \x03(\x0b\x32\x36.avalanche.operator.WorkflowTopologyMsg.NodeTypesEntry\x12P\n\rdisplay_names\x18\x04 \x03(\x0b\x32\x39.avalanche.operator.WorkflowTopologyMsg.DisplayNamesEntry\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcd\x06\n\x0b\x46lowInfoMsg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x10\n\x08node_ids\x18\x03 \x03(\t\x12\x39\n\x05graph\x18\x04 \x03(\x0b\x32*.avalanche.operator.FlowInfoMsg.GraphEntry\x12\x42\n\nnode_types\x18\x05 \x03(\x0b\x32..avalanche.operator.FlowInfoMsg.NodeTypesEntry\x12H\n\rdisplay_names\x18\x06 \x03(\x0b\x32\x31.avalanche.operator.FlowInfoMsg.DisplayNamesEntry\x12\x0c\n\x04\x63ron\x18\x07 \x01(\t\x12\x13\n\x0bnext_run_at\x18\x08 \x01(\x01\x12\x13\n\x0blast_run_at\x18\t \x01(\x01\x12\x13\n\x0bworkflow_id\x18\n \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x12\x12\n\nroot_alias\x18\x0c \x01(\t\x12\x15\n\rrelative_file\x18\r \x01(\t\x12\x16\n\x0e\x62uilder_symbol\x18\x0e \x01(\t\x12\x16\n\x0e\x61gent_node_ids\x18\x0f \x03(\t\x12S\n\x13\x61gent_metadata_json\x18\x10 \x03(\x0b\x32\x36.avalanche.operator.FlowInfoMsg.AgentMetadataJsonEntry\x12\x14\n\x0cwebhook_path\x18\x11 \x01(\t\x12\x13\n\x0bwebhook_url\x18\x12 \x01(\t\x12\x16\n\x0ewebhook_active\x18\x13 \x01(\x08\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x16\x44iscoveryDiagnosticMsg\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\"A\n\rScanTargetMsg\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12\x13\n\x0btarget_path\x18\x02 \x01(\t\x12\x0c\n\x04kind\x18\x03 \x01(\t\"\x8a\x02\n\x12\x43\x61talogSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x32\n\tworkflows\x18\x04 \x03(\x0b\x32\x1f.avalanche.operator.FlowInfoMsg\x12\x37\n\x0cscan_targets\x18\x05 \x03(\x0b\x32!.avalanche.operator.ScanTargetMsg\x12?\n\x0b\x64iagnostics\x18\x06 \x03(\x0b\x32*.avalanche.operator.DiscoveryDiagnosticMsg\"\x92\x01\n\x14ResultFileAttachment\x12\x15\n\rattachment_id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x17\n\nmedia_type\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06sha256\x18\x05 \x01(\tB\x07\n\x05_nameB\r\n\x0b_media_type\"[\n\x0cRunResultMsg\x12\x12\n\nvalue_json\x18\x01 \x01(\t\x12\x37\n\x05\x66iles\x18\x02 \x03(\x0b\x32(.avalanche.operator.ResultFileAttachment\"\xde\x01\n\rRunSummaryMsg\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x11\n\tflow_name\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x14\n\x0ctriggered_by\x18\x06 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12\x1d\n\x15workflow_display_name\x18\x08 \x01(\t\x12\x18\n\x10\x63reated_sequence\x18\t \x01(\x04\x12\x10\n\x08revision\x18\n \x01(\x04\"\xa3\x01\n\x12TraceDescriptorMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\x04\x12\x11\n\tavailable\x18\x03 \x01(\x08\x12\x10\n\x08\x63omplete\x18\x04 \x01(\x08\x12\x13\n\x0b\x65vent_count\x18\x05 \x01(\x04\x12\x12\n\nsize_bytes\x18\x06 \x01(\x04\x12\x1d\n\x15latest_event_sequence\x18\x07 \x01(\x04\"\xfa\x01\n\x0fNodeSnapshotMsg\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tnode_type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12\x12\n\nstarted_at\x18\x05 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x06 \x01(\x01\x12\x35\n\x05trace\x18\x07 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\x12\x10\n\x08revision\x18\x08 \x01(\x04\x12\x18\n\x10\x65vent_page_token\x18\t \x01(\t\x12\x12\n\x05\x65rror\x18\n \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x9e\x02\n\x0eRunSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x32\n\x07summary\x18\x03 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x04 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x1b\n\x13latest_log_sequence\x18\x05 \x01(\x04\x12\x16\n\x0elog_page_token\x18\x06 \x01(\t\x12\x39\n\x08topology\x18\x07 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"\x90\x01\n\x0eRunSummaryPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12/\n\x04runs\x18\x03 \x03(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x85\x01\n\x16LogRecordDescriptorMsg\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x02 \x01(\x01\x12\r\n\x05level\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12\x12\n\nsize_bytes\x18\x05 \x01(\x04\x12\x12\n\nbody_token\x18\x06 \x01(\t\"\x92\x01\n\x07LogPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x38\n\x04logs\x18\x03 \x03(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x8e\x02\n\x17\x41gentEventDescriptorMsg\x12\x16\n\x0e\x65vent_sequence\x18\x01 \x01(\x04\x12\x12\n\nsize_bytes\x18\x02 \x01(\x04\x12\x12\n\nbody_token\x18\x03 \x01(\t\x12\x15\n\rinvocation_id\x18\x04 \x01(\t\x12\x12\n\nevent_kind\x18\x05 \x01(\t\x12\x16\n\titeration\x18\x06 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64uration_ms\x18\x07 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x65rror\x18\x08 \x01(\x08\x12\x12\n\ntool_count\x18\t \x01(\r\x12\x15\n\rpredict_count\x18\n \x01(\rB\x0c\n\n_iterationB\x0e\n\x0c_duration_ms\"\xbd\x01\n\x0e\x41gentEventPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12;\n\x06\x65vents\x18\x05 \x03(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\"N\n\nTraceChunk\x12\x10\n\x08revision\x18\x01 \x01(\x04\x12\x13\n\x0b\x63hunk_index\x18\x02 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x04 \x01(\x08\"=\n\x0b\x44\x65tailChunk\x12\x13\n\x0b\x63hunk_index\x18\x01 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x03 \x01(\x08\"\xaf\x01\n\nRunCreated\x12\x32\n\x07summary\x18\x01 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x02 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x39\n\x08topology\x18\x03 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"j\n\x10RunStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nstarted_at\x18\x03 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x04 \x01(\x01\x12\x10\n\x08revision\x18\x05 \x01(\x04\"\x9a\x01\n\x11NodeStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x10\n\x08revision\x18\x06 \x01(\x04\x12\x12\n\x05\x65rror\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"V\n\x0bLogAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x37\n\x03log\x18\x02 \x01(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\"q\n\x12\x41gentEventAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12:\n\x05\x65vent\x18\x03 \x01(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\"h\n\x0eTraceFinalized\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x35\n\x05trace\x18\x03 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\"J\n\x0f\x43\x61talogReplaced\x12\x37\n\x07\x63\x61talog\x18\x01 \x01(\x0b\x32&.avalanche.operator.CatalogSnapshotMsg\"\xee\x03\n\x0eOperatorUpdate\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x35\n\x0brun_created\x18\x02 \x01(\x0b\x32\x1e.avalanche.operator.RunCreatedH\x00\x12\x42\n\x12run_status_changed\x18\x03 \x01(\x0b\x32$.avalanche.operator.RunStatusChangedH\x00\x12\x44\n\x13node_status_changed\x18\x04 \x01(\x0b\x32%.avalanche.operator.NodeStatusChangedH\x00\x12\x37\n\x0clog_appended\x18\x05 \x01(\x0b\x32\x1f.avalanche.operator.LogAppendedH\x00\x12\x46\n\x14\x61gent_event_appended\x18\x06 \x01(\x0b\x32&.avalanche.operator.AgentEventAppendedH\x00\x12=\n\x0ftrace_finalized\x18\x07 \x01(\x0b\x32\".avalanche.operator.TraceFinalizedH\x00\x12?\n\x10\x63\x61talog_replaced\x18\x08 \x01(\x0b\x32#.avalanche.operator.CatalogReplacedH\x00\x42\x08\n\x06\x63hange\"?\n\rResetRequired\x12\x15\n\rhistory_floor\x18\x01 \x01(\x04\x12\x17\n\x0flatest_sequence\x18\x02 \x01(\x04\"\xb4\x01\n\x16OperatorUpdateEnvelope\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x34\n\x06update\x18\x02 \x01(\x0b\x32\".avalanche.operator.OperatorUpdateH\x00\x12;\n\x0ereset_required\x18\x03 \x01(\x0b\x32!.avalanche.operator.ResetRequiredH\x00\x42\t\n\x07payload2\xf9\x07\n\x0fOperatorService\x12O\n\nGetCatalog\x12\x19.avalanche.operator.Empty\x1a&.avalanche.operator.CatalogSnapshotMsg\x12U\n\x08StartRun\x12#.avalanche.operator.StartRunRequest\x1a$.avalanche.operator.StartRunResponse\x12L\n\tCancelRun\x12$.avalanche.operator.CancelRunRequest\x1a\x19.avalanche.operator.Empty\x12S\n\x0cGetRunResult\x12!.avalanche.operator.GetRunRequest\x1a .avalanche.operator.RunResultMsg\x12\x63\n\x10ListRunSummaries\x12+.avalanche.operator.ListRunSummariesRequest\x1a\".avalanche.operator.RunSummaryPage\x12_\n\x0eGetRunSnapshot\x12).avalanche.operator.GetRunSnapshotRequest\x1a\".avalanche.operator.RunSnapshotMsg\x12L\n\x08ListLogs\x12#.avalanche.operator.ListLogsRequest\x1a\x1b.avalanche.operator.LogPage\x12\x61\n\x0fListAgentEvents\x12*.avalanche.operator.ListAgentEventsRequest\x1a\".avalanche.operator.AgentEventPage\x12S\n\tReadTrace\x12$.avalanche.operator.ReadTraceRequest\x1a\x1e.avalanche.operator.TraceChunk0\x01\x12V\n\nReadDetail\x12%.avalanche.operator.ReadDetailRequest\x1a\x1f.avalanche.operator.DetailChunk0\x01\x12w\n\x15StreamOperatorUpdates\x12\x30.avalanche.operator.StreamOperatorUpdatesRequest\x1a*.avalanche.operator.OperatorUpdateEnvelope0\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eoperator.proto\x12\x12\x61valanche.operator\"\x07\n\x05\x45mpty\"\xb2\x01\n\x0fStartRunRequest\x12\x11\n\tflow_name\x18\x01 \x01(\t\x12\x12\n\ninput_json\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_json\x18\x03 \x01(\t\x12\x37\n\x0binput_files\x18\x04 \x03(\x0b\x32\".avalanche.operator.FileAttachment\x12\x0e\n\x06run_id\x18\x06 \x01(\t\x12\x19\n\x11workflow_selector\x18\x07 \x01(\t\"i\n\x0e\x46ileAttachment\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x04 \x01(\t\x12\x0e\n\x06sha256\x18\x05 \x01(\t\"\"\n\x10StartRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\"\n\x10\x43\x61ncelRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"[\n\x17ListRunSummariesRequest\x12\x19\n\x11workflow_selector\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x12\n\npage_token\x18\x03 \x01(\t\"]\n\x15GetRunSnapshotRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x1c\n\x14operator_instance_id\x18\x02 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x03 \x01(\x04\"P\n\x0fListLogsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"]\n\x16ListAgentEventsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x1c\n\x14\x61\x66ter_event_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"c\n\x10ReadTraceRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x1c\n\x14operator_instance_id\x18\x04 \x01(\t\"\'\n\x11ReadDetailRequest\x12\x12\n\nbody_token\x18\x01 \x01(\t\"T\n\x1cStreamOperatorUpdatesRequest\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\"\x1d\n\tNodeEdges\x12\x10\n\x08\x63hildren\x18\x01 \x03(\t\"\xd3\x04\n\x13WorkflowTopologyMsg\x12\x10\n\x08node_ids\x18\x01 \x03(\t\x12\x41\n\x05graph\x18\x02 \x03(\x0b\x32\x32.avalanche.operator.WorkflowTopologyMsg.GraphEntry\x12J\n\nnode_types\x18\x03 \x03(\x0b\x32\x36.avalanche.operator.WorkflowTopologyMsg.NodeTypesEntry\x12P\n\rdisplay_names\x18\x04 \x03(\x0b\x32\x39.avalanche.operator.WorkflowTopologyMsg.DisplayNamesEntry\x12[\n\x13\x61gent_metadata_json\x18\x05 \x03(\x0b\x32>.avalanche.operator.WorkflowTopologyMsg.AgentMetadataJsonEntry\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcd\x06\n\x0b\x46lowInfoMsg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x10\n\x08node_ids\x18\x03 \x03(\t\x12\x39\n\x05graph\x18\x04 \x03(\x0b\x32*.avalanche.operator.FlowInfoMsg.GraphEntry\x12\x42\n\nnode_types\x18\x05 \x03(\x0b\x32..avalanche.operator.FlowInfoMsg.NodeTypesEntry\x12H\n\rdisplay_names\x18\x06 \x03(\x0b\x32\x31.avalanche.operator.FlowInfoMsg.DisplayNamesEntry\x12\x0c\n\x04\x63ron\x18\x07 \x01(\t\x12\x13\n\x0bnext_run_at\x18\x08 \x01(\x01\x12\x13\n\x0blast_run_at\x18\t \x01(\x01\x12\x13\n\x0bworkflow_id\x18\n \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x12\x12\n\nroot_alias\x18\x0c \x01(\t\x12\x15\n\rrelative_file\x18\r \x01(\t\x12\x16\n\x0e\x62uilder_symbol\x18\x0e \x01(\t\x12\x16\n\x0e\x61gent_node_ids\x18\x0f \x03(\t\x12S\n\x13\x61gent_metadata_json\x18\x10 \x03(\x0b\x32\x36.avalanche.operator.FlowInfoMsg.AgentMetadataJsonEntry\x12\x14\n\x0cwebhook_path\x18\x11 \x01(\t\x12\x13\n\x0bwebhook_url\x18\x12 \x01(\t\x12\x16\n\x0ewebhook_active\x18\x13 \x01(\x08\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x16\x44iscoveryDiagnosticMsg\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\"A\n\rScanTargetMsg\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12\x13\n\x0btarget_path\x18\x02 \x01(\t\x12\x0c\n\x04kind\x18\x03 \x01(\t\"\x8a\x02\n\x12\x43\x61talogSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x32\n\tworkflows\x18\x04 \x03(\x0b\x32\x1f.avalanche.operator.FlowInfoMsg\x12\x37\n\x0cscan_targets\x18\x05 \x03(\x0b\x32!.avalanche.operator.ScanTargetMsg\x12?\n\x0b\x64iagnostics\x18\x06 \x03(\x0b\x32*.avalanche.operator.DiscoveryDiagnosticMsg\"\x92\x01\n\x14ResultFileAttachment\x12\x15\n\rattachment_id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x17\n\nmedia_type\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06sha256\x18\x05 \x01(\tB\x07\n\x05_nameB\r\n\x0b_media_type\"[\n\x0cRunResultMsg\x12\x12\n\nvalue_json\x18\x01 \x01(\t\x12\x37\n\x05\x66iles\x18\x02 \x03(\x0b\x32(.avalanche.operator.ResultFileAttachment\"\xde\x01\n\rRunSummaryMsg\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x11\n\tflow_name\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x14\n\x0ctriggered_by\x18\x06 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12\x1d\n\x15workflow_display_name\x18\x08 \x01(\t\x12\x18\n\x10\x63reated_sequence\x18\t \x01(\x04\x12\x10\n\x08revision\x18\n \x01(\x04\"\xda\x01\n\x0eTraceHeaderMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x16\n\tsub_model\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\niterations\x18\x04 \x01(\x04\x12\x16\n\x0emax_iterations\x18\x05 \x01(\x04\x12\x13\n\x0b\x64uration_ms\x18\x06 \x01(\x04\x12\x12\n\nusage_json\x18\x07 \x01(\t\x12\x1b\n\x0etelemetry_json\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\x0c\n\n_sub_modelB\x11\n\x0f_telemetry_json\"\xd7\x01\n\x12TraceDescriptorMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\x04\x12\x11\n\tavailable\x18\x03 \x01(\x08\x12\x10\n\x08\x63omplete\x18\x04 \x01(\x08\x12\x13\n\x0b\x65vent_count\x18\x05 \x01(\x04\x12\x12\n\nsize_bytes\x18\x06 \x01(\x04\x12\x1d\n\x15latest_event_sequence\x18\x07 \x01(\x04\x12\x32\n\x06header\x18\x08 \x01(\x0b\x32\".avalanche.operator.TraceHeaderMsg\"\xfa\x01\n\x0fNodeSnapshotMsg\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tnode_type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12\x12\n\nstarted_at\x18\x05 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x06 \x01(\x01\x12\x35\n\x05trace\x18\x07 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\x12\x10\n\x08revision\x18\x08 \x01(\x04\x12\x18\n\x10\x65vent_page_token\x18\t \x01(\t\x12\x12\n\x05\x65rror\x18\n \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x9e\x02\n\x0eRunSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x32\n\x07summary\x18\x03 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x04 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x1b\n\x13latest_log_sequence\x18\x05 \x01(\x04\x12\x16\n\x0elog_page_token\x18\x06 \x01(\t\x12\x39\n\x08topology\x18\x07 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"\x90\x01\n\x0eRunSummaryPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12/\n\x04runs\x18\x03 \x03(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x85\x01\n\x16LogRecordDescriptorMsg\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x02 \x01(\x01\x12\r\n\x05level\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12\x12\n\nsize_bytes\x18\x05 \x01(\x04\x12\x12\n\nbody_token\x18\x06 \x01(\t\"\x92\x01\n\x07LogPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x38\n\x04logs\x18\x03 \x03(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x8e\x02\n\x17\x41gentEventDescriptorMsg\x12\x16\n\x0e\x65vent_sequence\x18\x01 \x01(\x04\x12\x12\n\nsize_bytes\x18\x02 \x01(\x04\x12\x12\n\nbody_token\x18\x03 \x01(\t\x12\x15\n\rinvocation_id\x18\x04 \x01(\t\x12\x12\n\nevent_kind\x18\x05 \x01(\t\x12\x16\n\titeration\x18\x06 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64uration_ms\x18\x07 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x65rror\x18\x08 \x01(\x08\x12\x12\n\ntool_count\x18\t \x01(\r\x12\x15\n\rpredict_count\x18\n \x01(\rB\x0c\n\n_iterationB\x0e\n\x0c_duration_ms\"\xbd\x01\n\x0e\x41gentEventPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12;\n\x06\x65vents\x18\x05 \x03(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\"N\n\nTraceChunk\x12\x10\n\x08revision\x18\x01 \x01(\x04\x12\x13\n\x0b\x63hunk_index\x18\x02 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x04 \x01(\x08\"=\n\x0b\x44\x65tailChunk\x12\x13\n\x0b\x63hunk_index\x18\x01 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x03 \x01(\x08\"\xaf\x01\n\nRunCreated\x12\x32\n\x07summary\x18\x01 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x02 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x39\n\x08topology\x18\x03 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"j\n\x10RunStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nstarted_at\x18\x03 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x04 \x01(\x01\x12\x10\n\x08revision\x18\x05 \x01(\x04\"\x9a\x01\n\x11NodeStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x10\n\x08revision\x18\x06 \x01(\x04\x12\x12\n\x05\x65rror\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"V\n\x0bLogAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x37\n\x03log\x18\x02 \x01(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\"q\n\x12\x41gentEventAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12:\n\x05\x65vent\x18\x03 \x01(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\"h\n\x0eTraceFinalized\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x35\n\x05trace\x18\x03 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\"J\n\x0f\x43\x61talogReplaced\x12\x37\n\x07\x63\x61talog\x18\x01 \x01(\x0b\x32&.avalanche.operator.CatalogSnapshotMsg\"\xee\x03\n\x0eOperatorUpdate\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x35\n\x0brun_created\x18\x02 \x01(\x0b\x32\x1e.avalanche.operator.RunCreatedH\x00\x12\x42\n\x12run_status_changed\x18\x03 \x01(\x0b\x32$.avalanche.operator.RunStatusChangedH\x00\x12\x44\n\x13node_status_changed\x18\x04 \x01(\x0b\x32%.avalanche.operator.NodeStatusChangedH\x00\x12\x37\n\x0clog_appended\x18\x05 \x01(\x0b\x32\x1f.avalanche.operator.LogAppendedH\x00\x12\x46\n\x14\x61gent_event_appended\x18\x06 \x01(\x0b\x32&.avalanche.operator.AgentEventAppendedH\x00\x12=\n\x0ftrace_finalized\x18\x07 \x01(\x0b\x32\".avalanche.operator.TraceFinalizedH\x00\x12?\n\x10\x63\x61talog_replaced\x18\x08 \x01(\x0b\x32#.avalanche.operator.CatalogReplacedH\x00\x42\x08\n\x06\x63hange\"?\n\rResetRequired\x12\x15\n\rhistory_floor\x18\x01 \x01(\x04\x12\x17\n\x0flatest_sequence\x18\x02 \x01(\x04\"\xb4\x01\n\x16OperatorUpdateEnvelope\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x34\n\x06update\x18\x02 \x01(\x0b\x32\".avalanche.operator.OperatorUpdateH\x00\x12;\n\x0ereset_required\x18\x03 \x01(\x0b\x32!.avalanche.operator.ResetRequiredH\x00\x42\t\n\x07payload2\xf9\x07\n\x0fOperatorService\x12O\n\nGetCatalog\x12\x19.avalanche.operator.Empty\x1a&.avalanche.operator.CatalogSnapshotMsg\x12U\n\x08StartRun\x12#.avalanche.operator.StartRunRequest\x1a$.avalanche.operator.StartRunResponse\x12L\n\tCancelRun\x12$.avalanche.operator.CancelRunRequest\x1a\x19.avalanche.operator.Empty\x12S\n\x0cGetRunResult\x12!.avalanche.operator.GetRunRequest\x1a .avalanche.operator.RunResultMsg\x12\x63\n\x10ListRunSummaries\x12+.avalanche.operator.ListRunSummariesRequest\x1a\".avalanche.operator.RunSummaryPage\x12_\n\x0eGetRunSnapshot\x12).avalanche.operator.GetRunSnapshotRequest\x1a\".avalanche.operator.RunSnapshotMsg\x12L\n\x08ListLogs\x12#.avalanche.operator.ListLogsRequest\x1a\x1b.avalanche.operator.LogPage\x12\x61\n\x0fListAgentEvents\x12*.avalanche.operator.ListAgentEventsRequest\x1a\".avalanche.operator.AgentEventPage\x12S\n\tReadTrace\x12$.avalanche.operator.ReadTraceRequest\x1a\x1e.avalanche.operator.TraceChunk0\x01\x12V\n\nReadDetail\x12%.avalanche.operator.ReadDetailRequest\x1a\x1f.avalanche.operator.DetailChunk0\x01\x12w\n\x15StreamOperatorUpdates\x12\x30.avalanche.operator.StreamOperatorUpdatesRequest\x1a*.avalanche.operator.OperatorUpdateEnvelope0\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -37,6 +37,8 @@ _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_options = b'8\001' _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._loaded_options = None _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_options = b'8\001' + _globals['_WORKFLOWTOPOLOGYMSG_AGENTMETADATAJSONENTRY']._loaded_options = None + _globals['_WORKFLOWTOPOLOGYMSG_AGENTMETADATAJSONENTRY']._serialized_options = b'8\001' _globals['_FLOWINFOMSG_GRAPHENTRY']._loaded_options = None _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_options = b'8\001' _globals['_FLOWINFOMSG_NODETYPESENTRY']._loaded_options = None @@ -74,75 +76,79 @@ _globals['_NODEEDGES']._serialized_start=1033 _globals['_NODEEDGES']._serialized_end=1062 _globals['_WORKFLOWTOPOLOGYMSG']._serialized_start=1065 - _globals['_WORKFLOWTOPOLOGYMSG']._serialized_end=1509 - _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_start=1331 - _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_end=1406 - _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_start=1408 - _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_end=1456 - _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_start=1458 - _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_end=1509 - _globals['_FLOWINFOMSG']._serialized_start=1512 - _globals['_FLOWINFOMSG']._serialized_end=2357 - _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_start=1331 - _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_end=1406 - _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_start=1408 - _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_end=1456 - _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_start=1458 - _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_end=1509 - _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_start=2301 - _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_end=2357 - _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_start=2359 - _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_end=2428 - _globals['_SCANTARGETMSG']._serialized_start=2430 - _globals['_SCANTARGETMSG']._serialized_end=2495 - _globals['_CATALOGSNAPSHOTMSG']._serialized_start=2498 - _globals['_CATALOGSNAPSHOTMSG']._serialized_end=2764 - _globals['_RESULTFILEATTACHMENT']._serialized_start=2767 - _globals['_RESULTFILEATTACHMENT']._serialized_end=2913 - _globals['_RUNRESULTMSG']._serialized_start=2915 - _globals['_RUNRESULTMSG']._serialized_end=3006 - _globals['_RUNSUMMARYMSG']._serialized_start=3009 - _globals['_RUNSUMMARYMSG']._serialized_end=3231 - _globals['_TRACEDESCRIPTORMSG']._serialized_start=3234 - _globals['_TRACEDESCRIPTORMSG']._serialized_end=3397 - _globals['_NODESNAPSHOTMSG']._serialized_start=3400 - _globals['_NODESNAPSHOTMSG']._serialized_end=3650 - _globals['_RUNSNAPSHOTMSG']._serialized_start=3653 - _globals['_RUNSNAPSHOTMSG']._serialized_end=3939 - _globals['_RUNSUMMARYPAGE']._serialized_start=3942 - _globals['_RUNSUMMARYPAGE']._serialized_end=4086 - _globals['_LOGRECORDDESCRIPTORMSG']._serialized_start=4089 - _globals['_LOGRECORDDESCRIPTORMSG']._serialized_end=4222 - _globals['_LOGPAGE']._serialized_start=4225 - _globals['_LOGPAGE']._serialized_end=4371 - _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_start=4374 - _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_end=4644 - _globals['_AGENTEVENTPAGE']._serialized_start=4647 - _globals['_AGENTEVENTPAGE']._serialized_end=4836 - _globals['_TRACECHUNK']._serialized_start=4838 - _globals['_TRACECHUNK']._serialized_end=4916 - _globals['_DETAILCHUNK']._serialized_start=4918 - _globals['_DETAILCHUNK']._serialized_end=4979 - _globals['_RUNCREATED']._serialized_start=4982 - _globals['_RUNCREATED']._serialized_end=5157 - _globals['_RUNSTATUSCHANGED']._serialized_start=5159 - _globals['_RUNSTATUSCHANGED']._serialized_end=5265 - _globals['_NODESTATUSCHANGED']._serialized_start=5268 - _globals['_NODESTATUSCHANGED']._serialized_end=5422 - _globals['_LOGAPPENDED']._serialized_start=5424 - _globals['_LOGAPPENDED']._serialized_end=5510 - _globals['_AGENTEVENTAPPENDED']._serialized_start=5512 - _globals['_AGENTEVENTAPPENDED']._serialized_end=5625 - _globals['_TRACEFINALIZED']._serialized_start=5627 - _globals['_TRACEFINALIZED']._serialized_end=5731 - _globals['_CATALOGREPLACED']._serialized_start=5733 - _globals['_CATALOGREPLACED']._serialized_end=5807 - _globals['_OPERATORUPDATE']._serialized_start=5810 - _globals['_OPERATORUPDATE']._serialized_end=6304 - _globals['_RESETREQUIRED']._serialized_start=6306 - _globals['_RESETREQUIRED']._serialized_end=6369 - _globals['_OPERATORUPDATEENVELOPE']._serialized_start=6372 - _globals['_OPERATORUPDATEENVELOPE']._serialized_end=6552 - _globals['_OPERATORSERVICE']._serialized_start=6555 - _globals['_OPERATORSERVICE']._serialized_end=7572 + _globals['_WORKFLOWTOPOLOGYMSG']._serialized_end=1660 + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_start=1424 + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_end=1499 + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_start=1501 + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_end=1549 + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_start=1551 + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_end=1602 + _globals['_WORKFLOWTOPOLOGYMSG_AGENTMETADATAJSONENTRY']._serialized_start=1604 + _globals['_WORKFLOWTOPOLOGYMSG_AGENTMETADATAJSONENTRY']._serialized_end=1660 + _globals['_FLOWINFOMSG']._serialized_start=1663 + _globals['_FLOWINFOMSG']._serialized_end=2508 + _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_start=1424 + _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_end=1499 + _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_start=1501 + _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_end=1549 + _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_start=1551 + _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_end=1602 + _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_start=1604 + _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_end=1660 + _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_start=2510 + _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_end=2579 + _globals['_SCANTARGETMSG']._serialized_start=2581 + _globals['_SCANTARGETMSG']._serialized_end=2646 + _globals['_CATALOGSNAPSHOTMSG']._serialized_start=2649 + _globals['_CATALOGSNAPSHOTMSG']._serialized_end=2915 + _globals['_RESULTFILEATTACHMENT']._serialized_start=2918 + _globals['_RESULTFILEATTACHMENT']._serialized_end=3064 + _globals['_RUNRESULTMSG']._serialized_start=3066 + _globals['_RUNRESULTMSG']._serialized_end=3157 + _globals['_RUNSUMMARYMSG']._serialized_start=3160 + _globals['_RUNSUMMARYMSG']._serialized_end=3382 + _globals['_TRACEHEADERMSG']._serialized_start=3385 + _globals['_TRACEHEADERMSG']._serialized_end=3603 + _globals['_TRACEDESCRIPTORMSG']._serialized_start=3606 + _globals['_TRACEDESCRIPTORMSG']._serialized_end=3821 + _globals['_NODESNAPSHOTMSG']._serialized_start=3824 + _globals['_NODESNAPSHOTMSG']._serialized_end=4074 + _globals['_RUNSNAPSHOTMSG']._serialized_start=4077 + _globals['_RUNSNAPSHOTMSG']._serialized_end=4363 + _globals['_RUNSUMMARYPAGE']._serialized_start=4366 + _globals['_RUNSUMMARYPAGE']._serialized_end=4510 + _globals['_LOGRECORDDESCRIPTORMSG']._serialized_start=4513 + _globals['_LOGRECORDDESCRIPTORMSG']._serialized_end=4646 + _globals['_LOGPAGE']._serialized_start=4649 + _globals['_LOGPAGE']._serialized_end=4795 + _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_start=4798 + _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_end=5068 + _globals['_AGENTEVENTPAGE']._serialized_start=5071 + _globals['_AGENTEVENTPAGE']._serialized_end=5260 + _globals['_TRACECHUNK']._serialized_start=5262 + _globals['_TRACECHUNK']._serialized_end=5340 + _globals['_DETAILCHUNK']._serialized_start=5342 + _globals['_DETAILCHUNK']._serialized_end=5403 + _globals['_RUNCREATED']._serialized_start=5406 + _globals['_RUNCREATED']._serialized_end=5581 + _globals['_RUNSTATUSCHANGED']._serialized_start=5583 + _globals['_RUNSTATUSCHANGED']._serialized_end=5689 + _globals['_NODESTATUSCHANGED']._serialized_start=5692 + _globals['_NODESTATUSCHANGED']._serialized_end=5846 + _globals['_LOGAPPENDED']._serialized_start=5848 + _globals['_LOGAPPENDED']._serialized_end=5934 + _globals['_AGENTEVENTAPPENDED']._serialized_start=5936 + _globals['_AGENTEVENTAPPENDED']._serialized_end=6049 + _globals['_TRACEFINALIZED']._serialized_start=6051 + _globals['_TRACEFINALIZED']._serialized_end=6155 + _globals['_CATALOGREPLACED']._serialized_start=6157 + _globals['_CATALOGREPLACED']._serialized_end=6231 + _globals['_OPERATORUPDATE']._serialized_start=6234 + _globals['_OPERATORUPDATE']._serialized_end=6728 + _globals['_RESETREQUIRED']._serialized_start=6730 + _globals['_RESETREQUIRED']._serialized_end=6793 + _globals['_OPERATORUPDATEENVELOPE']._serialized_start=6796 + _globals['_OPERATORUPDATEENVELOPE']._serialized_end=6976 + _globals['_OPERATORSERVICE']._serialized_start=6979 + _globals['_OPERATORSERVICE']._serialized_end=7996 # @@protoc_insertion_point(module_scope) diff --git a/src/runtime/operator/proto/operator_pb2.pyi b/src/runtime/operator/proto/operator_pb2.pyi index d1c48e9..d6800a1 100644 --- a/src/runtime/operator/proto/operator_pb2.pyi +++ b/src/runtime/operator/proto/operator_pb2.pyi @@ -131,7 +131,7 @@ class NodeEdges(_message.Message): def __init__(self, children: _Optional[_Iterable[str]] = ...) -> None: ... class WorkflowTopologyMsg(_message.Message): - __slots__ = ("node_ids", "graph", "node_types", "display_names") + __slots__ = ("node_ids", "graph", "node_types", "display_names", "agent_metadata_json") class GraphEntry(_message.Message): __slots__ = ("key", "value") KEY_FIELD_NUMBER: _ClassVar[int] @@ -153,15 +153,24 @@ class WorkflowTopologyMsg(_message.Message): key: str value: str def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + class AgentMetadataJsonEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: str + def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... NODE_IDS_FIELD_NUMBER: _ClassVar[int] GRAPH_FIELD_NUMBER: _ClassVar[int] NODE_TYPES_FIELD_NUMBER: _ClassVar[int] DISPLAY_NAMES_FIELD_NUMBER: _ClassVar[int] + AGENT_METADATA_JSON_FIELD_NUMBER: _ClassVar[int] node_ids: _containers.RepeatedScalarFieldContainer[str] graph: _containers.MessageMap[str, NodeEdges] node_types: _containers.ScalarMap[str, str] display_names: _containers.ScalarMap[str, str] - def __init__(self, node_ids: _Optional[_Iterable[str]] = ..., graph: _Optional[_Mapping[str, NodeEdges]] = ..., node_types: _Optional[_Mapping[str, str]] = ..., display_names: _Optional[_Mapping[str, str]] = ...) -> None: ... + agent_metadata_json: _containers.ScalarMap[str, str] + def __init__(self, node_ids: _Optional[_Iterable[str]] = ..., graph: _Optional[_Mapping[str, NodeEdges]] = ..., node_types: _Optional[_Mapping[str, str]] = ..., display_names: _Optional[_Mapping[str, str]] = ..., agent_metadata_json: _Optional[_Mapping[str, str]] = ...) -> None: ... class FlowInfoMsg(_message.Message): __slots__ = ("name", "file_path", "node_ids", "graph", "node_types", "display_names", "cron", "next_run_at", "last_run_at", "workflow_id", "display_name", "root_alias", "relative_file", "builder_symbol", "agent_node_ids", "agent_metadata_json", "webhook_path", "webhook_url", "webhook_active") @@ -315,8 +324,28 @@ class RunSummaryMsg(_message.Message): revision: int def __init__(self, run_id: _Optional[str] = ..., flow_name: _Optional[str] = ..., status: _Optional[str] = ..., started_at: _Optional[float] = ..., ended_at: _Optional[float] = ..., triggered_by: _Optional[str] = ..., workflow_id: _Optional[str] = ..., workflow_display_name: _Optional[str] = ..., created_sequence: _Optional[int] = ..., revision: _Optional[int] = ...) -> None: ... +class TraceHeaderMsg(_message.Message): + __slots__ = ("status", "model", "sub_model", "iterations", "max_iterations", "duration_ms", "usage_json", "telemetry_json") + STATUS_FIELD_NUMBER: _ClassVar[int] + MODEL_FIELD_NUMBER: _ClassVar[int] + SUB_MODEL_FIELD_NUMBER: _ClassVar[int] + ITERATIONS_FIELD_NUMBER: _ClassVar[int] + MAX_ITERATIONS_FIELD_NUMBER: _ClassVar[int] + DURATION_MS_FIELD_NUMBER: _ClassVar[int] + USAGE_JSON_FIELD_NUMBER: _ClassVar[int] + TELEMETRY_JSON_FIELD_NUMBER: _ClassVar[int] + status: str + model: str + sub_model: str + iterations: int + max_iterations: int + duration_ms: int + usage_json: str + telemetry_json: str + def __init__(self, status: _Optional[str] = ..., model: _Optional[str] = ..., sub_model: _Optional[str] = ..., iterations: _Optional[int] = ..., max_iterations: _Optional[int] = ..., duration_ms: _Optional[int] = ..., usage_json: _Optional[str] = ..., telemetry_json: _Optional[str] = ...) -> None: ... + class TraceDescriptorMsg(_message.Message): - __slots__ = ("status", "revision", "available", "complete", "event_count", "size_bytes", "latest_event_sequence") + __slots__ = ("status", "revision", "available", "complete", "event_count", "size_bytes", "latest_event_sequence", "header") STATUS_FIELD_NUMBER: _ClassVar[int] REVISION_FIELD_NUMBER: _ClassVar[int] AVAILABLE_FIELD_NUMBER: _ClassVar[int] @@ -324,6 +353,7 @@ class TraceDescriptorMsg(_message.Message): EVENT_COUNT_FIELD_NUMBER: _ClassVar[int] SIZE_BYTES_FIELD_NUMBER: _ClassVar[int] LATEST_EVENT_SEQUENCE_FIELD_NUMBER: _ClassVar[int] + HEADER_FIELD_NUMBER: _ClassVar[int] status: str revision: int available: bool @@ -331,7 +361,8 @@ class TraceDescriptorMsg(_message.Message): event_count: int size_bytes: int latest_event_sequence: int - def __init__(self, status: _Optional[str] = ..., revision: _Optional[int] = ..., available: bool = ..., complete: bool = ..., event_count: _Optional[int] = ..., size_bytes: _Optional[int] = ..., latest_event_sequence: _Optional[int] = ...) -> None: ... + header: TraceHeaderMsg + def __init__(self, status: _Optional[str] = ..., revision: _Optional[int] = ..., available: bool = ..., complete: bool = ..., event_count: _Optional[int] = ..., size_bytes: _Optional[int] = ..., latest_event_sequence: _Optional[int] = ..., header: _Optional[_Union[TraceHeaderMsg, _Mapping]] = ...) -> None: ... class NodeSnapshotMsg(_message.Message): __slots__ = ("node_id", "name", "node_type", "status", "started_at", "ended_at", "trace", "revision", "event_page_token", "error") diff --git a/src/runtime/operator/registry.py b/src/runtime/operator/registry.py index 7d6acd2..a6392e5 100644 --- a/src/runtime/operator/registry.py +++ b/src/runtime/operator/registry.py @@ -35,37 +35,42 @@ def __init__(self, selector: str, candidate_ids: tuple[str, ...]) -> None: ) -def workflow_to_info( - workflow: Workflow, - file_path: str, - *, - workflow_id: str = "", - builder_symbol: str = "", - root_alias: str = "", -) -> WorkflowInfo: - """Convert a Workflow object to the public flat compatibility model.""" - node_ids = workflow._topological_sort() - node_types = {nid: workflow.nodes[nid].node.node_type.value for nid in node_ids} - display_names = {nid: display_name_from_id(nid) for nid in node_ids} - agent_node_ids = [] - agent_metadata_json = {} - for nid in node_ids: - spec = getattr(workflow.nodes[nid].node.fn, "__agent_step__", None) +def agent_metadata_for_workflow(workflow: Workflow, node_ids: list[str]) -> dict[str, str]: + """Serialize stable agent declaration metadata for catalog and run projections.""" + metadata_by_node: dict[str, str] = {} + for node_id in node_ids: + spec = getattr(workflow.nodes[node_id].node.fn, "__agent_step__", None) if spec is None: continue - agent_node_ids.append(nid) try: metadata = spec.declaration_metadata(workflow.agent_defaults) - agent_metadata_json[nid] = json.dumps( + metadata_by_node[node_id] = json.dumps( metadata, ensure_ascii=False, separators=(",", ":"), sort_keys=True ) except Exception as exc: - agent_metadata_json[nid] = json.dumps( + metadata_by_node[node_id] = json.dumps( {"error": str(exc) or type(exc).__name__}, ensure_ascii=False, separators=(",", ":"), sort_keys=True, ) + return metadata_by_node + + +def workflow_to_info( + workflow: Workflow, + file_path: str, + *, + workflow_id: str = "", + builder_symbol: str = "", + root_alias: str = "", +) -> WorkflowInfo: + """Convert a Workflow object to the public flat compatibility model.""" + node_ids = workflow._topological_sort() + node_types = {nid: workflow.nodes[nid].node.node_type.value for nid in node_ids} + display_names = {nid: display_name_from_id(nid) for nid in node_ids} + agent_metadata_json = agent_metadata_for_workflow(workflow, node_ids) + agent_node_ids = list(agent_metadata_json) return WorkflowInfo( name=workflow.name, display_name=workflow.name, diff --git a/src/runtime/operator/run_worker.py b/src/runtime/operator/run_worker.py index 6186b02..7c4123a 100644 --- a/src/runtime/operator/run_worker.py +++ b/src/runtime/operator/run_worker.py @@ -24,6 +24,7 @@ from ..executor import Executor, LocalExecutor, RayExecutor from .hooks import RunHooks from .models import display_name_from_id +from .registry import agent_metadata_for_workflow from .result_store import ( ResultPublicationCancelledError, detach_transferred_bundle_descriptor, @@ -334,6 +335,7 @@ def _workflow_metadata(workflow: Workflow) -> dict[str, Any]: node_id: workflow.nodes[node_id].node.node_type.value for node_id in node_ids }, "display_names": {node_id: display_name_from_id(node_id) for node_id in node_ids}, + "agent_metadata_json": agent_metadata_for_workflow(workflow, node_ids), } diff --git a/src/runtime/operator/web_assets/assets/index-BBkdXJIH.js b/src/runtime/operator/web_assets/assets/index-BBkdXJIH.js deleted file mode 100644 index bb3534f..0000000 --- a/src/runtime/operator/web_assets/assets/index-BBkdXJIH.js +++ /dev/null @@ -1,9 +0,0 @@ -import{r as Dm,a as xm,b as Z,j as v,H as Xd,P as Qd,M as _m,i as jm,B as Mm,C as Rm,c as wm}from"./graph-CoDTrhFP.js";import{S as Um,M as $,r as W,U as w,W as T,s as Oe,G as Bm}from"./protobuf-BR9ifi4u.js";import{E as Ii,a as qm,j as Cm,k as Lm}from"./editor-Dh6wG2B-.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const c of f)if(c.type==="childList")for(const p of c.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function i(f){const c={};return f.integrity&&(c.integrity=f.integrity),f.referrerPolicy&&(c.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?c.credentials="include":f.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(f){if(f.ep)return;f.ep=!0;const c=i(f);fetch(f.href,c)}})();var Sc={exports:{}},xa={},Tc={exports:{}},kc={};var Kd;function Hm(){return Kd||(Kd=1,(function(y){function a(O,U){var V=O.length;O.push(U);t:for(;0>>1,St=O[gt];if(0>>1;gtf(ft,V))Btf(De,ft)?(O[gt]=De,O[Bt]=V,gt=Bt):(O[gt]=ft,O[Et]=V,gt=Et);else if(Btf(De,V))O[gt]=De,O[Bt]=V,gt=Bt;else break t}}return U}function f(O,U){var V=O.sortIndex-U.sortIndex;return V!==0?V:O.id-U.id}if(y.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;y.unstable_now=function(){return c.now()}}else{var p=Date,d=p.now();y.unstable_now=function(){return p.now()-d}}var g=[],m=[],z=1,_=null,R=3,q=!1,H=!1,G=!1,lt=!1,Q=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function rt(O){for(var U=i(m);U!==null;){if(U.callback===null)o(m);else if(U.startTime<=O)o(m),U.sortIndex=U.expirationTime,a(g,U);else break;U=i(m)}}function it(O){if(G=!1,rt(O),!H)if(i(g)!==null)H=!0,wt||(wt=!0,Ut());else{var U=i(m);U!==null&&L(it,U.startTime-O)}}var wt=!1,ut=-1,bt=5,Kt=-1;function Lt(){return lt?!0:!(y.unstable_now()-KtO&&Lt());){var gt=_.callback;if(typeof gt=="function"){_.callback=null,R=_.priorityLevel;var St=gt(_.expirationTime<=O);if(O=y.unstable_now(),typeof St=="function"){_.callback=St,rt(O),U=!0;break e}_===i(g)&&o(g),rt(O)}else o(g);_=i(g)}if(_!==null)U=!0;else{var Jt=i(m);Jt!==null&&L(it,Jt.startTime-O),U=!1}}break t}finally{_=null,R=V,q=!1}U=void 0}}finally{U?Ut():wt=!1}}}var Ut;if(typeof I=="function")Ut=function(){I(Qt)};else if(typeof MessageChannel<"u"){var Zt=new MessageChannel,he=Zt.port2;Zt.port1.onmessage=Qt,Ut=function(){he.postMessage(null)}}else Ut=function(){Q(Qt,0)};function L(O,U){ut=Q(function(){O(y.unstable_now())},U)}y.unstable_IdlePriority=5,y.unstable_ImmediatePriority=1,y.unstable_LowPriority=4,y.unstable_NormalPriority=3,y.unstable_Profiling=null,y.unstable_UserBlockingPriority=2,y.unstable_cancelCallback=function(O){O.callback=null},y.unstable_forceFrameRate=function(O){0>O||125gt?(O.sortIndex=V,a(m,O),i(g)===null&&O===i(m)&&(G?(K(ut),ut=-1):G=!0,L(it,V-gt))):(O.sortIndex=St,a(g,O),H||q||(H=!0,wt||(wt=!0,Ut()))),O},y.unstable_shouldYield=Lt,y.unstable_wrapCallback=function(O){var U=R;return function(){var V=R;R=U;try{return O.apply(this,arguments)}finally{R=V}}}})(kc)),kc}var Zd;function Vm(){return Zd||(Zd=1,Tc.exports=Hm()),Tc.exports}var Jd;function Ym(){if(Jd)return xa;Jd=1;var y=Vm(),a=Dm(),i=xm();function o(t){var e="https://react.dev/errors/"+t;if(1St||(t.current=gt[St],gt[St]=null,St--)}function ft(t,e){St++,gt[St]=t.current,t.current=e}var Bt=Jt(null),De=Jt(null),Ie=Jt(null),Ma=Jt(null);function Ra(t,e){switch(ft(Ie,e),ft(De,t),ft(Bt,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?hd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=hd(e),t=gd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Et(Bt),ft(Bt,t)}function Kn(){Et(Bt),Et(De),Et(Ie)}function eu(t){t.memoizedState!==null&&ft(Ma,t);var e=Bt.current,n=gd(e,t.type);e!==n&&(ft(De,t),ft(Bt,n))}function wa(t){De.current===t&&(Et(Bt),Et(De)),Ma.current===t&&(Et(Ma),Aa._currentValue=V)}var nu,Vc;function Nn(t){if(nu===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);nu=e&&e[1]||"",Vc=-1)":-1u||b[l]!==A[u]){var x=` -`+b[l].replace(" at new "," at ");return t.displayName&&x.includes("")&&(x=x.replace("",t.displayName)),x}while(1<=l&&0<=u);break}}}finally{lu=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Nn(n):""}function ih(t,e){switch(t.tag){case 26:case 27:case 5:return Nn(t.type);case 16:return Nn("Lazy");case 13:return t.child!==e&&e!==null?Nn("Suspense Fallback"):Nn("Suspense");case 19:return Nn("SuspenseList");case 0:case 15:return au(t.type,!1);case 11:return au(t.type.render,!1);case 1:return au(t.type,!0);case 31:return Nn("Activity");default:return""}}function Yc(t){try{var e="",n=null;do e+=ih(t,n),n=t,t=t.return;while(t);return e}catch(l){return` -Error generating stack: `+l.message+` -`+l.stack}}var iu=Object.prototype.hasOwnProperty,uu=y.unstable_scheduleCallback,su=y.unstable_cancelCallback,uh=y.unstable_shouldYield,sh=y.unstable_requestPaint,le=y.unstable_now,ch=y.unstable_getCurrentPriorityLevel,Gc=y.unstable_ImmediatePriority,Xc=y.unstable_UserBlockingPriority,Ua=y.unstable_NormalPriority,oh=y.unstable_LowPriority,Qc=y.unstable_IdlePriority,fh=y.log,rh=y.unstable_setDisableYieldValue,ql=null,ae=null;function Pe(t){if(typeof fh=="function"&&rh(t),ae&&typeof ae.setStrictMode=="function")try{ae.setStrictMode(ql,t)}catch{}}var ie=Math.clz32?Math.clz32:gh,dh=Math.log,hh=Math.LN2;function gh(t){return t>>>=0,t===0?32:31-(dh(t)/hh|0)|0}var Ba=256,qa=262144,Ca=4194304;function On(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function La(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var u=0,s=t.suspendedLanes,r=t.pingedLanes;t=t.warmLanes;var h=l&134217727;return h!==0?(l=h&~s,l!==0?u=On(l):(r&=h,r!==0?u=On(r):n||(n=h&~t,n!==0&&(u=On(n))))):(h=l&~s,h!==0?u=On(h):r!==0?u=On(r):n||(n=l&~t,n!==0&&(u=On(n)))),u===0?0:e!==0&&e!==u&&(e&s)===0&&(s=u&-u,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:u}function Cl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function mh(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Kc(){var t=Ca;return Ca<<=1,(Ca&62914560)===0&&(Ca=4194304),t}function cu(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ll(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function yh(t,e,n,l,u,s){var r=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,b=t.expirationTimes,A=t.hiddenUpdates;for(n=r&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var kh=/[\n"\\]/g;function me(t){return t.replace(kh,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function gu(t,e,n,l,u,s,r,h){t.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.type=r:t.removeAttribute("type"),e!=null?r==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ge(e)):t.value!==""+ge(e)&&(t.value=""+ge(e)):r!=="submit"&&r!=="reset"||t.removeAttribute("value"),e!=null?mu(t,r,ge(e)):n!=null?mu(t,r,ge(n)):l!=null&&t.removeAttribute("value"),u==null&&s!=null&&(t.defaultChecked=!!s),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+ge(h):t.removeAttribute("name")}function io(t,e,n,l,u,s,r,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){hu(t);return}n=n!=null?""+ge(n):"",e=e!=null?""+ge(e):n,h||e===t.value||(t.value=e),t.defaultValue=e}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=h?t.checked:!!l,t.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.name=r),hu(t)}function mu(t,e,n){e==="number"&&Ya(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function In(t,e,n,l){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=!1;if(Ue)try{var Gl={};Object.defineProperty(Gl,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Gl,Gl),window.removeEventListener("test",Gl,Gl)}catch{Su=!1}var en=null,Tu=null,Xa=null;function ho(){if(Xa)return Xa;var t,e=Tu,n=e.length,l,u="value"in en?en.value:en.textContent,s=u.length;for(t=0;t=Kl),bo=" ",So=!1;function To(t,e){switch(t){case"keyup":return Wh.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ko(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var nl=!1;function Ih(t,e){switch(t){case"compositionend":return ko(e);case"keypress":return e.which!==32?null:(So=!0,bo);case"textInput":return t=e.data,t===bo&&So?null:t;default:return null}}function Ph(t,e){if(nl)return t==="compositionend"||!Nu&&To(t,e)?(t=ho(),Xa=Tu=en=null,nl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=_o(n)}}function Mo(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Mo(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ro(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ya(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ya(t.document)}return e}function xu(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var sg=Ue&&"documentMode"in document&&11>=document.documentMode,ll=null,_u=null,Wl=null,ju=!1;function wo(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ju||ll==null||ll!==Ya(l)||(l=ll,"selectionStart"in l&&xu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Wl&&$l(Wl,l)||(Wl=l,l=qi(_u,"onSelect"),0>=r,u-=r,xe=1<<32-ie(e)+u|n<F?(nt=C,C=null):nt=C.sibling;var ct=N(k,C,E[F],j);if(ct===null){C===null&&(C=nt);break}t&&C&&ct.alternate===null&&e(k,C),S=s(ct,S,F),st===null?Y=ct:st.sibling=ct,st=ct,C=nt}if(F===E.length)return n(k,C),at&&qe(k,F),Y;if(C===null){for(;FF?(nt=C,C=null):nt=C.sibling;var En=N(k,C,ct.value,j);if(En===null){C===null&&(C=nt);break}t&&C&&En.alternate===null&&e(k,C),S=s(En,S,F),st===null?Y=En:st.sibling=En,st=En,C=nt}if(ct.done)return n(k,C),at&&qe(k,F),Y;if(C===null){for(;!ct.done;F++,ct=E.next())ct=M(k,ct.value,j),ct!==null&&(S=s(ct,S,F),st===null?Y=ct:st.sibling=ct,st=ct);return at&&qe(k,F),Y}for(C=l(C);!ct.done;F++,ct=E.next())ct=D(C,k,F,ct.value,j),ct!==null&&(t&&ct.alternate!==null&&C.delete(ct.key===null?F:ct.key),S=s(ct,S,F),st===null?Y=ct:st.sibling=ct,st=ct);return t&&C.forEach(function(Om){return e(k,Om)}),at&&qe(k,F),Y}function pt(k,S,E,j){if(typeof E=="object"&&E!==null&&E.type===G&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case q:t:{for(var Y=E.key;S!==null;){if(S.key===Y){if(Y=E.type,Y===G){if(S.tag===7){n(k,S.sibling),j=u(S,E.props.children),j.return=k,k=j;break t}}else if(S.elementType===Y||typeof Y=="object"&&Y!==null&&Y.$$typeof===bt&&Cn(Y)===S.type){n(k,S.sibling),j=u(S,E.props),na(j,E),j.return=k,k=j;break t}n(k,S);break}else e(k,S);S=S.sibling}E.type===G?(j=Rn(E.props.children,k.mode,j,E.key),j.return=k,k=j):(j=ti(E.type,E.key,E.props,null,k.mode,j),na(j,E),j.return=k,k=j)}return r(k);case H:t:{for(Y=E.key;S!==null;){if(S.key===Y)if(S.tag===4&&S.stateNode.containerInfo===E.containerInfo&&S.stateNode.implementation===E.implementation){n(k,S.sibling),j=u(S,E.children||[]),j.return=k,k=j;break t}else{n(k,S);break}else e(k,S);S=S.sibling}j=Cu(E,k.mode,j),j.return=k,k=j}return r(k);case bt:return E=Cn(E),pt(k,S,E,j)}if(L(E))return B(k,S,E,j);if(Ut(E)){if(Y=Ut(E),typeof Y!="function")throw Error(o(150));return E=Y.call(E),X(k,S,E,j)}if(typeof E.then=="function")return pt(k,S,si(E),j);if(E.$$typeof===I)return pt(k,S,li(k,E),j);ci(k,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,S!==null&&S.tag===6?(n(k,S.sibling),j=u(S,E),j.return=k,k=j):(n(k,S),j=qu(E,k.mode,j),j.return=k,k=j),r(k)):n(k,S)}return function(k,S,E,j){try{ea=0;var Y=pt(k,S,E,j);return gl=null,Y}catch(C){if(C===hl||C===ii)throw C;var st=se(29,C,null,k.mode);return st.lanes=j,st.return=k,st}}}var Hn=lf(!0),af=lf(!1),sn=!1;function Wu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fu(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function on(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(ot&2)!==0){var u=l.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),l.pending=e,e=Pa(t),Vo(t,null,n),e}return Ia(t,l,e,n),Pa(t)}function la(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Jc(t,n)}}function Iu(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var u=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?u=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?u=s=e:s=s.next=e}else u=s=e;n={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Pu=!1;function aa(){if(Pu){var t=dl;if(t!==null)throw t}}function ia(t,e,n,l){Pu=!1;var u=t.updateQueue;sn=!1;var s=u.firstBaseUpdate,r=u.lastBaseUpdate,h=u.shared.pending;if(h!==null){u.shared.pending=null;var b=h,A=b.next;b.next=null,r===null?s=A:r.next=A,r=b;var x=t.alternate;x!==null&&(x=x.updateQueue,h=x.lastBaseUpdate,h!==r&&(h===null?x.firstBaseUpdate=A:h.next=A,x.lastBaseUpdate=b))}if(s!==null){var M=u.baseState;r=0,x=A=b=null,h=s;do{var N=h.lane&-536870913,D=N!==h.lane;if(D?(et&N)===N:(l&N)===N){N!==0&&N===rl&&(Pu=!0),x!==null&&(x=x.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var B=t,X=h;N=e;var pt=n;switch(X.tag){case 1:if(B=X.payload,typeof B=="function"){M=B.call(pt,M,N);break t}M=B;break t;case 3:B.flags=B.flags&-65537|128;case 0:if(B=X.payload,N=typeof B=="function"?B.call(pt,M,N):B,N==null)break t;M=_({},M,N);break t;case 2:sn=!0}}N=h.callback,N!==null&&(t.flags|=64,D&&(t.flags|=8192),D=u.callbacks,D===null?u.callbacks=[N]:D.push(N))}else D={lane:N,tag:h.tag,payload:h.payload,callback:h.callback,next:null},x===null?(A=x=D,b=M):x=x.next=D,r|=N;if(h=h.next,h===null){if(h=u.shared.pending,h===null)break;D=h,h=D.next,D.next=null,u.lastBaseUpdate=D,u.shared.pending=null}}while(!0);x===null&&(b=M),u.baseState=b,u.firstBaseUpdate=A,u.lastBaseUpdate=x,s===null&&(u.shared.lanes=0),gn|=r,t.lanes=r,t.memoizedState=M}}function uf(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function sf(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ts?s:8;var r=O.T,h={};O.T=h,vs(t,!1,e,n);try{var b=u(),A=O.S;if(A!==null&&A(h,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var x=yg(b,l);ca(t,e,x,de(t))}else ca(t,e,l,de(t))}catch(M){ca(t,e,{then:function(){},status:"rejected",reason:M},de())}finally{U.p=s,r!==null&&h.types!==null&&(r.types=h.types),O.T=r}}function kg(){}function ys(t,e,n,l){if(t.tag!==5)throw Error(o(476));var u=Lf(t).queue;Cf(t,u,e,V,n===null?kg:function(){return Hf(t),n(l)})}function Lf(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:V},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Hf(t){var e=Lf(t);e.next===null&&(e=t.alternate.memoizedState),ca(t,e.next.queue,{},de())}function ps(){return Yt(Aa)}function Vf(){return Dt().memoizedState}function Yf(){return Dt().memoizedState}function zg(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=de();t=cn(n);var l=on(e,t,n);l!==null&&(ne(l,e,n),la(l,e,n)),e={cache:Ku()},t.payload=e;return}e=e.return}}function Eg(t,e,n){var l=de();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},vi(t)?Xf(e,n):(n=Uu(t,e,n,l),n!==null&&(ne(n,t,l),Qf(n,e,l)))}function Gf(t,e,n){var l=de();ca(t,e,n,l)}function ca(t,e,n,l){var u={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(vi(t))Xf(e,u);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var r=e.lastRenderedState,h=s(r,n);if(u.hasEagerState=!0,u.eagerState=h,ue(h,r))return Ia(t,e,u,0),vt===null&&Fa(),!1}catch{}if(n=Uu(t,e,u,l),n!==null)return ne(n,t,l),Qf(n,e,l),!0}return!1}function vs(t,e,n,l){if(l={lane:2,revertLane:Ws(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},vi(t)){if(e)throw Error(o(479))}else e=Uu(t,n,l,2),e!==null&&ne(e,t,2)}function vi(t){var e=t.alternate;return t===J||e!==null&&e===J}function Xf(t,e){yl=ri=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Qf(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Jc(t,n)}}var oa={readContext:Yt,use:gi,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};oa.useEffectEvent=At;var Kf={readContext:Yt,use:gi,useCallback:function(t,e){return $t().memoizedState=[t,e===void 0?null:e],t},useContext:Yt,useEffect:xf,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,yi(4194308,4,Rf.bind(null,e,t),n)},useLayoutEffect:function(t,e){return yi(4194308,4,t,e)},useInsertionEffect:function(t,e){yi(4,2,t,e)},useMemo:function(t,e){var n=$t();e=e===void 0?null:e;var l=t();if(Vn){Pe(!0);try{t()}finally{Pe(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=$t();if(n!==void 0){var u=n(e);if(Vn){Pe(!0);try{n(e)}finally{Pe(!1)}}}else u=e;return l.memoizedState=l.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},l.queue=t,t=t.dispatch=Eg.bind(null,J,t),[l.memoizedState,t]},useRef:function(t){var e=$t();return t={current:t},e.memoizedState=t},useState:function(t){t=rs(t);var e=t.queue,n=Gf.bind(null,J,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(t,e){var n=$t();return ms(n,t,e)},useTransition:function(){var t=rs(!1);return t=Cf.bind(null,J,t.queue,!0,!1),$t().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=J,u=$t();if(at){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),vt===null)throw Error(o(349));(et&127)!==0||hf(l,e,n)}u.memoizedState=n;var s={value:n,getSnapshot:e};return u.queue=s,xf(mf.bind(null,l,s,t),[t]),l.flags|=2048,vl(9,{destroy:void 0},gf.bind(null,l,s,n,e),null),n},useId:function(){var t=$t(),e=vt.identifierPrefix;if(at){var n=_e,l=xe;n=(l&~(1<<32-ie(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=di++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(u,{is:l.is}):r.createElement(u)}}s[Ht]=e,s[Wt]=l;t:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break t;for(;r.sibling===null;){if(r.return===null||r.return===e)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=s;t:switch(Xt(s,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&Ge(e)}}return kt(e),Ms(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Ge(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(o(166));if(t=Ie.current,ol(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,u=Vt,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}t[Ht]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||rd(t.nodeValue,n)),t||an(e,!0)}else t=Ci(t).createTextNode(l),t[Ht]=e,e.stateNode=t}return kt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=ol(e),n!==null){if(t===null){if(!l)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Ht]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),t=!1}else n=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(oe(e),e):(oe(e),null);if((e.flags&128)!==0)throw Error(o(558))}return kt(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=ol(e),l!==null&&l.dehydrated!==null){if(t===null){if(!u)throw Error(o(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Ht]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),u=!1}else u=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(oe(e),e):(oe(e),null)}return oe(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),zi(e,e.updateQueue),kt(e),null);case 4:return Kn(),t===null&&tc(e.stateNode.containerInfo),kt(e),null;case 10:return Le(e.type),kt(e),null;case 19:if(Et(Ot),l=e.memoizedState,l===null)return kt(e),null;if(u=(e.flags&128)!==0,s=l.rendering,s===null)if(u)ra(l,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=fi(t),s!==null){for(e.flags|=128,ra(l,!1),t=s.updateQueue,e.updateQueue=t,zi(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Yo(n,t),n=n.sibling;return ft(Ot,Ot.current&1|2),at&&qe(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&le()>Di&&(e.flags|=128,u=!0,ra(l,!1),e.lanes=4194304)}else{if(!u)if(t=fi(s),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,zi(e,t),ra(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!at)return kt(e),null}else 2*le()-l.renderingStartTime>Di&&n!==536870912&&(e.flags|=128,u=!0,ra(l,!1),e.lanes=4194304);l.isBackwards?(s.sibling=e.child,e.child=s):(t=l.last,t!==null?t.sibling=s:e.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=le(),t.sibling=null,n=Ot.current,ft(Ot,u?n&1|2:n&1),at&&qe(e,l.treeForkCount),t):(kt(e),null);case 22:case 23:return oe(e),es(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(kt(e),e.subtreeFlags&6&&(e.flags|=8192)):kt(e),n=e.updateQueue,n!==null&&zi(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&Et(qn),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Le(xt),kt(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function xg(t,e){switch(Hu(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Le(xt),Kn(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return wa(e),null;case 31:if(e.memoizedState!==null){if(oe(e),e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(oe(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Et(Ot),null;case 4:return Kn(),null;case 10:return Le(e.type),null;case 22:case 23:return oe(e),es(),t!==null&&Et(qn),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Le(xt),null;case 25:return null;default:return null}}function yr(t,e){switch(Hu(e),e.tag){case 3:Le(xt),Kn();break;case 26:case 27:case 5:wa(e);break;case 4:Kn();break;case 31:e.memoizedState!==null&&oe(e);break;case 13:oe(e);break;case 19:Et(Ot);break;case 10:Le(e.type);break;case 22:case 23:oe(e),es(),t!==null&&Et(qn);break;case 24:Le(xt)}}function da(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var u=l.next;n=u;do{if((n.tag&t)===t){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==u)}}catch(h){ht(e,e.return,h)}}function dn(t,e,n){try{var l=e.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var s=u.next;l=s;do{if((l.tag&t)===t){var r=l.inst,h=r.destroy;if(h!==void 0){r.destroy=void 0,u=e;var b=n,A=h;try{A()}catch(x){ht(u,b,x)}}}l=l.next}while(l!==s)}}catch(x){ht(e,e.return,x)}}function pr(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{sf(e,n)}catch(l){ht(t,t.return,l)}}}function vr(t,e,n){n.props=Yn(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){ht(t,e,l)}}function ha(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(u){ht(t,e,u)}}function je(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(u){ht(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){ht(t,e,u)}else n.current=null}function br(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(u){ht(t,t.return,u)}}function Rs(t,e,n){try{var l=t.stateNode;Fg(l,t.type,n,e),l[Wt]=e}catch(u){ht(t,t.return,u)}}function Sr(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bn(t.type)||t.tag===4}function ws(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Sr(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Us(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=we));else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Us(t,e,n),t=t.sibling;t!==null;)Us(t,e,n),t=t.sibling}function Ei(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ei(t,e,n),t=t.sibling;t!==null;)Ei(t,e,n),t=t.sibling}function Tr(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);Xt(e,l,n),e[Ht]=t,e[Wt]=n}catch(s){ht(t,t.return,s)}}var Xe=!1,Mt=!1,Bs=!1,kr=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function _g(t,e){if(t=t.containerInfo,lc=Qi,t=Ro(t),xu(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var u=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var r=0,h=-1,b=-1,A=0,x=0,M=t,N=null;e:for(;;){for(var D;M!==n||u!==0&&M.nodeType!==3||(h=r+u),M!==s||l!==0&&M.nodeType!==3||(b=r+l),M.nodeType===3&&(r+=M.nodeValue.length),(D=M.firstChild)!==null;)N=M,M=D;for(;;){if(M===t)break e;if(N===n&&++A===u&&(h=r),N===s&&++x===l&&(b=r),(D=M.nextSibling)!==null)break;M=N,N=M.parentNode}M=D}n=h===-1||b===-1?null:{start:h,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(ac={focusedElem:t,selectionRange:n},Qi=!1,Ct=e;Ct!==null;)if(e=Ct,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ct=t;else for(;Ct!==null;){switch(e=Ct,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),Xt(s,l,n),s[Ht]=t,qt(s),l=s;break t;case"link":var r=Dd("link","href",u).get(l+(n.href||""));if(r){for(var h=0;hpt&&(r=pt,pt=X,X=r);var k=jo(h,X),S=jo(h,pt);if(k&&S&&(D.rangeCount!==1||D.anchorNode!==k.node||D.anchorOffset!==k.offset||D.focusNode!==S.node||D.focusOffset!==S.offset)){var E=M.createRange();E.setStart(k.node,k.offset),D.removeAllRanges(),X>pt?(D.addRange(E),D.extend(S.node,S.offset)):(E.setEnd(S.node,S.offset),D.addRange(E))}}}}for(M=[],D=h;D=D.parentNode;)D.nodeType===1&&M.push({element:D,left:D.scrollLeft,top:D.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;hn?32:n,O.T=null,n=Gs,Gs=null;var s=yn,r=$e;if(Rt=0,zl=yn=null,$e=0,(ot&6)!==0)throw Error(o(331));var h=ot;if(ot|=4,Rr(s.current),_r(s,s.current,r,n),ot=h,ba(0,!1),ae&&typeof ae.onPostCommitFiberRoot=="function")try{ae.onPostCommitFiberRoot(ql,s)}catch{}return!0}finally{U.p=u,O.T=l,Fr(t,e)}}function Pr(t,e,n){e=pe(n,e),e=ks(t.stateNode,e,2),t=on(t,e,2),t!==null&&(Ll(t,2),Me(t))}function ht(t,e,n){if(t.tag===3)Pr(t,t,n);else for(;e!==null;){if(e.tag===3){Pr(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(mn===null||!mn.has(l))){t=pe(n,t),n=tr(2),l=on(e,n,2),l!==null&&(er(n,l,e,t),Ll(l,2),Me(l));break}}e=e.return}}function Zs(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new Rg;var u=new Set;l.set(e,u)}else u=l.get(e),u===void 0&&(u=new Set,l.set(e,u));u.has(n)||(Ls=!0,u.add(n),t=Cg.bind(null,t,e,n),e.then(t,t))}function Cg(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,vt===t&&(et&n)===n&&(Nt===4||Nt===3&&(et&62914560)===et&&300>le()-Oi?(ot&2)===0&&El(t,0):Hs|=n,kl===et&&(kl=0)),Me(t)}function td(t,e){e===0&&(e=Kc()),t=Mn(t,e),t!==null&&(Ll(t,e),Me(t))}function Lg(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),td(t,n)}function Hg(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(e),td(t,n)}function Vg(t,e){return uu(t,e)}var wi=null,Nl=null,Js=!1,Ui=!1,$s=!1,vn=0;function Me(t){t!==Nl&&t.next===null&&(Nl===null?wi=Nl=t:Nl=Nl.next=t),Ui=!0,Js||(Js=!0,Gg())}function ba(t,e){if(!$s&&Ui){$s=!0;do for(var n=!1,l=wi;l!==null;){if(t!==0){var u=l.pendingLanes;if(u===0)var s=0;else{var r=l.suspendedLanes,h=l.pingedLanes;s=(1<<31-ie(42|t)+1)-1,s&=u&~(r&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,ad(l,s))}else s=et,s=La(l,l===vt?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Cl(l,s)||(n=!0,ad(l,s));l=l.next}while(n);$s=!1}}function Yg(){ed()}function ed(){Ui=Js=!1;var t=0;vn!==0&&Pg()&&(t=vn);for(var e=le(),n=null,l=wi;l!==null;){var u=l.next,s=nd(l,e);s===0?(l.next=null,n===null?wi=u:n.next=u,u===null&&(Nl=n)):(n=l,(t!==0||(s&3)!==0)&&(Ui=!0)),l=u}Rt!==0&&Rt!==5||ba(t),vn!==0&&(vn=0)}function nd(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,u=t.expirationTimes,s=t.pendingLanes&-62914561;0h)break;var x=b.transferSize,M=b.initiatorType;x&&dd(M)&&(b=b.responseEnd,r+=x*(b"u"?null:document;function Ed(t,e,n){var l=Ol;if(l&&typeof e=="string"&&e){var u=me(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),zd.has(u)||(zd.add(u),t={rel:t,crossOrigin:n,href:e},l.querySelector(u)===null&&(e=l.createElement("link"),Xt(e,"link",t),qt(e),l.head.appendChild(e)))}}function cm(t){We.D(t),Ed("dns-prefetch",t,null)}function om(t,e){We.C(t,e),Ed("preconnect",t,e)}function fm(t,e,n){We.L(t,e,n);var l=Ol;if(l&&t&&e){var u='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+me(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+me(n.imageSizes)+'"]')):u+='[href="'+me(t)+'"]';var s=u;switch(e){case"style":s=Dl(t);break;case"script":s=xl(t)}ze.has(s)||(t=_({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),ze.set(s,t),l.querySelector(u)!==null||e==="style"&&l.querySelector(za(s))||e==="script"&&l.querySelector(Ea(s))||(e=l.createElement("link"),Xt(e,"link",t),qt(e),l.head.appendChild(e)))}}function rm(t,e){We.m(t,e);var n=Ol;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+me(l)+'"][href="'+me(t)+'"]',s=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=xl(t)}if(!ze.has(s)&&(t=_({rel:"modulepreload",href:t},e),ze.set(s,t),n.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ea(s)))return}l=n.createElement("link"),Xt(l,"link",t),qt(l),n.head.appendChild(l)}}}function dm(t,e,n){We.S(t,e,n);var l=Ol;if(l&&t){var u=Wn(l).hoistableStyles,s=Dl(t);e=e||"default";var r=u.get(s);if(!r){var h={loading:0,preload:null};if(r=l.querySelector(za(s)))h.loading=5;else{t=_({rel:"stylesheet",href:t,"data-precedence":e},n),(n=ze.get(s))&&rc(t,n);var b=r=l.createElement("link");qt(b),Xt(b,"link",t),b._p=new Promise(function(A,x){b.onload=A,b.onerror=x}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Hi(r,e,l)}r={type:"stylesheet",instance:r,count:1,state:h},u.set(s,r)}}}function hm(t,e){We.X(t,e);var n=Ol;if(n&&t){var l=Wn(n).hoistableScripts,u=xl(t),s=l.get(u);s||(s=n.querySelector(Ea(u)),s||(t=_({src:t,async:!0},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),qt(s),Xt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function gm(t,e){We.M(t,e);var n=Ol;if(n&&t){var l=Wn(n).hoistableScripts,u=xl(t),s=l.get(u);s||(s=n.querySelector(Ea(u)),s||(t=_({src:t,async:!0,type:"module"},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),qt(s),Xt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function Ad(t,e,n,l){var u=(u=Ie.current)?Li(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Dl(n.href),n=Wn(u).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Dl(n.href);var s=Wn(u).hoistableStyles,r=s.get(t);if(r||(u=u.ownerDocument||u,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,r),(s=u.querySelector(za(t)))&&!s._p&&(r.instance=s,r.state.loading=5),ze.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ze.set(t,n),s||mm(u,t,n,r.state))),e&&l===null)throw Error(o(528,""));return r}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=xl(n),n=Wn(u).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function Dl(t){return'href="'+me(t)+'"'}function za(t){return'link[rel="stylesheet"]['+t+"]"}function Nd(t){return _({},t,{"data-precedence":t.precedence,precedence:null})}function mm(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),Xt(e,"link",n),qt(e),t.head.appendChild(e))}function xl(t){return'[src="'+me(t)+'"]'}function Ea(t){return"script[async]"+t}function Od(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+me(n.href)+'"]');if(l)return e.instance=l,qt(l),l;var u=_({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),qt(l),Xt(l,"style",u),Hi(l,n.precedence,t),e.instance=l;case"stylesheet":u=Dl(n.href);var s=t.querySelector(za(u));if(s)return e.state.loading|=4,e.instance=s,qt(s),s;l=Nd(n),(u=ze.get(u))&&rc(l,u),s=(t.ownerDocument||t).createElement("link"),qt(s);var r=s;return r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Xt(s,"link",l),e.state.loading|=4,Hi(s,n.precedence,t),e.instance=s;case"script":return s=xl(n.src),(u=t.querySelector(Ea(s)))?(e.instance=u,qt(u),u):(l=n,(u=ze.get(s))&&(l=_({},n),dc(l,u)),t=t.ownerDocument||t,u=t.createElement("script"),qt(u),Xt(u,"link",l),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,Hi(l,n.precedence,t));return e.instance}function Hi(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,s=u,r=0;r title"):null)}function ym(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function _d(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function pm(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=Dl(l.href),s=e.querySelector(za(u));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Yi.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,qt(s);return}s=e.ownerDocument||e,l=Nd(l),(u=ze.get(u))&&rc(l,u),s=s.createElement("link"),qt(s);var r=s;r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Xt(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Yi.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var hc=0;function vm(t,e){return t.stylesheets&&t.count===0&&Xi(t,t.stylesheets),0hc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Yi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xi(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Gi=null;function Xi(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gi=new Map,e.forEach(bm,t),Gi=null,Yi.call(t))}function bm(t,e){if(!(e.state.loading&4)){var n=Gi.get(t);if(n)var l=n.get(null);else{n=new Map,Gi.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y)}catch(a){console.error(a)}}return y(),Sc.exports=Ym(),Sc.exports}var Xm=Gm();class Qm extends ${constructor(){super("avalanche.operator.Empty",[])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.poszc},{no:6,name:"run_id",kind:"scalar",T:9},{no:7,name:"workflow_selector",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.flowName="",i.inputJson="",i.contextJson="",i.inputFiles=[],i.runId="",i.workflowSelector="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posAn}},{no:3,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posAn}},{no:5,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"cron",kind:"scalar",T:9},{no:8,name:"next_run_at",kind:"scalar",T:1},{no:9,name:"last_run_at",kind:"scalar",T:1},{no:10,name:"workflow_id",kind:"scalar",T:9},{no:11,name:"display_name",kind:"scalar",T:9},{no:12,name:"root_alias",kind:"scalar",T:9},{no:13,name:"relative_file",kind:"scalar",T:9},{no:14,name:"builder_symbol",kind:"scalar",T:9},{no:15,name:"agent_node_ids",kind:"scalar",repeat:2,T:9},{no:16,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:17,name:"webhook_path",kind:"scalar",T:9},{no:18,name:"webhook_url",kind:"scalar",T:9},{no:19,name:"webhook_active",kind:"scalar",T:8}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.name="",i.filePath="",i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.cron="",i.nextRunAt=0,i.lastRunAt=0,i.workflowId="",i.displayName="",i.rootAlias="",i.relativeFile="",i.builderSymbol="",i.agentNodeIds=[],i.agentMetadataJson={},i.webhookPath="",i.webhookUrl="",i.webhookActive=!1,a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posEc},{no:5,name:"scan_targets",kind:"message",repeat:2,T:()=>Nc},{no:6,name:"diagnostics",kind:"message",repeat:2,T:()=>Ac}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.revision="0",i.workflows=[],i.scanTargets=[],i.diagnostics=[],a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posOc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.valueJson="",i.files=[],a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posRl},{no:8,name:"revision",kind:"scalar",T:4},{no:9,name:"event_page_token",kind:"scalar",T:9},{no:10,name:"error",kind:"scalar",opt:!0,T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeId="",i.name="",i.nodeType="",i.status="",i.startedAt=0,i.endedAt=0,i.revision="0",i.eventPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posFe},{no:4,name:"nodes",kind:"message",repeat:2,T:()=>wl},{no:5,name:"latest_log_sequence",kind:"scalar",T:4},{no:6,name:"log_page_token",kind:"scalar",T:9},{no:7,name:"topology",kind:"message",T:()=>Ml}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.nodes=[],i.latestLogSequence="0",i.logPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posFe},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runs=[],i.nextPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posUl},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.logs=[],i.nextPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posBl},{no:6,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runId="",i.nodeId="",i.events=[],i.nextPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posFe},{no:2,name:"nodes",kind:"message",repeat:2,T:()=>wl},{no:3,name:"topology",kind:"message",T:()=>Ml}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodes=[],a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posUl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posBl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posRl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posPi}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posDc},{no:3,name:"run_status_changed",kind:"message",oneof:"change",T:()=>xc},{no:4,name:"node_status_changed",kind:"message",oneof:"change",T:()=>_c},{no:5,name:"log_appended",kind:"message",oneof:"change",T:()=>jc},{no:6,name:"agent_event_appended",kind:"message",oneof:"change",T:()=>Mc},{no:7,name:"trace_finalized",kind:"message",oneof:"change",T:()=>Rc},{no:8,name:"catalog_replaced",kind:"message",oneof:"change",T:()=>wc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.sequence="0",i.change={oneofKind:void 0},a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posUc},{no:3,name:"reset_required",kind:"message",oneof:"payload",T:()=>Bc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.payload={oneofKind:void 0},a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),p=a.pos+i;for(;a.posawait this.client.getRunSnapshot({runId:g.runId,operatorInstanceId:f,asOfSequence:c}).response)),d=await this.getCatalog();if(a.operatorInstanceId!==f||d.operatorInstanceId!==f||a.revision!==d.revision||BigInt(a.asOfSequence)>BigInt(c)||BigInt(d.asOfSequence)d.nodeId===i);if(!o?.eventPageToken)return[];const f=[];let c=o.eventPageToken,p="0";do{const d=await this.client.listAgentEvents({pageToken:c,afterEventSequence:p,pageSize:100}).response;f.push(...d.events),d.events.length&&(p=d.events.at(-1).eventSequence),c=d.nextPageToken}while(c);return f}async listLogs(a){if(!a.logPageToken)return[];const i=[];let o=a.logPageToken,f="0";do{const c=await this.client.listLogs({pageToken:o,afterSequence:f,pageSize:100}).response;i.push(...c.logs),c.logs.length&&(f=c.logs.at(-1).sequence),o=c.nextPageToken}while(o);return i}async readDetail(a){const i=[];for await(const p of this.client.readDetail({bodyToken:a}).responses)i.push(p.data);const o=i.reduce((p,d)=>p+d.length,0),f=new Uint8Array(o);let c=0;for(const p of i)f.set(p,c),c+=p.length;return JSON.parse(new TextDecoder().decode(f))}async startRun(a,i){return(await this.client.startRun({flowName:"",workflowSelector:a,runId:"",inputJson:i===void 0?"":JSON.stringify(i),contextJson:"",inputFiles:[]}).response).runId}async cancelRun(a){await this.client.cancelRun({runId:a}).response}}function tp(y){return y==="success"?"✓":y==="failed"?"!":y==="running"?"●":"·"}function ep({workflow:y,runs:a,selection:i,onSelect:o}){const[f,c]=Z.useState(!0);return v.jsxs("div",{className:"workflow-branch",children:[v.jsxs("div",{className:"tree-row",children:[v.jsx("button",{type:"button",className:"tree-disclosure",onClick:()=>c(p=>!p),"aria-label":`${f?"Collapse":"Expand"} ${y.displayName}`,children:f?"⌄":"›"}),v.jsxs("button",{type:"button",className:i?.kind==="workflow"&&i.workflowId===y.workflowId?"tree-select active":"tree-select",onClick:()=>o({kind:"workflow",workflowId:y.workflowId}),children:[v.jsx("span",{className:"workflow-glyph",children:"◇"}),v.jsxs("span",{children:[v.jsx("strong",{children:y.displayName}),v.jsx("small",{children:y.relativeFile})]})]})]}),f&&v.jsxs("div",{className:"run-branches",children:[a.map(p=>{const d=p.summary;return v.jsxs("button",{type:"button",className:i?.kind==="run"&&i.runId===d.runId?"run-select active":"run-select",onClick:()=>o({kind:"run",workflowId:y.workflowId,runId:d.runId}),children:[v.jsx("span",{className:`run-dot status-${d.status}`,children:tp(d.status)}),v.jsxs("span",{children:[v.jsx("strong",{children:d.runId}),v.jsx("small",{children:d.startedAt?`Created at sequence ${d.createdSequence}`:"Awaiting start"})]})]},d.runId)}),!a.length&&v.jsx("span",{className:"no-runs",children:"No runs yet"})]})]})}function np(y,a){return y.workflows.filter(i=>i.rootAlias===a.alias)}function lp({catalog:y,runs:a,selection:i,onSelect:o}){const[f,c]=Z.useState({});if(!y)return v.jsxs("aside",{className:"explorer skeleton","aria-label":"Explorer",children:[v.jsx("div",{}),v.jsx("div",{}),v.jsx("div",{})]});const p=y.scanTargets.length?y.scanTargets:[{alias:"workflows",targetPath:"Configured workflows",kind:"directory"}];return v.jsxs("aside",{className:"explorer","aria-label":"Explorer",children:[v.jsxs("header",{children:[v.jsx("span",{className:"eyebrow",children:"Navigator"}),v.jsx("h2",{children:"Explorer"}),v.jsxs("span",{className:"catalog-revision",children:["catalog r",y.revision]})]}),y.diagnostics.length>0&&v.jsxs("details",{className:"diagnostics",open:!0,children:[v.jsxs("summary",{children:[y.diagnostics.length," reload issue",y.diagnostics.length===1?"":"s"]}),y.diagnostics.map(d=>v.jsxs("div",{children:[v.jsx("strong",{children:d.kind.replaceAll("_"," ")}),v.jsx("span",{children:d.path}),v.jsx("p",{children:d.message})]},`${d.path}-${d.kind}`))]}),v.jsx("div",{className:"target-list",children:p.map(d=>{const g=d.alias==="workflows"?y.workflows:np(y,d),m=!!f[d.alias];return v.jsxs("section",{className:"target",children:[v.jsxs("button",{type:"button",className:"target-heading",onClick:()=>c(z=>{const _={...z};return _[d.alias]?delete _[d.alias]:_[d.alias]=!0,_}),children:[v.jsx("span",{children:m?"›":"⌄"}),v.jsx("span",{className:"target-kind",children:d.kind==="file"?"F":"D"}),v.jsxs("span",{children:[v.jsx("strong",{children:d.alias}),v.jsx("small",{title:d.targetPath,children:d.targetPath})]})]}),!m&&v.jsx("div",{className:"workflow-list",children:g.map(z=>v.jsx(ep,{workflow:z,runs:Object.values(a).filter(_=>_.summary?.workflowId===z.workflowId).sort((_,R)=>Number(R.summary.createdSequence)-Number(_.summary.createdSequence)),selection:i,onSelect:o},z.workflowId))})]},d.alias)})})]})}function Qn(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function Fd(y){return Array.isArray(y)?y.flatMap(a=>!Qn(a)||typeof a.name!="string"?[]:[{name:a.name,type:typeof a.type=="string"?a.type:void 0,description:typeof a.description=="string"?a.description:void 0}]):[]}function th(y){if(y)try{const a=JSON.parse(y);if(!Qn(a))return;const i=Qn(a.signature)?a.signature:{};return{instructions:typeof i.instructions=="string"?i.instructions:"",inputs:Fd(i.inputs),outputs:Fd(i.outputs),model:a.models,runtime:a.runtime,skills:a.skills,tools:a.tools}}catch{return}}const eh=Z.memo(({data:y})=>v.jsxs("button",{type:"button",className:`node-card ${y.status?`status-${y.status}`:"blueprint"}`,onClick:y.onOpen,"aria-label":`Inspect ${y.label}`,children:[v.jsx(Xd,{type:"target",position:Qd.Left,isConnectable:!1}),v.jsx("span",{className:"node-kicker",children:y.nodeType}),v.jsx("strong",{children:y.label}),y.status&&v.jsx("span",{className:"node-status",children:y.status}),y.duration&&v.jsx("span",{className:"node-duration",children:y.duration}),y.error&&v.jsx("span",{className:"node-error",children:y.error}),y.declaration&&v.jsxs("span",{className:"field-grid",children:[v.jsxs("span",{children:[v.jsx("small",{children:"Inputs"}),y.declaration.inputs.map(a=>v.jsx("span",{className:"field",children:a.name},`input-${a.name}`))]}),v.jsxs("span",{children:[v.jsx("small",{children:"Outputs"}),y.declaration.outputs.map(a=>v.jsx("span",{className:"field",children:a.name},`output-${a.name}`))]})]}),v.jsx(Xd,{type:"source",position:Qd.Right,isConnectable:!1})]}));eh.displayName="WorkflowNodeCard";function ap(y){const a=Object.fromEntries(y.nodeIds.map(c=>[c,0]));for(const c of Object.values(y.graph))for(const p of c.children)a[p]=(a[p]??0)+1;const i={},o=y.nodeIds.filter(c=>a[c]===0);for(const c of o)i[c]=0;for(let c=0;cp.map((d,g)=>[d,{x:Number(c)*330,y:g*220-(p.length-1)*110}])))}function ip(y){if(!y.startedAt)return;const a=y.endedAt||Date.now()/1e3,i=Math.max(0,a-y.startedAt);return i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m`}function up({workflow:y,runTopology:a,runNodes:i=[],onOpenNode:o}){const f=Z.useMemo(()=>{if(a)return a;if(y)return{nodeIds:y.nodeIds,graph:y.graph,nodeTypes:y.nodeTypes,displayNames:y.displayNames}},[a,y]),c=Z.useMemo(()=>{if(!f)return{nodes:[],edges:[]};const p=ap(f),d=Object.fromEntries(i.map(_=>[_.nodeId,_])),g=f.nodeIds.map(_=>{const R=d[_];return{id:_,type:"workflow",position:p[_],data:{label:f.displayNames[_]||R?.name||_,nodeType:f.nodeTypes[_]||R?.nodeType||"step",status:R?.status,error:R?.error,duration:R?ip(R):void 0,declaration:y?th(y.agentMetadataJson[_]):void 0,onOpen:()=>o(_)}}}),m=new Set,z=[];for(const[_,R]of Object.entries(f.graph))for(const q of R.children){const H=`${_}->${q}`;m.has(H)||(m.add(H),z.push({id:H,source:_,target:q,markerEnd:{type:_m.ArrowClosed},className:"dag-edge"}))}return{nodes:g,edges:z}},[o,i,f,y]);return v.jsxs(jm,{nodes:c.nodes,edges:c.edges,nodeTypes:{workflow:eh},fitView:!0,fitViewOptions:{padding:.24},minZoom:.25,maxZoom:1.8,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[v.jsx(Mm,{color:"rgba(255,255,255,.06)",gap:24,size:1}),v.jsx(Rm,{showInteractive:!1})]})}function sp(y,a,i){const o=new Array(y);return new Proxy(o,{get(f,c,p){if(typeof c=="string"){const d=c.charCodeAt(0);if(d>=48&&d<=57){const g=+c;if(Number.isInteger(g)&&g>=0&&go[z]!==m))&&(o=d,f=a(...d),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(f),c=!1),f}return p.updateDeps=d=>{o=d},p}function Id(y,a){if(y===void 0)throw new Error("Unexpected undefined");return y}const cp=(y,a)=>Math.abs(y-a)<1.01,op=(y,a,i)=>{let o;return function(...f){y.clearTimeout(o),o=y.setTimeout(()=>a.apply(this,f),i)}};let _a;const Cc=()=>{if(_a!==void 0)return _a;if(typeof navigator>"u")return _a=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return _a=!0;const y=navigator.maxTouchPoints;return _a=navigator.platform==="MacIntel"&&y!==void 0&&y>0},Pd=y=>{const{offsetWidth:a,offsetHeight:i}=y;return{width:a,height:i}},fp=y=>y,rp=y=>{const a=Math.max(y.startIndex-y.overscan,0),o=Math.min(y.endIndex+y.overscan,y.count-1)-a+1,f=new Array(o);for(let c=0;c{const i=y.scrollElement;if(!i)return;const o=y.targetWindow;if(!o)return;const f=p=>{const{width:d,height:g}=p;a({width:Math.round(d),height:Math.round(g)})};if(f(Pd(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(p=>{const d=()=>{const g=p[0];if(g?.borderBoxSize){const m=g.borderBoxSize[0];if(m){f({width:m.inlineSize,height:m.blockSize});return}}f(Pd(i))};y.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},tu={passive:!0},hp=typeof window>"u"?!0:"onscrollend"in window,gp=(y,a,i)=>{const o=y.scrollElement;if(!o)return;const f=y.targetWindow;if(!f)return;const c=y.options.useScrollendEvent&&hp;let p=0;const d=c?null:op(f,()=>a(p,!1),y.options.isScrollingResetDelay),g=_=>()=>{p=i(o),d?.(),a(p,_)},m=g(!0),z=g(!1);return o.addEventListener("scroll",m,tu),c&&o.addEventListener("scrollend",z,tu),()=>{o.removeEventListener("scroll",m),c&&o.removeEventListener("scrollend",z)}},mp=(y,a)=>gp(y,a,i=>{const{horizontal:o,isRtl:f}=y.options;return o?i.scrollLeft*(f&&-1||1):i.scrollTop}),yp=(y,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(y),f=i.options.getItemKey(o);return i.itemSizeCache.get(f)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(y),f=i.options.getItemKey(o),c=i.itemSizeCache.get(f);if(c!==void 0)return c}return y[i.options.horizontal?"offsetWidth":"offsetHeight"]},pp=(y,{adjustments:a=0,behavior:i},o)=>{var f,c;(c=(f=o.scrollElement)==null?void 0:f.scrollTo)==null||c.call(f,{[o.options.horizontal?"left":"top"]:y+a,behavior:i})},vp=pp;class bp{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,f;return((f=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:f.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(f=>{f.forEach(c=>{const p=()=>{const d=c.target,g=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,z]of this.elementsCache)if(z===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(d,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(p):p()})}));return{disconnect:()=>{var f;(f=o())==null||f.disconnect(),i=null},observe:f=>{var c;return(c=o())==null?void 0:c.observe(f,{box:"border-box"})},unobserve:f=>{var c;return(c=o())==null?void 0:c.unobserve(f)}}})(),this.range=null,this.setOptions=i=>{var o,f;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:fp,rangeExtractor:rp,onChange:()=>{},measureElement:yp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const R in i){const q=i[R];q!==void 0&&(c[R]=q)}const p=this.options;let d=null,g=null,m=!1;if(p!==void 0&&p.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const R=p.count,q=c.count,H=this.getMeasurements(),G=R>0?((o=H[0])==null?void 0:o.key)??p.getItemKey(0):null,lt=R>0?((f=H[R-1])==null?void 0:f.key)??p.getItemKey(R-1):null;if(q!==R||R>0&&q>0&&(c.getItemKey(0)!==G||c.getItemKey(q-1)!==lt)){m=!0;const I=R>0?this.getVirtualItemForOffset(this.getScrollOffset())??H[0]:null;I&&(d=[I.key,this.getScrollOffset()-I.start]);const rt=c.followOnAppend===!0?"auto":c.followOnAppend||null;rt&&q>R&&this.isAtEnd(p.scrollEndThreshold)&&(R===0||c.getItemKey(q-1)!==lt)&&(g=rt)}}this.options=c,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let z=!1,_=0;if(d&&this.scrollOffset!==null){const[R,q]=d,H=this.getMeasurements(),{count:G,getItemKey:lt}=this.options;let Q=0;for(;Q{var o,f;(f=(o=this.options).onChange)==null||f.call(o,this,i)},this.maybeNotify=jl(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,p)=>{if(p&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=p?d===c?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Cc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",p,tu),c.addEventListener("touchend",d,tu),this.unsubs.push(()=>{c.removeEventListener("touchstart",p),c.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const f=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,f&&this.scrollElement&&this.options.enabled){const[c,p,d,g]=f;c!==null&&!d&&(Cc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?g!==0&&(this._iosDeferredAdjustment+=g):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const f=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=f,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=jl(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,f,c,p,d,g,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:p,lanes:d,laneAssignmentMode:g,gap:m}),{key:!1}),this.getMeasurements=jl(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:p,lanes:d,laneAssignmentMode:g,gap:m},z)=>{const _=this.itemSizeCache;if(!p)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const Q of this.laneAssignments.keys())Q>=i&&this.laneAssignments.delete(Q);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(Q=>{this.itemSizeCache.set(Q.key,Q.size)}));const R=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),d===1){const Q=i*2;let K=this._flatMeasurements;if(!K||K.length0&&it.set(K.subarray(0,R*2)),K=it,this._flatMeasurements=K}let I;if(R===0)I=o+f;else{const it=R-1;I=K[it*2]+K[it*2+1]+m}for(let it=R;it1){rt=I;const Lt=H[rt],Qt=Lt!==void 0?q[Lt]:void 0;it=Qt?Qt.end+m:o+f}else if(lt===d){let Lt=0,Qt=G[0],Ut=H[0];for(let Zt=1;Ztthis.options.debug}),this.calculateRange=jl(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,f,c)=>i.length===0||o===0?(this.range=null,null):(this.range=Tp(i,o,f,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=jl(()=>{let i=null,o=null;const f=this.calculateRange();return f&&(i=f.startIndex,o=f.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,f,c,p)=>c===null||p===null?[]:i({startIndex:c,endIndex:p,overscan:o,count:f}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,f=i.getAttribute(o);return f?parseInt(f,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const f=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(f!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),p=Math.max(0,f-c),d=Math.min(this.options.count-1,f+c);return i>=p&&i<=d}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((p,d)=>{p.isConnected||(this.observer.unobserve(p),this.elementsCache.delete(d))});return}const o=this.indexFromElement(i),f=this.options.getItemKey(o),c=this.elementsCache.get(f);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(f,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var f,c;if(i<0||i>=this.options.count)return;let p,d,g;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)g=this.options.getItemKey(i),d=m[i*2],p=m[i*2+1];else{const R=this.measurementsCache[i];if(!R)return;g=R.key,d=R.start,p=R.size}const z=this.itemSizeCache.get(g)??p,_=o-z;if(_!==0){const R=this.options.anchorTo==="end"&&((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,q=R?this.getTotalSize():0,H=this.getScrollOffset()+this.scrollAdjustments,lt=!this.itemSizeCache.has(g)?d[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const f=[];for(let c=0,p=i.length;cthis.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const f=this._flatMeasurements,c=this.options.lanes===1&&f!=null,p=nh(0,o.length-1,c?d=>f[d*2]:d=>Id(o[d]).start,i);return Id(o[p])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,f=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),p=this.getScrollOffset();o==="auto"&&(o=i>=p+c?"end":"start"),o==="center"?i+=(f-c)/2:o==="end"&&(i-=c);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const f=this.getSize(),c=this.getScrollOffset(),p=this.measurementsCache[i];if(!p)return;if(o==="auto")if(p.end>=c+f-this.options.scrollPaddingEnd)o="end";else if(p.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?p.end+this.options.scrollPaddingEnd:p.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,p.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),p=this.now();this.scrollState={index:null,align:o,behavior:f,startedAt:p,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[p,d]=c,g=this.now();this.scrollState={index:i,align:d,behavior:f,startedAt:g,lastTargetOffset:p,stableFrames:0},this._scrollToOffset(p,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const f=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let f;if(o.length===0)f=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,p=this._flatMeasurements;p!=null?f=p[c*2]+p[c*2+1]:f=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let p=o.length-1;for(;p>=0&&c.some(d=>d===null);){const d=o[p];c[d.lane]===null&&(c[d.lane]=d.end),p--}f=Math.max(...c.filter(d=>d!==null))}return Math.max(f-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const f of o)f&&this.itemSizeCache.has(f.key)&&i.push({index:f.index,key:f.key,start:f.start,size:f.size,end:f.end,lane:f.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:f})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:f,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Cc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,f=o?o[0]:this.scrollState.lastTargetOffset,c=1,p=f!==this.scrollState.lastTargetOffset;if(!p&&cp(f,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==f&&this._scrollToOffset(f,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,p){const d=this.getSize()||600,g=Math.abs(f-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&g>d;this.scrollState.lastTargetOffset=f,m||(this.scrollState.behavior="auto"),this._scrollToOffset(f,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const nh=(y,a,i,o)=>{for(;y<=a;){const f=(y+a)/2|0,c=i(f);if(co)a=f-1;else return f}return y>0?y-1:0};function Sp(y,a,i){let o=0;for(;o<=a;){const f=(o+a)/2|0,c=y[f*2];if(ci)a=f-1;else return f}return o>0?o-1:0}function Tp(y,a,i,o,f){const c=y.length-1;if(y.length<=o)return{startIndex:0,endIndex:c};if(o===1&&f!==null){const m=Sp(f,c,i);let z=m;const _=i+a;for(;zy[m].start,i),g=d;if(o===1)for(;g1){const m=Array(o).fill(0);for(;g_=0&&z.some(_=>_>=i);){const _=y[d];z[_.lane]=_.start,d--}d=Math.max(0,d-d%o),g=Math.min(c,g+(o-1-g%o))}return{startIndex:d,endIndex:g}}const Lc=typeof document<"u"?Z.useLayoutEffect:Z.useEffect;function kp({useFlushSync:y=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const f=Z.useReducer(z=>z+1,0)[1],c=Z.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const p=z=>{const _=c.current;if(!_.enabled||!_.container)return;const R=z.getTotalSize();if(R!==_.lastSize){_.lastSize=R;const q=z.options.horizontal?"width":"height";_.container.style[q]=`${R}px`}},d=z=>{const _=c.current;if(!_.enabled||!_.container)return;p(z);const R=!!z.options.horizontal,q=_.mode==="transform",H=R?"left":"top",G=z.options.scrollMargin,lt=z.getVirtualItems();for(const Q of lt){const K=Q.start-G,I=z.elementsCache.get(Q.key);I&&_.lastPositions.get(I)!==K&&(_.lastPositions.set(I,K),q?I.style.transform=R?`translate3d(${K}px, 0, 0)`:`translate3d(0, ${K}px, 0)`:I.style[H]=`${K}px`)}},g={...o,onChange:(z,_)=>{var R;const q=c.current;let H=!0;if(q.enabled){d(z);const G=z.range,lt=q.prevRange;H=!lt||lt.isScrolling!==z.isScrolling||lt.startIndex!==G?.startIndex||lt.endIndex!==G?.endIndex,H&&(q.prevRange=G?{startIndex:G.startIndex,endIndex:G.endIndex,isScrolling:z.isScrolling}:null)}H&&(y&&_?wm.flushSync(f):f()),(R=o.onChange)==null||R.call(o,z,_)}},[m]=Z.useState(()=>{const z=new bp(g);return Object.assign(z,{containerRef:_=>{const R=c.current;if(R.container=_,R.lastSize=null,_&&R.enabled){const q=z.getTotalSize();R.lastSize=q;const H=z.options.horizontal?"width":"height";_.style[H]=`${q}px`}}})});return m.setOptions(g),Lc(()=>m._didMount(),[]),Lc(()=>(p(m),m._willUpdate())),Lc(()=>{d(m)}),m}function zp(y){return kp({observeElementRect:dp,observeElementOffset:mp,scrollToFn:vp,...y})}function ja({value:y,depth:a=0}){return y===null?v.jsx("span",{className:"value-null",children:"null"}):typeof y=="string"?v.jsx("span",{className:"value-string",children:y}):typeof y=="number"||typeof y=="boolean"?v.jsx("span",{className:"value-scalar",children:String(y)}):Array.isArray(y)?v.jsx("ol",{className:"value-list",children:y.map((i,o)=>v.jsx("li",{children:v.jsx(ja,{value:i,depth:a+1})},`${a}-${o}`))}):Qn(y)?y.kind==="predict_rlm_file"&&typeof y.path=="string"?v.jsxs("span",{className:"file-value",title:"Reported host path; contents are not copied",children:[v.jsx("span",{"aria-hidden":"true",children:"↗"}),v.jsxs("span",{children:[v.jsx("small",{children:"PredictRLM file"}),v.jsx("code",{children:y.path})]})]}):y.kind==="unavailable"&&typeof y.reason=="string"?v.jsxs("span",{className:"value-unavailable",children:["Unavailable · ",y.reason]}):v.jsx("dl",{className:"value-object",children:Object.entries(y).map(([i,o])=>v.jsxs("div",{children:[v.jsx("dt",{children:i}),v.jsx("dd",{children:v.jsx(ja,{value:o,depth:a+1})})]},i))}):v.jsx("span",{className:"value-unavailable",children:"Unavailable"})}function Hc({value:y}){return v.jsx("pre",{className:"json-block",children:JSON.stringify(y,null,2)})}function Ep(y){if(Qn(y))return Qn(y.data)?y.data:y}function Ap({api:y,workflow:a,run:i,nodeId:o,liveEvents:f=[],liveLogs:c=[],onClose:p}){const[d,g]=Z.useState("overview"),[m,z]=Z.useState([]),[_,R]=Z.useState([]),[q,H]=Z.useState(),[G,lt]=Z.useState(),[Q,K]=Z.useState(),[I,rt]=Z.useState(!0),it=Z.useRef(new Map),wt=Z.useRef(null),ut=i?.nodes.find(L=>L.nodeId===o),bt=a?th(a.agentMetadataJson[o??""]):void 0;Z.useEffect(()=>{if(g("overview"),z([]),R([]),H(void 0),lt(void 0),rt(!0),it.current.clear(),!i||!o)return;let L=!0;return Promise.all([y.listAgentEvents(i,o),y.listLogs(i)]).then(([O,U])=>{L&&(z(O),R(U.filter(V=>!V.nodeId||V.nodeId===o)))}).catch(O=>{L&&K(O instanceof Error?O.message:"Details unavailable")}),()=>{L=!1}},[y,o,i]);const Kt=Z.useMemo(()=>{const L=new Map;for(const O of[...m,...f])L.set(O.eventSequence,O);return[...L.values()].sort((O,U)=>Number(O.eventSequence)-Number(U.eventSequence))},[m,f]),Lt=Kt.filter(L=>L.eventKind==="iteration.recorded"),Qt=Z.useMemo(()=>{const L=new Map;for(const O of[..._,...c])L.set(O.sequence,O);return[...L.values()].sort((O,U)=>Number(O.sequence)-Number(U.sequence))},[c,_]),Ut=zp({count:Lt.length,getScrollElement:()=>wt.current,estimateSize:()=>64,overscan:6});if(Z.useEffect(()=>{!I||!Lt.length||H(Lt.at(-1).eventSequence)},[I,Lt]),Z.useEffect(()=>{const L=Kt.find(V=>V.eventSequence===q);if(!L?.bodyToken){lt(void 0);return}const O=it.current.get(L.bodyToken);if(O!==void 0){lt(O);return}let U=!0;return lt(void 0),K(void 0),y.readDetail(L.bodyToken).then(V=>{if(U){for(it.current.delete(L.bodyToken),it.current.set(L.bodyToken,V);it.current.size>8;){const gt=it.current.keys().next().value;if(gt===void 0)break;it.current.delete(gt)}lt(V)}}).catch(V=>{U&&K(V instanceof Error?V.message:"Detail unavailable")}),()=>{U=!1}},[y,Kt,q]),Z.useEffect(()=>{const L=d==="inputs"?"run.started":d==="output"?"run.succeeded":void 0;if(!L)return;const O=[...Kt].reverse().find(U=>U.eventKind===L);O&&H(O.eventSequence)},[Kt,d]),!i&&a&&o)return v.jsxs("aside",{className:"inspector","aria-label":"Node declaration",children:[v.jsxs("header",{children:[v.jsxs("div",{children:[v.jsx("span",{className:"eyebrow",children:"Declaration"}),v.jsx("h2",{children:a.displayNames[o]||o})]}),v.jsx("button",{type:"button",className:"icon-button",onClick:p,"aria-label":"Close",children:"×"})]}),bt?v.jsxs("div",{className:"inspector-body declaration",children:[v.jsxs("section",{children:[v.jsx("h3",{children:"Instructions"}),v.jsx("p",{className:"instructions",children:bt.instructions||"No instructions"})]}),v.jsxs("section",{className:"signature-columns",children:[v.jsxs("div",{children:[v.jsx("h3",{children:"Inputs"}),bt.inputs.map(L=>v.jsxs("div",{className:"field-detail",children:[v.jsx("strong",{children:L.name}),v.jsx("code",{children:L.type}),v.jsx("p",{children:L.description})]},L.name))]}),v.jsxs("div",{children:[v.jsx("h3",{children:"Outputs"}),bt.outputs.map(L=>v.jsxs("div",{className:"field-detail",children:[v.jsx("strong",{children:L.name}),v.jsx("code",{children:L.type}),v.jsx("p",{children:L.description})]},L.name))]})]}),v.jsxs("section",{children:[v.jsx("h3",{children:"Runtime"}),v.jsx(Hc,{value:bt.runtime})]}),v.jsxs("section",{children:[v.jsx("h3",{children:"Models"}),v.jsx(Hc,{value:bt.model})]}),v.jsxs("section",{children:[v.jsx("h3",{children:"Skills & tools"}),v.jsx(Hc,{value:{skills:bt.skills,tools:bt.tools}})]})]}):v.jsx("p",{className:"empty-copy",children:"This node has no agent declaration metadata."})]});if(!i||!ut)return null;const Zt=Ep(G),he=d==="inputs"?"inputs":"outputs";return v.jsxs("aside",{className:"inspector","aria-label":"Run inspector",children:[v.jsxs("header",{children:[v.jsxs("div",{children:[v.jsx("span",{className:"eyebrow",children:"Historical execution"}),v.jsx("h2",{children:ut.name}),v.jsx("span",{className:`status-pill status-${ut.status}`,children:ut.status})]}),v.jsx("button",{type:"button",className:"icon-button",onClick:p,"aria-label":"Close",children:"×"})]}),v.jsx("nav",{className:"inspector-tabs","aria-label":"Run detail views",children:["overview","inputs","output","trace","logs"].map(L=>v.jsx("button",{type:"button",className:d===L?"active":"",onClick:()=>g(L),children:L},L))}),v.jsxs("div",{className:"inspector-body",children:[Q&&v.jsx("p",{className:"error-banner",children:Q}),d==="overview"&&v.jsxs(v.Fragment,{children:[v.jsxs("section",{className:"metric-grid",children:[v.jsxs("div",{children:[v.jsx("small",{children:"Status"}),v.jsx("strong",{children:ut.status})]}),v.jsxs("div",{children:[v.jsx("small",{children:"Revision"}),v.jsx("strong",{children:ut.revision})]}),v.jsxs("div",{children:[v.jsx("small",{children:"Started"}),v.jsx("strong",{children:ut.startedAt?"yes":"—"})]}),v.jsxs("div",{children:[v.jsx("small",{children:"Duration"}),v.jsx("strong",{children:ut.startedAt&&ut.endedAt?`${Math.max(0,ut.endedAt-ut.startedAt).toFixed(2)}s`:"—"})]})]}),ut.error&&v.jsx("p",{className:"node-failure",children:ut.error}),ut.trace&&v.jsxs("section",{children:[v.jsx("h3",{children:"Trace header"}),v.jsxs("dl",{className:"trace-header",children:[v.jsxs("div",{children:[v.jsx("dt",{children:"Status"}),v.jsx("dd",{children:ut.trace.status})]}),v.jsxs("div",{children:[v.jsx("dt",{children:"Events"}),v.jsx("dd",{children:ut.trace.eventCount})]}),v.jsxs("div",{children:[v.jsx("dt",{children:"Size"}),v.jsxs("dd",{children:[ut.trace.sizeBytes," B"]})]}),v.jsxs("div",{children:[v.jsx("dt",{children:"Complete"}),v.jsx("dd",{children:ut.trace.complete?"yes":"no"})]})]})]})]}),(d==="inputs"||d==="output")&&v.jsxs("section",{children:[v.jsx("h3",{children:d==="inputs"?"Invocation inputs":"Terminal output"}),Zt&&he in Zt?v.jsx(ja,{value:Zt[he]}):v.jsxs("p",{className:"empty-copy",children:["No retained ",d," are available."]})]}),d==="trace"&&v.jsxs("section",{className:"trace-layout",children:[v.jsxs("div",{className:"trace-toolbar",children:[v.jsxs("div",{children:[v.jsx("h3",{children:"RunTrace"}),v.jsxs("span",{children:[Lt.length," complete turns"]})]}),v.jsx("button",{type:"button",className:I?"toggle active":"toggle",onClick:()=>rt(L=>!L),children:I?"Following live":"Follow latest"})]}),v.jsx("div",{className:"turn-list",ref:wt,children:v.jsx("div",{style:{height:Ut.getTotalSize(),position:"relative"},children:Ut.getVirtualItems().map(L=>{const O=Lt[L.index];return v.jsxs("button",{type:"button",className:`turn-row ${q===O.eventSequence?"active":""} ${O.error?"failed":""}`,style:{transform:`translateY(${L.start}px)`},onClick:()=>{rt(!1),H(O.eventSequence)},children:[v.jsxs("strong",{children:["Turn ",O.iteration??L.index+1]}),v.jsx("span",{children:O.durationMs?`${O.durationMs} ms`:"—"}),v.jsxs("small",{children:[O.toolCount," tools · ",O.predictCount," predicts"]})]},O.eventSequence)})})}),v.jsx("div",{className:"turn-detail",children:G!==void 0?v.jsx(ja,{value:G}):v.jsx("p",{className:"empty-copy",children:"Select a turn."})})]}),d==="logs"&&v.jsxs("section",{children:[v.jsx("h3",{children:"Node logs"}),v.jsx("div",{className:"log-list",children:Qt.map(L=>v.jsxs("button",{type:"button",onClick:()=>{y.readDetail(L.bodyToken).then(lt).catch(O=>{K(O instanceof Error?O.message:"Log unavailable")})},children:[v.jsx("span",{className:`log-level level-${L.level}`,children:L.level}),v.jsx("time",{children:new Date(L.timestamp*1e3).toLocaleTimeString()}),v.jsxs("span",{children:["#",L.sequence]})]},L.sequence))}),G!==void 0&&v.jsx(ja,{value:G})]})]})]})}function Np({value:y,onChange:a}){const i=Z.useRef(null);return Z.useEffect(()=>{if(!i.current)return;const o=new Ii({parent:i.current,state:qm.create({doc:y,extensions:[Cm(),Lm.of([]),Ii.lineWrapping,Ii.theme({"&":{backgroundColor:"#0e1112",color:"#dce4df"},".cm-content":{caretColor:"#eeff8c",minHeight:"110px"},".cm-gutters":{backgroundColor:"#0e1112",color:"#626b67",border:"0"},"&.cm-focused":{outline:"1px solid #778357"}}),Ii.updateListener.of(f=>{f.docChanged&&a(f.state.doc.toString())})]})});return()=>o.destroy()},[]),v.jsx("div",{className:"json-editor",ref:i})}function Op({workflow:y,run:a,pending:i,onStart:o,onCancel:f}){const[c,p]=Z.useState(!1),[d,g]=Z.useState("{}"),[m,z]=Z.useState(),_=a?.summary?.status==="pending"||a?.summary?.status==="running",R=async()=>{if(!y)return;z(void 0);let q;if(c)try{const H=JSON.parse(d);if(!Qn(H))throw new Error("Run input must be a JSON object");q=H}catch(H){z(H instanceof Error?H.message:"Run input is invalid JSON");return}try{await o(y.workflowId,q)}catch(H){z(H instanceof Error?H.message:"Operator rejected the run")}};return v.jsxs("div",{className:"run-controls",children:[y&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",className:"run-button",disabled:i?.kind==="start",onClick:()=>{R()},children:i?.kind==="start"?"Requesting…":"Run"}),v.jsx("button",{type:"button",className:`input-toggle ${c?"active":""}`,onClick:()=>p(q=>!q),children:c?"Hide JSON input":"Add JSON input"})]}),_&&a?.summary&&v.jsx("button",{type:"button",className:"cancel-button",disabled:i?.kind==="cancel",onClick:()=>{z(void 0),f(a.summary.runId).catch(q=>{z(q instanceof Error?q.message:"Cancellation failed")})},children:i?.kind==="cancel"?"Cancelling…":"Cancel run"}),c&&y&&v.jsxs("div",{className:"input-popover",children:[v.jsxs("div",{children:[v.jsx("strong",{children:"Workflow input"}),v.jsx("span",{children:"Schema-blind JSON object"})]}),v.jsx(Np,{value:d,onChange:g})]}),m&&v.jsx("div",{className:"action-error",children:m})]})}const lh={runs:{},liveEvents:{},liveLogs:{},operatorInstanceId:"",sequence:"0",connection:"connecting"};function Dp(y,a){if(a.type==="baseline"){const g=Object.fromEntries(a.baseline.runs.filter(m=>m.summary).map(m=>[m.summary.runId,m]));return{...lh,catalog:a.baseline.catalog,runs:g,operatorInstanceId:a.baseline.catalog.operatorInstanceId,sequence:a.baseline.asOfSequence,connection:"live"}}if(a.type==="connection")return{...y,connection:a.connection,error:a.error};if(a.type==="action")return{...y,action:a.action};const{envelope:i}=a;if(i.operatorInstanceId!==y.operatorInstanceId)throw new Error("Operator epoch changed");if(i.payload.oneofKind!=="update")throw new Error("Operator requested a structural reset");const o=i.payload.update;if(BigInt(o.sequence)!==BigInt(y.sequence)+1n)throw new Error(`Operator update gap after sequence ${y.sequence}`);const f={...y,sequence:o.sequence,error:void 0},c=o.change;if(c.oneofKind==="catalogReplaced")return c.catalogReplaced.catalog&&(f.catalog=c.catalogReplaced.catalog),f;if(c.oneofKind==="runCreated"&&c.runCreated.summary){const g=c.runCreated.summary;return f.runs={...y.runs,[g.runId]:{operatorInstanceId:y.operatorInstanceId,asOfSequence:o.sequence,summary:g,nodes:c.runCreated.nodes,latestLogSequence:"0",logPageToken:"",topology:c.runCreated.topology}},f}const p=c.oneofKind==="runStatusChanged"?c.runStatusChanged.runId:c.oneofKind==="nodeStatusChanged"?c.nodeStatusChanged.runId:c.oneofKind==="logAppended"?c.logAppended.runId:c.oneofKind==="agentEventAppended"?c.agentEventAppended.runId:c.oneofKind==="traceFinalized"?c.traceFinalized.runId:"",d=y.runs[p];if(!d)throw new Error(`Operator update referenced unknown run ${p}`);if(c.oneofKind==="runStatusChanged"&&d.summary)f.runs={...y.runs,[p]:{...d,summary:{...d.summary,status:c.runStatusChanged.status,startedAt:c.runStatusChanged.startedAt,endedAt:c.runStatusChanged.endedAt,revision:c.runStatusChanged.revision}}};else if(c.oneofKind==="nodeStatusChanged"){const g=c.nodeStatusChanged;f.runs={...y.runs,[p]:{...d,nodes:d.nodes.map(m=>m.nodeId===g.nodeId?{...m,status:g.status,startedAt:g.startedAt,endedAt:g.endedAt,revision:g.revision,error:g.error}:m)}}}else if(c.oneofKind==="logAppended"&&c.logAppended.log)f.liveLogs={...y.liveLogs,[p]:[...y.liveLogs[p]??[],c.logAppended.log]};else if(c.oneofKind==="agentEventAppended"&&c.agentEventAppended.event){const g=`${p}:${c.agentEventAppended.nodeId}`;f.liveEvents={...y.liveEvents,[g]:[...y.liveEvents[g]??[],c.agentEventAppended.event]}}else c.oneofKind==="traceFinalized"&&c.traceFinalized.trace&&(f.runs={...y.runs,[p]:{...d,nodes:d.nodes.map(g=>g.nodeId===c.traceFinalized.nodeId?{...g,trace:c.traceFinalized.trace}:g)}});return f}function xp(y){const[a,i]=Z.useReducer(Dp,lh),o=Z.useRef(0),f=Z.useCallback(async()=>{const d=await y.loadBaseline();return i({type:"baseline",baseline:d}),d},[y]);Z.useEffect(()=>{const d=++o.current;let g=!1;return(async()=>{let z=250;for(;!g&&o.current===d;)try{i({type:"connection",connection:"connecting"});const _=await y.loadBaseline();if(g)return;i({type:"baseline",baseline:_}),z=250;let R=_.asOfSequence;for await(const q of y.streamUpdates(_.catalog.operatorInstanceId,R)){if(g)return;if(q.payload.oneofKind!=="update"||BigInt(q.payload.update.sequence)!==BigInt(R)+1n)break;i({type:"envelope",envelope:q}),R=q.payload.update.sequence}i({type:"connection",connection:"reconnecting"})}catch(_){if(g)return;i({type:"connection",connection:"reconnecting",error:_ instanceof Error?_.message:"Operator connection failed"});const{promise:R,resolve:q}=Promise.withResolvers();window.setTimeout(q,z),await R,z=Math.min(z*2,4e3)}})(),()=>{g=!0,o.current+=1}},[y]);const c=Z.useCallback(async(d,g)=>{i({type:"action",action:{kind:"start",target:d}});try{return await y.startRun(d,g)}finally{i({type:"action",action:void 0})}},[y]),p=Z.useCallback(async d=>{i({type:"action",action:{kind:"cancel",target:d}});try{await y.cancelRun(d)}finally{i({type:"action",action:void 0})}},[y]);return{state:a,reconcile:f,startRun:c,cancelRun:p}}function _p({api:y}){const{state:a,startRun:i,cancelRun:o}=xp(y),[f,c]=Z.useState(),[p,d]=Z.useState();Z.useEffect(()=>{const G=a.catalog?.workflows??[];if(!G.length){c(void 0);return}if(!f){c({kind:"workflow",workflowId:G[0].workflowId});return}G.some(lt=>lt.workflowId===f.workflowId)||c({kind:"workflow",workflowId:G[0].workflowId})},[f,a.catalog]);const g=a.catalog?.workflows.find(G=>G.workflowId===f?.workflowId),m=f?.kind==="run"?a.runs[f.runId]:void 0,z=Z.useMemo(()=>Object.values(a.runs).filter(G=>G.summary?.workflowId===g?.workflowId).sort((G,lt)=>Number(lt.summary.createdSequence)-Number(G.summary.createdSequence))[0],[a.runs,g?.workflowId]),_=Z.useCallback(G=>d(G),[]),R=Z.useCallback(G=>{c(G),d(void 0)},[]),q=m??(f?.kind==="workflow"?z:void 0),H=m&&p?`${m.summary?.runId}:${p}`:"";return v.jsxs("div",{className:"app-shell",children:[v.jsxs("header",{className:"topbar",children:[v.jsxs("div",{className:"brand",children:[v.jsx("span",{className:"brand-mark","aria-hidden":"true",children:"A"}),v.jsxs("div",{children:[v.jsx("strong",{children:"Avalanche"}),v.jsx("span",{children:"Operator"})]})]}),v.jsxs("div",{className:"breadcrumb",children:[v.jsx("span",{children:g?.rootAlias||"Local operator"}),g&&v.jsxs(v.Fragment,{children:[v.jsx("i",{children:"/"}),v.jsx("strong",{children:g.displayName})]}),m?.summary&&v.jsxs(v.Fragment,{children:[v.jsx("i",{children:"/"}),v.jsx("strong",{children:m.summary.runId})]})]}),v.jsxs("div",{className:`connection connection-${a.connection}`,children:[v.jsx("span",{}),a.connection==="live"?"Live":a.connection,v.jsxs("small",{children:["seq ",a.sequence]})]})]}),a.error&&v.jsx("div",{className:"connection-error",children:a.error}),v.jsxs("main",{className:`workspace ${p?"with-inspector":""}`,children:[v.jsx(lp,{catalog:a.catalog,runs:a.runs,selection:f,onSelect:R}),v.jsxs("section",{className:"canvas-shell",children:[v.jsxs("header",{className:"view-header",children:[v.jsxs("div",{children:[v.jsx("span",{className:"eyebrow",children:m?"Historical run":"Current definition"}),v.jsx("h1",{children:m?.summary?.runId||g?.displayName||"Operator"}),v.jsx("p",{children:m?`Recorded topology · ${m.summary?.status??"unknown"}`:g?`${g.nodeIds.length} nodes · ${g.relativeFile}`:"Waiting for a workflow catalog"})]}),v.jsx(Op,{workflow:m?void 0:g,run:m??q,pending:a.action,onStart:i,onCancel:o})]}),v.jsxs("div",{className:m?"canvas run-canvas":"canvas blueprint-canvas",children:[g||m?.topology?v.jsx(up,{workflow:m?void 0:g,runTopology:m?.topology,runNodes:m?.nodes,onOpenNode:_}):v.jsxs("div",{className:"empty-state",children:[v.jsx("span",{children:"◇"}),v.jsx("h2",{children:"No workflows discovered"}),v.jsx("p",{children:"Catalog changes will appear here as the operator scans configured targets."})]}),m&&v.jsxs("div",{className:"historical-badge",children:[v.jsx("span",{children:"Immutable run snapshot"}),"Current workflow changes do not alter this canvas"]})]})]}),p&&v.jsx(Ap,{api:y,workflow:g,run:m,nodeId:p,liveEvents:a.liveEvents[H],liveLogs:m?.summary?a.liveLogs[m.summary.runId]:void 0,onClose:()=>d(void 0)})]})]})}const ah=document.getElementById("root");if(!ah)throw new Error("Operator UI root element is missing");Xm.createRoot(ah).render(v.jsx(Z.StrictMode,{children:v.jsx(_p,{api:new Py})})); diff --git a/src/runtime/operator/web_assets/assets/index-BADaCtIl.css b/src/runtime/operator/web_assets/assets/index-BqN1_lQb.css similarity index 83% rename from src/runtime/operator/web_assets/assets/index-BADaCtIl.css rename to src/runtime/operator/web_assets/assets/index-BqN1_lQb.css index 9f2fccb..570e584 100644 --- a/src/runtime/operator/web_assets/assets/index-BADaCtIl.css +++ b/src/runtime/operator/web_assets/assets/index-BqN1_lQb.css @@ -1 +1 @@ -.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}:root{color:#dce4df;background:#0d1011;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;font-synthesis:none;--panel: #131718;--panel-raised: #181d1e;--line: rgba(217, 232, 224, .1);--muted: #87918d;--acid: #d9ed72;--mint: #79dab7;--amber: #f0bd68;--red: #f18378}*{box-sizing:border-box}html,body,#root{width:100%;height:100%;margin:0;overflow:hidden}button,input{font:inherit}button{color:inherit}code,pre,.eyebrow,small{font-family:DM Mono,monospace}.app-shell{height:100%;display:grid;grid-template-rows:58px auto 1fr}.topbar{display:grid;grid-template-columns:260px 1fr auto;align-items:center;padding:0 20px;border-bottom:1px solid var(--line);background:#101314;z-index:10}.brand{display:flex;align-items:center;gap:11px}.brand-mark{width:30px;height:30px;display:grid;place-items:center;color:#101314;background:var(--acid);font-weight:800;clip-path:polygon(50% 0,100% 100%,0 100%);padding-top:8px}.brand div{display:flex;align-items:baseline;gap:7px}.brand strong{font-size:15px;letter-spacing:-.02em}.brand span:last-child{color:var(--muted);font:11px DM Mono;text-transform:uppercase}.breadcrumb{display:flex;justify-content:center;gap:9px;color:var(--muted);font-size:12px}.breadcrumb i{opacity:.4}.breadcrumb strong{color:#cfd8d3;font-weight:500}.connection{display:flex;align-items:center;gap:8px;font:11px DM Mono;text-transform:capitalize}.connection>span{width:7px;height:7px;border-radius:50%;background:var(--amber);box-shadow:0 0 10px var(--amber)}.connection-live>span{background:var(--mint);box-shadow:0 0 10px var(--mint)}.connection small{color:#59615e;margin-left:5px}.connection-error,.action-error,.error-banner{background:#4c2525;color:#ffd4cf;padding:8px 18px;font-size:12px;border-bottom:1px solid #813c37}.workspace{min-height:0;display:grid;grid-template-columns:280px minmax(0,1fr)}.workspace.with-inspector{grid-template-columns:280px minmax(0,1fr) 410px}.explorer{background:var(--panel);border-right:1px solid var(--line);overflow:auto;min-width:0}.explorer>header{padding:22px 18px 14px;position:relative}.eyebrow{display:block;color:var(--acid);font-size:9px;letter-spacing:.16em;text-transform:uppercase}h1,h2,h3,p{margin-top:0}.explorer h2{margin:5px 0 0;font-size:17px}.catalog-revision{position:absolute;right:18px;bottom:17px;color:#67706c;font:9px DM Mono}.target-list{padding:4px 10px 30px}.target{border-top:1px solid var(--line);padding-top:7px;margin-top:4px}.target-heading,.tree-row,.tree-select,.run-select{width:100%;min-width:0}.target-heading,.tree-select,.run-select,.tree-disclosure{background:none;border:0;cursor:pointer;text-align:left}.target-heading{display:grid;grid-template-columns:12px 22px minmax(0,1fr);gap:5px;align-items:center;padding:8px 5px}.target-heading>span:first-child{color:#5e6763}.target-kind{width:20px;height:20px;border:1px solid #49524e;border-radius:3px;display:grid;place-items:center;font:9px DM Mono;color:#a8b1ad}.target-heading strong,.target-heading small,.tree-select strong,.tree-select small,.run-select strong,.run-select small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.target-heading strong{font-size:11px;font-weight:600}.target-heading small{color:#5f6965;font-size:8px;margin-top:2px}.workflow-list{border-left:1px solid #303637;margin-left:16px;padding-left:7px}.tree-row{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:stretch}.tree-disclosure{color:#5f6865;text-align:center;padding:0}.tree-select{display:grid;grid-template-columns:23px minmax(0,1fr);gap:4px;padding:8px;border-radius:4px}.tree-select:hover,.run-select:hover,.tree-select.active,.run-select.active{background:#202627}.tree-select.active{box-shadow:inset 2px 0 var(--acid)}.workflow-glyph{color:var(--acid);font-size:16px}.tree-select strong{font-size:11px;font-weight:600}.tree-select small,.run-select small{color:#68716e;font-size:8px;margin-top:3px}.run-branches{margin-left:28px;border-left:1px dashed #303637;padding:3px 0 6px 8px}.run-select{display:grid;grid-template-columns:20px minmax(0,1fr);gap:5px;align-items:center;padding:7px;border-radius:4px}.run-select strong{font:9px DM Mono}.run-dot{width:16px;height:16px;border-radius:50%;display:grid;place-items:center;font:9px DM Mono;background:#252c2a;color:var(--muted)}.run-dot.status-success{color:var(--mint)}.run-dot.status-failed{color:var(--red)}.run-dot.status-running{color:var(--acid)}.no-runs{display:block;color:#525a57;padding:7px;font:8px DM Mono}.diagnostics{margin:0 12px 12px;padding:9px;background:#34291c;border:1px solid #5d472b;border-radius:4px;font-size:10px}.diagnostics summary{color:var(--amber);cursor:pointer}.diagnostics div{margin-top:9px;border-top:1px solid #5d472b;padding-top:8px}.diagnostics strong,.diagnostics span{display:block}.diagnostics span{color:#ac9473;font:8px DM Mono;overflow:hidden;text-overflow:ellipsis}.diagnostics p{color:#d4bd9b;margin:4px 0 0}.skeleton{padding:20px}.skeleton div{height:38px;background:#1b2021;margin-bottom:9px;animation:pulse 1.2s infinite alternate}@keyframes pulse{to{opacity:.45}}.canvas-shell{min-width:0;min-height:0;display:grid;grid-template-rows:auto 1fr;background:#0f1213}.view-header{min-height:92px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 24px;border-bottom:1px solid var(--line)}.view-header h1{margin:4px 0 2px;font-size:22px;letter-spacing:-.035em}.view-header p{margin:0;color:var(--muted);font-size:11px}.canvas{position:relative;min-height:0}.blueprint-canvas{background:radial-gradient(circle at 55% 35%,rgba(72,97,86,.14),transparent 45%),#0f1213}.run-canvas{background:radial-gradient(circle at 55% 35%,rgba(89,76,62,.13),transparent 45%),#111313}.react-flow__controls{background:#1b2021;border:1px solid var(--line);box-shadow:none}.react-flow__controls-button{background:#1b2021;border-bottom-color:var(--line);fill:#aeb8b3}.react-flow__controls-button:hover{background:#272e2f}.react-flow__edge-path{stroke:#66736d;stroke-width:1.4}.react-flow__arrowhead polyline{stroke:#66736d;fill:#66736d}.node-card{width:248px;min-height:102px;position:relative;display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:15px;text-align:left;background:#171c1d;border:1px solid #47514d;border-radius:6px;box-shadow:0 14px 30px #00000040;cursor:pointer}.node-card:hover{border-color:var(--acid);transform:translateY(-1px)}.node-card.blueprint{background:linear-gradient(145deg,#18201f,#15191a)}.node-card strong{font-size:13px}.node-kicker{color:#78827e;font:8px DM Mono;letter-spacing:.12em;text-transform:uppercase}.node-status{position:absolute;right:12px;top:12px;font:8px DM Mono;text-transform:uppercase;color:var(--muted)}.node-duration{color:var(--muted);font:9px DM Mono}.node-error{color:#ffaaa2;background:#762c2840;padding:5px;border-radius:3px;font-size:9px;max-height:42px;overflow:hidden}.node-card.status-success{border-color:#426b5c}.node-card.status-failed{border-color:#984d47}.node-card.status-running{border-color:#9aa64f;box-shadow:0 0 0 1px #d9ed721f,0 14px 30px #00000040}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:4px;border-top:1px solid var(--line);padding-top:8px}.field-grid>span{min-width:0}.field-grid small{display:block;color:#68726e;font-size:7px;text-transform:uppercase;margin-bottom:3px}.field{display:block;color:#b2bdb7;font:8px DM Mono;overflow:hidden;text-overflow:ellipsis}.react-flow__handle{width:7px;height:7px;background:var(--acid);border:1px solid #101314}.historical-badge{position:absolute;right:18px;bottom:18px;z-index:5;padding:9px 12px;background:#1a1815eb;border:1px solid #665642;color:#9d8f7c;font-size:9px;border-radius:4px}.historical-badge span{display:block;color:var(--amber);font:8px DM Mono;text-transform:uppercase;margin-bottom:3px}.empty-state{height:100%;display:grid;place-content:center;text-align:center;color:#66706c}.empty-state>span{color:var(--acid);font-size:40px}.empty-state h2{color:#c6cfca;margin:8px 0}.empty-state p{max-width:390px;font-size:12px}.inspector{min-width:0;background:var(--panel-raised);border-left:1px solid var(--line);overflow:hidden;display:grid;grid-template-rows:auto auto 1fr}.inspector>header{display:flex;justify-content:space-between;align-items:start;padding:19px 20px 14px;border-bottom:1px solid var(--line)}.inspector h2{margin:4px 0 5px;font-size:18px}.icon-button{width:30px;height:30px;background:none;border:1px solid var(--line);border-radius:4px;cursor:pointer;font-size:19px}.icon-button:hover{border-color:#69736f}.status-pill{display:inline-flex;padding:3px 7px;border:1px solid #48514e;border-radius:20px;color:var(--muted);font:8px DM Mono;text-transform:uppercase}.status-pill.status-failed{color:var(--red);border-color:#75413d}.status-pill.status-success{color:var(--mint);border-color:#355e50}.inspector-tabs{display:flex;overflow-x:auto;padding:0 10px;border-bottom:1px solid var(--line)}.inspector-tabs button{padding:11px 9px 9px;background:none;border:0;border-bottom:2px solid transparent;color:#727c77;font:8px DM Mono;text-transform:uppercase;cursor:pointer}.inspector-tabs button.active{color:var(--acid);border-bottom-color:var(--acid)}.inspector-body{overflow:auto;padding:18px 20px 30px}.inspector-body section{margin-bottom:23px}.inspector-body h3{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#a3ada8}.instructions{color:#c4cdc8;white-space:pre-wrap;font-size:12px;line-height:1.65}.signature-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px}.field-detail{border-top:1px solid var(--line);padding:8px 0}.field-detail strong,.field-detail code{display:block;font-size:10px}.field-detail code{color:#79837f;font-size:8px;margin-top:2px}.field-detail p{color:#78817d;font-size:9px;margin:4px 0 0}.json-block{padding:11px;background:#101415;border:1px solid var(--line);border-radius:4px;overflow:auto;color:#aab5af;font-size:9px;white-space:pre-wrap}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.metric-grid>div{background:#111516;border:1px solid var(--line);padding:10px}.metric-grid small,.metric-grid strong{display:block}.metric-grid small{color:#68716e;font-size:7px;text-transform:uppercase}.metric-grid strong{margin-top:5px;font-size:11px}.node-failure{padding:10px;background:#3a2020;border:1px solid #713d39;color:#ffc1ba;font-size:10px}.trace-header,.value-object{margin:0}.trace-header>div,.value-object>div{display:grid;grid-template-columns:105px minmax(0,1fr);gap:10px;border-top:1px solid var(--line);padding:7px 0}.trace-header dt,.value-object dt{color:#727c77;font:8px DM Mono}.trace-header dd,.value-object dd{margin:0;font-size:10px;min-width:0}.empty-copy{color:#69736e;font-size:11px}.trace-layout{display:grid;grid-template-rows:auto 220px auto;gap:12px}.trace-toolbar{display:flex;justify-content:space-between;align-items:center}.trace-toolbar h3{margin:0 0 3px}.trace-toolbar span{color:#69736e;font:8px DM Mono}.toggle{background:none;border:1px solid #48514d;color:#818b86;border-radius:20px;padding:5px 8px;font:8px DM Mono;cursor:pointer}.toggle.active{color:var(--acid);border-color:#77834a}.turn-list{height:220px;overflow:auto;border:1px solid var(--line);background:#111516}.turn-row{position:absolute;left:0;top:0;width:100%;height:60px;display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px;background:transparent;border:0;border-bottom:1px solid var(--line);text-align:left;cursor:pointer}.turn-row:hover,.turn-row.active{background:#202627}.turn-row.active{box-shadow:inset 2px 0 var(--acid)}.turn-row.failed{box-shadow:inset 2px 0 var(--red)}.turn-row strong{font-size:10px}.turn-row span,.turn-row small{color:#78817d;font:8px DM Mono}.turn-row small{grid-column:1 / -1}.turn-detail{border-top:1px solid var(--line);padding-top:12px}.value-object .value-object{border-left:1px solid #313837;padding-left:8px}.value-string{color:#c4d99d;white-space:pre-wrap;overflow-wrap:anywhere}.value-scalar{color:#82c8cc}.value-null{color:#68716e}.value-unavailable{color:var(--amber);font-size:9px}.value-list{margin:0;padding-left:20px}.value-list li{margin:5px 0}.file-value{display:flex;gap:9px;padding:9px;border:1px solid #5f6441;background:#22251a;border-radius:4px;color:var(--acid)}.file-value small,.file-value code{display:block}.file-value small{color:#919976;font-size:7px;text-transform:uppercase}.file-value code{margin-top:3px;font-size:9px;overflow-wrap:anywhere}.log-list{margin-bottom:12px}.log-list button{width:100%;display:grid;grid-template-columns:48px 1fr auto;gap:7px;padding:7px 4px;border:0;border-bottom:1px solid var(--line);background:none;color:#929c97;text-align:left;font:8px DM Mono;cursor:pointer}.log-list button:hover{background:#202627}.log-level{text-transform:uppercase}.level-error{color:var(--red)}.level-warning{color:var(--amber)}.run-controls{display:flex;align-items:center;gap:7px;position:relative}.run-button,.cancel-button,.input-toggle{border-radius:4px;padding:8px 13px;cursor:pointer;font-size:10px}.run-button{background:var(--acid);border:1px solid var(--acid);color:#111412;font-weight:700}.cancel-button{background:#3a2221;border:1px solid #71403c;color:#f2a39b}.input-toggle{background:transparent;border:1px solid #3c4541;color:#89938e}.input-toggle.active{color:var(--acid);border-color:#6e7848}.run-controls button:disabled{opacity:.5;cursor:wait}.input-popover{position:absolute;z-index:20;right:0;top:43px;width:390px;padding:13px;background:#15191a;border:1px solid #4a5450;box-shadow:0 18px 50px #00000080}.input-popover>div:first-child{display:flex;justify-content:space-between;margin-bottom:9px}.input-popover strong{font-size:11px}.input-popover span{color:#6d7672;font:8px DM Mono}.json-editor{border:1px solid var(--line);font-size:10px}.action-error{position:absolute;z-index:21;right:0;top:44px;width:390px;border:1px solid #813c37}.input-popover+.action-error{top:205px}@media(max-width:1000px){.workspace,.workspace.with-inspector{grid-template-columns:230px minmax(0,1fr)}.inspector{position:fixed;z-index:30;right:0;top:58px;bottom:0;width:min(420px,calc(100vw - 230px));box-shadow:-20px 0 50px #00000073}.topbar{grid-template-columns:210px 1fr auto}}@media(max-width:700px){.workspace,.workspace.with-inspector{grid-template-columns:1fr}.explorer,.breadcrumb{display:none}.topbar{grid-template-columns:1fr auto}.view-header{align-items:flex-start;padding:13px 16px}.inspector{width:100vw;top:58px}.input-popover,.action-error{width:calc(100vw - 32px)}} +.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}:root{color:#dce4df;background:#0d1011;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;font-synthesis:none;--panel: #131718;--panel-raised: #181d1e;--line: rgba(217, 232, 224, .1);--muted: #87918d;--acid: #d9ed72;--mint: #79dab7;--amber: #f0bd68;--red: #f18378}*{box-sizing:border-box}html,body,#root{width:100%;height:100%;margin:0;overflow:hidden}button,input{font:inherit}button{color:inherit}code,pre,.eyebrow,small{font-family:DM Mono,monospace}.app-shell{height:100%;display:grid;grid-template-rows:58px auto 1fr}.topbar{display:grid;grid-template-columns:260px 1fr auto;align-items:center;padding:0 20px;border-bottom:1px solid var(--line);background:#101314;z-index:10}.brand{display:flex;align-items:center;gap:11px}.brand-mark{width:30px;height:30px;display:grid;place-items:center;color:#101314;background:var(--acid);font-weight:800;clip-path:polygon(50% 0,100% 100%,0 100%);padding-top:8px}.brand div{display:flex;align-items:baseline;gap:7px}.brand strong{font-size:15px;letter-spacing:-.02em}.brand span:last-child{color:var(--muted);font:11px DM Mono;text-transform:uppercase}.breadcrumb{display:flex;justify-content:center;gap:9px;color:var(--muted);font-size:12px}.breadcrumb i{opacity:.4}.breadcrumb strong{color:#cfd8d3;font-weight:500}.connection{display:flex;align-items:center;gap:8px;font:11px DM Mono;text-transform:capitalize}.connection>span{width:7px;height:7px;border-radius:50%;background:var(--amber);box-shadow:0 0 10px var(--amber)}.connection-live>span{background:var(--mint);box-shadow:0 0 10px var(--mint)}.connection small{color:#59615e;margin-left:5px}.connection-error,.action-error,.error-banner{background:#4c2525;color:#ffd4cf;padding:8px 18px;font-size:12px;border-bottom:1px solid #813c37}.workspace{min-height:0;display:grid;grid-template-columns:280px minmax(0,1fr)}.workspace.with-inspector{grid-template-columns:280px minmax(0,1fr) 410px}.explorer{background:var(--panel);border-right:1px solid var(--line);overflow:auto;min-width:0}.explorer>header{padding:22px 18px 14px;position:relative}.eyebrow{display:block;color:var(--acid);font-size:9px;letter-spacing:.16em;text-transform:uppercase}h1,h2,h3,p{margin-top:0}.explorer h2{margin:5px 0 0;font-size:17px}.catalog-revision{position:absolute;right:18px;bottom:17px;color:#67706c;font:9px DM Mono}.target-list{padding:4px 10px 30px}.target{border-top:1px solid var(--line);padding-top:7px;margin-top:4px}.target-heading,.tree-row,.tree-select,.run-select{width:100%;min-width:0}.target-heading,.tree-select,.run-select,.tree-disclosure{background:none;border:0;cursor:pointer;text-align:left}.target-heading{display:grid;grid-template-columns:12px 22px minmax(0,1fr);gap:5px;align-items:center;padding:8px 5px}.target-heading>span:first-child{color:#5e6763}.target-kind{width:20px;height:20px;border:1px solid #49524e;border-radius:3px;display:grid;place-items:center;font:9px DM Mono;color:#a8b1ad}.target-heading strong,.target-heading small,.tree-select strong,.tree-select small,.run-select strong,.run-select small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.target-heading strong{font-size:11px;font-weight:600}.target-heading small{color:#5f6965;font-size:8px;margin-top:2px}.workflow-list{border-left:1px solid #303637;margin-left:16px;padding-left:7px}.tree-row{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:stretch}.tree-disclosure{color:#5f6865;text-align:center;padding:0}.tree-select{display:grid;grid-template-columns:23px minmax(0,1fr);gap:4px;padding:8px;border-radius:4px}.tree-select:hover,.run-select:hover,.tree-select.active,.run-select.active{background:#202627}.tree-select.active{box-shadow:inset 2px 0 var(--acid)}.workflow-glyph{color:var(--acid);font-size:16px}.tree-select strong{font-size:11px;font-weight:600}.tree-select small,.run-select small{color:#68716e;font-size:8px;margin-top:3px}.run-branches{margin-left:28px;border-left:1px dashed #303637;padding:3px 0 6px 8px}.run-select{display:grid;grid-template-columns:20px minmax(0,1fr);gap:5px;align-items:center;padding:7px;border-radius:4px}.run-select strong{font:9px DM Mono}.run-dot{width:16px;height:16px;border-radius:50%;display:grid;place-items:center;font:9px DM Mono;background:#252c2a;color:var(--muted)}.run-dot.status-success{color:var(--mint)}.run-dot.status-failed{color:var(--red)}.run-dot.status-running{color:var(--acid)}.no-runs{display:block;color:#525a57;padding:7px;font:8px DM Mono}.diagnostics{margin:0 12px 12px;padding:9px;background:#34291c;border:1px solid #5d472b;border-radius:4px;font-size:10px}.diagnostics summary{color:var(--amber);cursor:pointer}.diagnostics div{margin-top:9px;border-top:1px solid #5d472b;padding-top:8px}.diagnostics strong,.diagnostics span{display:block}.diagnostics span{color:#ac9473;font:8px DM Mono;overflow:hidden;text-overflow:ellipsis}.diagnostics p{color:#d4bd9b;margin:4px 0 0}.skeleton{padding:20px}.skeleton div{height:38px;background:#1b2021;margin-bottom:9px;animation:pulse 1.2s infinite alternate}@keyframes pulse{to{opacity:.45}}.canvas-shell{min-width:0;min-height:0;display:grid;grid-template-rows:auto 1fr;background:#0f1213}.view-header{min-height:92px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 24px;border-bottom:1px solid var(--line)}.view-header h1{margin:4px 0 2px;font-size:22px;letter-spacing:-.035em}.view-header p{margin:0;color:var(--muted);font-size:11px}.canvas{position:relative;min-height:0}.blueprint-canvas{background:radial-gradient(circle at 55% 35%,rgba(72,97,86,.14),transparent 45%),#0f1213}.run-canvas{background:radial-gradient(circle at 55% 35%,rgba(89,76,62,.13),transparent 45%),#111313}.react-flow__controls{background:#1b2021;border:1px solid var(--line);box-shadow:none}.react-flow__controls-button{background:#1b2021;border-bottom-color:var(--line);fill:#aeb8b3}.react-flow__controls-button:hover{background:#272e2f}.react-flow__edge-path{stroke:#66736d;stroke-width:1.4}.react-flow__arrowhead polyline{stroke:#66736d;fill:#66736d}.node-card{width:248px;min-height:102px;position:relative;display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:15px;text-align:left;background:#171c1d;border:1px solid #47514d;border-radius:6px;box-shadow:0 14px 30px #00000040;cursor:pointer}.node-card:hover{border-color:var(--acid);transform:translateY(-1px)}.node-card.blueprint{background:linear-gradient(145deg,#18201f,#15191a)}.node-card strong{font-size:13px}.node-kicker{color:#78827e;font:8px DM Mono;letter-spacing:.12em;text-transform:uppercase}.node-status{position:absolute;right:12px;top:12px;font:8px DM Mono;text-transform:uppercase;color:var(--muted)}.node-duration{color:var(--muted);font:9px DM Mono}.node-error{color:#ffaaa2;background:#762c2840;padding:5px;border-radius:3px;font-size:9px;max-height:42px;overflow:hidden}.node-card.status-success{border-color:#426b5c}.node-card.status-failed{border-color:#984d47}.node-card.status-running{border-color:#9aa64f;box-shadow:0 0 0 1px #d9ed721f,0 14px 30px #00000040}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:4px;border-top:1px solid var(--line);padding-top:8px}.field-grid>span{min-width:0}.field-grid small{display:block;color:#68726e;font-size:7px;text-transform:uppercase;margin-bottom:3px}.field{display:block;color:#b2bdb7;font:8px DM Mono;overflow:hidden;text-overflow:ellipsis}.react-flow__handle{width:7px;height:7px;background:var(--acid);border:1px solid #101314}.historical-badge{position:absolute;right:18px;bottom:18px;z-index:5;padding:9px 12px;background:#1a1815eb;border:1px solid #665642;color:#9d8f7c;font-size:9px;border-radius:4px}.historical-badge span{display:block;color:var(--amber);font:8px DM Mono;text-transform:uppercase;margin-bottom:3px}.empty-state{height:100%;display:grid;place-content:center;text-align:center;color:#66706c}.empty-state>span{color:var(--acid);font-size:40px}.empty-state h2{color:#c6cfca;margin:8px 0}.empty-state p{max-width:390px;font-size:12px}.inspector{min-width:0;background:var(--panel-raised);border-left:1px solid var(--line);overflow:hidden;display:grid;grid-template-rows:auto auto 1fr}.inspector>header{display:flex;justify-content:space-between;align-items:start;padding:19px 20px 14px;border-bottom:1px solid var(--line)}.inspector h2{margin:4px 0 5px;font-size:18px}.icon-button{width:30px;height:30px;background:none;border:1px solid var(--line);border-radius:4px;cursor:pointer;font-size:19px}.icon-button:hover{border-color:#69736f}.status-pill{display:inline-flex;padding:3px 7px;border:1px solid #48514e;border-radius:20px;color:var(--muted);font:8px DM Mono;text-transform:uppercase}.status-pill.status-failed{color:var(--red);border-color:#75413d}.status-pill.status-success{color:var(--mint);border-color:#355e50}.inspector-tabs{display:flex;overflow-x:auto;padding:0 10px;border-bottom:1px solid var(--line)}.inspector-tabs button{padding:11px 9px 9px;background:none;border:0;border-bottom:2px solid transparent;color:#727c77;font:8px DM Mono;text-transform:uppercase;cursor:pointer}.inspector-tabs button.active{color:var(--acid);border-bottom-color:var(--acid)}.inspector-body{overflow:auto;padding:18px 20px 30px}.inspector-body section{margin-bottom:23px}.inspector-body h3{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#a3ada8}.instructions{color:#c4cdc8;white-space:pre-wrap;font-size:12px;line-height:1.65}.signature-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px}.field-detail{border-top:1px solid var(--line);padding:8px 0}.field-detail strong,.field-detail code{display:block;font-size:10px}.field-detail code{color:#79837f;font-size:8px;margin-top:2px}.field-detail p{color:#78817d;font-size:9px;margin:4px 0 0}.declared-fields{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:10px}.declared-fields>small{width:100%;color:#69736e;font-size:8px;text-transform:uppercase}.declared-fields>span{display:inline-flex;gap:5px;padding:4px 6px;border:1px solid var(--line);background:#111516;font-size:9px}.declared-fields code{color:#77837d}.json-block{padding:11px;background:#101415;border:1px solid var(--line);border-radius:4px;overflow:auto;color:#aab5af;font-size:9px;white-space:pre-wrap}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.metric-grid>div{background:#111516;border:1px solid var(--line);padding:10px}.metric-grid small,.metric-grid strong{display:block}.metric-grid small{color:#68716e;font-size:7px;text-transform:uppercase}.metric-grid strong{margin-top:5px;font-size:11px}.node-failure{padding:10px;background:#3a2020;border:1px solid #713d39;color:#ffc1ba;font-size:10px}.trace-header,.value-object{margin:0}.trace-header>div,.value-object>div{display:grid;grid-template-columns:105px minmax(0,1fr);gap:10px;border-top:1px solid var(--line);padding:7px 0}.trace-header dt,.value-object dt{color:#727c77;font:8px DM Mono}.trace-header dd,.value-object dd{margin:0;font-size:10px;min-width:0}.empty-copy{color:#69736e;font-size:11px}.trace-layout{display:grid;grid-template-rows:auto 220px auto;gap:12px}.trace-toolbar{display:flex;justify-content:space-between;align-items:center}.trace-toolbar h3{margin:0 0 3px}.trace-toolbar span{color:#69736e;font:8px DM Mono}.toggle{background:none;border:1px solid #48514d;color:#818b86;border-radius:20px;padding:5px 8px;font:8px DM Mono;cursor:pointer}.toggle.active{color:var(--acid);border-color:#77834a}.turn-list{height:220px;overflow:auto;border:1px solid var(--line);background:#111516}.turn-row{position:absolute;left:0;top:0;width:100%;height:60px;display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px;background:transparent;border:0;border-bottom:1px solid var(--line);text-align:left;cursor:pointer}.turn-row:hover,.turn-row.active{background:#202627}.turn-row.active{box-shadow:inset 2px 0 var(--acid)}.turn-row.failed{box-shadow:inset 2px 0 var(--red)}.turn-row strong{font-size:10px}.turn-row span,.turn-row small{color:#78817d;font:8px DM Mono}.turn-row small{grid-column:1 / -1}.turn-detail{border-top:1px solid var(--line);padding-top:12px}.value-object .value-object{border-left:1px solid #313837;padding-left:8px}.value-string{color:#c4d99d;white-space:pre-wrap;overflow-wrap:anywhere}.value-scalar{color:#82c8cc}.value-null{color:#68716e}.value-unavailable{color:var(--amber);font-size:9px}.value-list{margin:0;padding-left:20px}.value-list li{margin:5px 0}.file-value{display:flex;gap:9px;padding:9px;border:1px solid #5f6441;background:#22251a;border-radius:4px;color:var(--acid)}.file-value small,.file-value code{display:block}.file-value small{color:#919976;font-size:7px;text-transform:uppercase}.file-value code{margin-top:3px;font-size:9px;overflow-wrap:anywhere}.log-list{margin-bottom:12px}.log-list button{width:100%;display:grid;grid-template-columns:48px 1fr auto;gap:7px;padding:7px 4px;border:0;border-bottom:1px solid var(--line);background:none;color:#929c97;text-align:left;font:8px DM Mono;cursor:pointer}.log-list button:hover{background:#202627}.log-level{text-transform:uppercase}.level-error{color:var(--red)}.level-warning{color:var(--amber)}.run-controls{display:flex;align-items:center;gap:7px;position:relative}.run-button,.cancel-button,.input-toggle{border-radius:4px;padding:8px 13px;cursor:pointer;font-size:10px}.run-button{background:var(--acid);border:1px solid var(--acid);color:#111412;font-weight:700}.cancel-button{background:#3a2221;border:1px solid #71403c;color:#f2a39b}.input-toggle{background:transparent;border:1px solid #3c4541;color:#89938e}.input-toggle.active{color:var(--acid);border-color:#6e7848}.run-controls button:disabled{opacity:.5;cursor:wait}.input-popover{position:absolute;z-index:20;right:0;top:43px;width:390px;padding:13px;background:#15191a;border:1px solid #4a5450;box-shadow:0 18px 50px #00000080}.input-popover>div:first-child{display:flex;justify-content:space-between;margin-bottom:9px}.input-popover strong{font-size:11px}.input-popover span{color:#6d7672;font:8px DM Mono}.json-editor{border:1px solid var(--line);font-size:10px}.action-error{position:absolute;z-index:21;right:0;top:44px;width:390px;border:1px solid #813c37}.input-popover+.action-error{top:205px}@media(max-width:1000px){.workspace,.workspace.with-inspector{grid-template-columns:230px minmax(0,1fr)}.inspector{position:fixed;z-index:30;right:0;top:58px;bottom:0;width:min(420px,calc(100vw - 230px));box-shadow:-20px 0 50px #00000073}.topbar{grid-template-columns:210px 1fr auto}}@media(max-width:700px){.workspace,.workspace.with-inspector{grid-template-columns:1fr}.explorer,.breadcrumb{display:none}.topbar{grid-template-columns:1fr auto}.view-header{align-items:flex-start;padding:13px 16px}.inspector{width:100vw;top:58px}.input-popover,.action-error{width:calc(100vw - 32px)}} diff --git a/src/runtime/operator/web_assets/assets/index-mLerAYW4.js b/src/runtime/operator/web_assets/assets/index-mLerAYW4.js new file mode 100644 index 0000000..d3b88b3 --- /dev/null +++ b/src/runtime/operator/web_assets/assets/index-mLerAYW4.js @@ -0,0 +1,9 @@ +import{r as jm,a as Dm,b as J,j as p,H as Qd,P as Kd,M as _m,i as Mm,B as Rm,C as wm,c as Um}from"./graph-CoDTrhFP.js";import{S as Bm,M as W,r as F,U,W as S,s as Oe,G as qm}from"./protobuf-BR9ifi4u.js";import{E as Ii,a as Cm,j as Lm,k as Hm}from"./editor-Dh6wG2B-.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const c of f)if(c.type==="childList")for(const v of c.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function i(f){const c={};return f.integrity&&(c.integrity=f.integrity),f.referrerPolicy&&(c.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?c.credentials="include":f.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(f){if(f.ep)return;f.ep=!0;const c=i(f);fetch(f.href,c)}})();var Sc={exports:{}},Da={},Tc={exports:{}},kc={};var Zd;function Vm(){return Zd||(Zd=1,(function(y){function a(_,B){var Q=_.length;_.push(B);t:for(;0>>1,H=_[w];if(0>>1;wf(ot,Q))qtf(xe,ot)?(_[w]=xe,_[qt]=Q,w=qt):(_[w]=ot,_[ct]=Q,w=ct);else if(qtf(xe,Q))_[w]=xe,_[qt]=Q,w=qt;else break t}}return B}function f(_,B){var Q=_.sortIndex-B.sortIndex;return Q!==0?Q:_.id-B.id}if(y.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;y.unstable_now=function(){return c.now()}}else{var v=Date,d=v.now();y.unstable_now=function(){return v.now()-d}}var g=[],m=[],z=1,j=null,R=3,C=!1,V=!1,G=!1,it=!1,K=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,tt=typeof setImmediate<"u"?setImmediate:null;function ht(_){for(var B=i(m);B!==null;){if(B.callback===null)o(m);else if(B.startTime<=_)o(m),B.sortIndex=B.expirationTime,a(g,B);else break;B=i(m)}}function st(_){if(G=!1,ht(_),!V)if(i(g)!==null)V=!0,Bt||(Bt=!0,Ht());else{var B=i(m);B!==null&&he(st,B.startTime-_)}}var Bt=!1,$=-1,jt=5,Dt=-1;function Kt(){return it?!0:!(y.unstable_now()-Dt_&&Kt());){var w=j.callback;if(typeof w=="function"){j.callback=null,R=j.priorityLevel;var H=w(j.expirationTime<=_);if(_=y.unstable_now(),typeof H=="function"){j.callback=H,ht(_),B=!0;break e}j===i(g)&&o(g),ht(_)}else o(g);j=i(g)}if(j!==null)B=!0;else{var bt=i(m);bt!==null&&he(st,bt.startTime-_),B=!1}}break t}finally{j=null,R=Q,C=!1}B=void 0}}finally{B?Ht():Bt=!1}}}var Ht;if(typeof tt=="function")Ht=function(){tt(At)};else if(typeof MessageChannel<"u"){var Jt=new MessageChannel,de=Jt.port2;Jt.port1.onmessage=At,Ht=function(){de.postMessage(null)}}else Ht=function(){K(At,0)};function he(_,B){$=K(function(){_(y.unstable_now())},B)}y.unstable_IdlePriority=5,y.unstable_ImmediatePriority=1,y.unstable_LowPriority=4,y.unstable_NormalPriority=3,y.unstable_Profiling=null,y.unstable_UserBlockingPriority=2,y.unstable_cancelCallback=function(_){_.callback=null},y.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):jt=0<_?Math.floor(1e3/_):5},y.unstable_getCurrentPriorityLevel=function(){return R},y.unstable_next=function(_){switch(R){case 1:case 2:case 3:var B=3;break;default:B=R}var Q=R;R=B;try{return _()}finally{R=Q}},y.unstable_requestPaint=function(){it=!0},y.unstable_runWithPriority=function(_,B){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var Q=R;R=_;try{return B()}finally{R=Q}},y.unstable_scheduleCallback=function(_,B,Q){var w=y.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0w?(_.sortIndex=Q,a(m,_),i(g)===null&&_===i(m)&&(G?(Z($),$=-1):G=!0,he(st,Q-w))):(_.sortIndex=H,a(g,_),V||C||(V=!0,Bt||(Bt=!0,Ht()))),_},y.unstable_shouldYield=Kt,y.unstable_wrapCallback=function(_){var B=R;return function(){var Q=R;R=B;try{return _.apply(this,arguments)}finally{R=Q}}}})(kc)),kc}var Jd;function Ym(){return Jd||(Jd=1,Tc.exports=Vm()),Tc.exports}var $d;function Gm(){if($d)return Da;$d=1;var y=Ym(),a=jm(),i=Dm();function o(t){var e="https://react.dev/errors/"+t;if(1H||(t.current=w[H],w[H]=null,H--)}function ot(t,e){H++,w[H]=t.current,t.current=e}var qt=bt(null),xe=bt(null),Ie=bt(null),Ma=bt(null);function Ra(t,e){switch(ot(Ie,e),ot(xe,t),ot(qt,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?gd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=gd(e),t=md(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ct(qt),ot(qt,t)}function Zn(){ct(qt),ct(xe),ct(Ie)}function eu(t){t.memoizedState!==null&&ot(Ma,t);var e=qt.current,n=md(e,t.type);e!==n&&(ot(xe,t),ot(qt,n))}function wa(t){xe.current===t&&(ct(qt),ct(xe)),Ma.current===t&&(ct(Ma),Aa._currentValue=Q)}var nu,Yc;function An(t){if(nu===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);nu=e&&e[1]||"",Yc=-1)":-1u||b[l]!==N[u]){var x=` +`+b[l].replace(" at new "," at ");return t.displayName&&x.includes("")&&(x=x.replace("",t.displayName)),x}while(1<=l&&0<=u);break}}}finally{lu=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?An(n):""}function uh(t,e){switch(t.tag){case 26:case 27:case 5:return An(t.type);case 16:return An("Lazy");case 13:return t.child!==e&&e!==null?An("Suspense Fallback"):An("Suspense");case 19:return An("SuspenseList");case 0:case 15:return au(t.type,!1);case 11:return au(t.type.render,!1);case 1:return au(t.type,!0);case 31:return An("Activity");default:return""}}function Gc(t){try{var e="",n=null;do e+=uh(t,n),n=t,t=t.return;while(t);return e}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}var iu=Object.prototype.hasOwnProperty,uu=y.unstable_scheduleCallback,su=y.unstable_cancelCallback,sh=y.unstable_shouldYield,ch=y.unstable_requestPaint,ne=y.unstable_now,oh=y.unstable_getCurrentPriorityLevel,Xc=y.unstable_ImmediatePriority,Qc=y.unstable_UserBlockingPriority,Ua=y.unstable_NormalPriority,fh=y.unstable_LowPriority,Kc=y.unstable_IdlePriority,rh=y.log,dh=y.unstable_setDisableYieldValue,Cl=null,le=null;function Pe(t){if(typeof rh=="function"&&dh(t),le&&typeof le.setStrictMode=="function")try{le.setStrictMode(Cl,t)}catch{}}var ae=Math.clz32?Math.clz32:mh,hh=Math.log,gh=Math.LN2;function mh(t){return t>>>=0,t===0?32:31-(hh(t)/gh|0)|0}var Ba=256,qa=262144,Ca=4194304;function On(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function La(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var u=0,s=t.suspendedLanes,r=t.pingedLanes;t=t.warmLanes;var h=l&134217727;return h!==0?(l=h&~s,l!==0?u=On(l):(r&=h,r!==0?u=On(r):n||(n=h&~t,n!==0&&(u=On(n))))):(h=l&~s,h!==0?u=On(h):r!==0?u=On(r):n||(n=l&~t,n!==0&&(u=On(n)))),u===0?0:e!==0&&e!==u&&(e&s)===0&&(s=u&-u,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:u}function Ll(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function yh(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zc(){var t=Ca;return Ca<<=1,(Ca&62914560)===0&&(Ca=4194304),t}function cu(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Hl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ph(t,e,n,l,u,s){var r=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,b=t.expirationTimes,N=t.hiddenUpdates;for(n=r&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var zh=/[\n"\\]/g;function me(t){return t.replace(zh,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function gu(t,e,n,l,u,s,r,h){t.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.type=r:t.removeAttribute("type"),e!=null?r==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ge(e)):t.value!==""+ge(e)&&(t.value=""+ge(e)):r!=="submit"&&r!=="reset"||t.removeAttribute("value"),e!=null?mu(t,r,ge(e)):n!=null?mu(t,r,ge(n)):l!=null&&t.removeAttribute("value"),u==null&&s!=null&&(t.defaultChecked=!!s),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+ge(h):t.removeAttribute("name")}function uo(t,e,n,l,u,s,r,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){hu(t);return}n=n!=null?""+ge(n):"",e=e!=null?""+ge(e):n,h||e===t.value||(t.value=e),t.defaultValue=e}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=h?t.checked:!!l,t.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.name=r),hu(t)}function mu(t,e,n){e==="number"&&Ya(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Pn(t,e,n,l){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=!1;if(Ue)try{var Xl={};Object.defineProperty(Xl,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{Su=!1}var en=null,Tu=null,Xa=null;function go(){if(Xa)return Xa;var t,e=Tu,n=e.length,l,u="value"in en?en.value:en.textContent,s=u.length;for(t=0;t=Zl),So=" ",To=!1;function ko(t,e){switch(t){case"keyup":return Fh.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ll=!1;function Ph(t,e){switch(t){case"compositionend":return zo(e);case"keypress":return e.which!==32?null:(To=!0,So);case"textInput":return t=e.data,t===So&&To?null:t;default:return null}}function tg(t,e){if(ll)return t==="compositionend"||!Au&&ko(t,e)?(t=go(),Xa=Tu=en=null,ll=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=_o(n)}}function Ro(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ro(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function wo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ya(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ya(t.document)}return e}function ju(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var cg=Ue&&"documentMode"in document&&11>=document.documentMode,al=null,Du=null,Fl=null,_u=!1;function Uo(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_u||al==null||al!==Ya(l)||(l=al,"selectionStart"in l&&ju(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Fl&&Wl(Fl,l)||(Fl=l,l=qi(Du,"onSelect"),0>=r,u-=r,je=1<<32-ae(e)+u|n<P?(at=L,L=null):at=L.sibling;var rt=A(k,L,E[P],D);if(rt===null){L===null&&(L=at);break}t&&L&&rt.alternate===null&&e(k,L),T=s(rt,T,P),ft===null?Y=rt:ft.sibling=rt,ft=rt,L=at}if(P===E.length)return n(k,L),ut&&qe(k,P),Y;if(L===null){for(;PP?(at=L,L=null):at=L.sibling;var En=A(k,L,rt.value,D);if(En===null){L===null&&(L=at);break}t&&L&&En.alternate===null&&e(k,L),T=s(En,T,P),ft===null?Y=En:ft.sibling=En,ft=En,L=at}if(rt.done)return n(k,L),ut&&qe(k,P),Y;if(L===null){for(;!rt.done;P++,rt=E.next())rt=M(k,rt.value,D),rt!==null&&(T=s(rt,T,P),ft===null?Y=rt:ft.sibling=rt,ft=rt);return ut&&qe(k,P),Y}for(L=l(L);!rt.done;P++,rt=E.next())rt=O(L,k,P,rt.value,D),rt!==null&&(t&&rt.alternate!==null&&L.delete(rt.key===null?P:rt.key),T=s(rt,T,P),ft===null?Y=rt:ft.sibling=rt,ft=rt);return t&&L.forEach(function(xm){return e(k,xm)}),ut&&qe(k,P),Y}function vt(k,T,E,D){if(typeof E=="object"&&E!==null&&E.type===G&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case C:t:{for(var Y=E.key;T!==null;){if(T.key===Y){if(Y=E.type,Y===G){if(T.tag===7){n(k,T.sibling),D=u(T,E.props.children),D.return=k,k=D;break t}}else if(T.elementType===Y||typeof Y=="object"&&Y!==null&&Y.$$typeof===jt&&Cn(Y)===T.type){n(k,T.sibling),D=u(T,E.props),la(D,E),D.return=k,k=D;break t}n(k,T);break}else e(k,T);T=T.sibling}E.type===G?(D=Rn(E.props.children,k.mode,D,E.key),D.return=k,k=D):(D=ti(E.type,E.key,E.props,null,k.mode,D),la(D,E),D.return=k,k=D)}return r(k);case V:t:{for(Y=E.key;T!==null;){if(T.key===Y)if(T.tag===4&&T.stateNode.containerInfo===E.containerInfo&&T.stateNode.implementation===E.implementation){n(k,T.sibling),D=u(T,E.children||[]),D.return=k,k=D;break t}else{n(k,T);break}else e(k,T);T=T.sibling}D=Cu(E,k.mode,D),D.return=k,k=D}return r(k);case jt:return E=Cn(E),vt(k,T,E,D)}if(he(E))return q(k,T,E,D);if(Ht(E)){if(Y=Ht(E),typeof Y!="function")throw Error(o(150));return E=Y.call(E),X(k,T,E,D)}if(typeof E.then=="function")return vt(k,T,si(E),D);if(E.$$typeof===tt)return vt(k,T,li(k,E),D);ci(k,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,T!==null&&T.tag===6?(n(k,T.sibling),D=u(T,E),D.return=k,k=D):(n(k,T),D=qu(E,k.mode,D),D.return=k,k=D),r(k)):n(k,T)}return function(k,T,E,D){try{na=0;var Y=vt(k,T,E,D);return ml=null,Y}catch(L){if(L===gl||L===ii)throw L;var ft=ue(29,L,null,k.mode);return ft.lanes=D,ft.return=k,ft}}}var Hn=af(!0),uf=af(!1),sn=!1;function Wu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fu(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function on(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(dt&2)!==0){var u=l.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),l.pending=e,e=Pa(t),Yo(t,null,n),e}return Ia(t,l,e,n),Pa(t)}function aa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,$c(t,n)}}function Iu(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var u=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?u=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?u=s=e:s=s.next=e}else u=s=e;n={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Pu=!1;function ia(){if(Pu){var t=hl;if(t!==null)throw t}}function ua(t,e,n,l){Pu=!1;var u=t.updateQueue;sn=!1;var s=u.firstBaseUpdate,r=u.lastBaseUpdate,h=u.shared.pending;if(h!==null){u.shared.pending=null;var b=h,N=b.next;b.next=null,r===null?s=N:r.next=N,r=b;var x=t.alternate;x!==null&&(x=x.updateQueue,h=x.lastBaseUpdate,h!==r&&(h===null?x.firstBaseUpdate=N:h.next=N,x.lastBaseUpdate=b))}if(s!==null){var M=u.baseState;r=0,x=N=b=null,h=s;do{var A=h.lane&-536870913,O=A!==h.lane;if(O?(lt&A)===A:(l&A)===A){A!==0&&A===dl&&(Pu=!0),x!==null&&(x=x.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var q=t,X=h;A=e;var vt=n;switch(X.tag){case 1:if(q=X.payload,typeof q=="function"){M=q.call(vt,M,A);break t}M=q;break t;case 3:q.flags=q.flags&-65537|128;case 0:if(q=X.payload,A=typeof q=="function"?q.call(vt,M,A):q,A==null)break t;M=j({},M,A);break t;case 2:sn=!0}}A=h.callback,A!==null&&(t.flags|=64,O&&(t.flags|=8192),O=u.callbacks,O===null?u.callbacks=[A]:O.push(A))}else O={lane:A,tag:h.tag,payload:h.payload,callback:h.callback,next:null},x===null?(N=x=O,b=M):x=x.next=O,r|=A;if(h=h.next,h===null){if(h=u.shared.pending,h===null)break;O=h,h=O.next,O.next=null,u.lastBaseUpdate=O,u.shared.pending=null}}while(!0);x===null&&(b=M),u.baseState=b,u.firstBaseUpdate=N,u.lastBaseUpdate=x,s===null&&(u.shared.lanes=0),gn|=r,t.lanes=r,t.memoizedState=M}}function sf(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function cf(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ts?s:8;var r=_.T,h={};_.T=h,vs(t,!1,e,n);try{var b=u(),N=_.S;if(N!==null&&N(h,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var x=pg(b,l);oa(t,e,x,re(t))}else oa(t,e,l,re(t))}catch(M){oa(t,e,{then:function(){},status:"rejected",reason:M},re())}finally{B.p=s,r!==null&&h.types!==null&&(r.types=h.types),_.T=r}}function zg(){}function ys(t,e,n,l){if(t.tag!==5)throw Error(o(476));var u=Hf(t).queue;Lf(t,u,e,Q,n===null?zg:function(){return Vf(t),n(l)})}function Hf(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:Q},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Vf(t){var e=Hf(t);e.next===null&&(e=t.alternate.memoizedState),oa(t,e.next.queue,{},re())}function ps(){return Gt(Aa)}function Yf(){return xt().memoizedState}function Gf(){return xt().memoizedState}function Eg(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=re();t=cn(n);var l=on(e,t,n);l!==null&&(ee(l,e,n),aa(l,e,n)),e={cache:Ku()},t.payload=e;return}e=e.return}}function Ng(t,e,n){var l=re();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},vi(t)?Qf(e,n):(n=Uu(t,e,n,l),n!==null&&(ee(n,t,l),Kf(n,e,l)))}function Xf(t,e,n){var l=re();oa(t,e,n,l)}function oa(t,e,n,l){var u={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(vi(t))Qf(e,u);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var r=e.lastRenderedState,h=s(r,n);if(u.hasEagerState=!0,u.eagerState=h,ie(h,r))return Ia(t,e,u,0),St===null&&Fa(),!1}catch{}if(n=Uu(t,e,u,l),n!==null)return ee(n,t,l),Kf(n,e,l),!0}return!1}function vs(t,e,n,l){if(l={lane:2,revertLane:Ws(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},vi(t)){if(e)throw Error(o(479))}else e=Uu(t,n,l,2),e!==null&&ee(e,t,2)}function vi(t){var e=t.alternate;return t===I||e!==null&&e===I}function Qf(t,e){pl=ri=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Kf(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,$c(t,n)}}var fa={readContext:Gt,use:gi,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};fa.useEffectEvent=Et;var Zf={readContext:Gt,use:gi,useCallback:function(t,e){return Zt().memoizedState=[t,e===void 0?null:e],t},useContext:Gt,useEffect:Df,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,yi(4194308,4,wf.bind(null,e,t),n)},useLayoutEffect:function(t,e){return yi(4194308,4,t,e)},useInsertionEffect:function(t,e){yi(4,2,t,e)},useMemo:function(t,e){var n=Zt();e=e===void 0?null:e;var l=t();if(Vn){Pe(!0);try{t()}finally{Pe(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=Zt();if(n!==void 0){var u=n(e);if(Vn){Pe(!0);try{n(e)}finally{Pe(!1)}}}else u=e;return l.memoizedState=l.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},l.queue=t,t=t.dispatch=Ng.bind(null,I,t),[l.memoizedState,t]},useRef:function(t){var e=Zt();return t={current:t},e.memoizedState=t},useState:function(t){t=rs(t);var e=t.queue,n=Xf.bind(null,I,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(t,e){var n=Zt();return ms(n,t,e)},useTransition:function(){var t=rs(!1);return t=Lf.bind(null,I,t.queue,!0,!1),Zt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=I,u=Zt();if(ut){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),St===null)throw Error(o(349));(lt&127)!==0||gf(l,e,n)}u.memoizedState=n;var s={value:n,getSnapshot:e};return u.queue=s,Df(yf.bind(null,l,s,t),[t]),l.flags|=2048,bl(9,{destroy:void 0},mf.bind(null,l,s,n,e),null),n},useId:function(){var t=Zt(),e=St.identifierPrefix;if(ut){var n=De,l=je;n=(l&~(1<<32-ae(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=di++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(u,{is:l.is}):r.createElement(u)}}s[Vt]=e,s[$t]=l;t:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break t;for(;r.sibling===null;){if(r.return===null||r.return===e)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=s;t:switch(Qt(s,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&Ge(e)}}return kt(e),Ms(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Ge(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(o(166));if(t=Ie.current,fl(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,u=Yt,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}t[Vt]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||dd(t.nodeValue,n)),t||an(e,!0)}else t=Ci(t).createTextNode(l),t[Vt]=e,e.stateNode=t}return kt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=fl(e),n!==null){if(t===null){if(!l)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Vt]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),t=!1}else n=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(ce(e),e):(ce(e),null);if((e.flags&128)!==0)throw Error(o(558))}return kt(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=fl(e),l!==null&&l.dehydrated!==null){if(t===null){if(!u)throw Error(o(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Vt]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),u=!1}else u=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(ce(e),e):(ce(e),null)}return ce(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),zi(e,e.updateQueue),kt(e),null);case 4:return Zn(),t===null&&tc(e.stateNode.containerInfo),kt(e),null;case 10:return Le(e.type),kt(e),null;case 19:if(ct(Ot),l=e.memoizedState,l===null)return kt(e),null;if(u=(e.flags&128)!==0,s=l.rendering,s===null)if(u)da(l,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=fi(t),s!==null){for(e.flags|=128,da(l,!1),t=s.updateQueue,e.updateQueue=t,zi(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Go(n,t),n=n.sibling;return ot(Ot,Ot.current&1|2),ut&&qe(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&ne()>xi&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304)}else{if(!u)if(t=fi(s),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,zi(e,t),da(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!ut)return kt(e),null}else 2*ne()-l.renderingStartTime>xi&&n!==536870912&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304);l.isBackwards?(s.sibling=e.child,e.child=s):(t=l.last,t!==null?t.sibling=s:e.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ne(),t.sibling=null,n=Ot.current,ot(Ot,u?n&1|2:n&1),ut&&qe(e,l.treeForkCount),t):(kt(e),null);case 22:case 23:return ce(e),es(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(kt(e),e.subtreeFlags&6&&(e.flags|=8192)):kt(e),n=e.updateQueue,n!==null&&zi(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&ct(qn),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Le(_t),kt(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function Dg(t,e){switch(Hu(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Le(_t),Zn(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return wa(e),null;case 31:if(e.memoizedState!==null){if(ce(e),e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ce(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(Ot),null;case 4:return Zn(),null;case 10:return Le(e.type),null;case 22:case 23:return ce(e),es(),t!==null&&ct(qn),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Le(_t),null;case 25:return null;default:return null}}function pr(t,e){switch(Hu(e),e.tag){case 3:Le(_t),Zn();break;case 26:case 27:case 5:wa(e);break;case 4:Zn();break;case 31:e.memoizedState!==null&&ce(e);break;case 13:ce(e);break;case 19:ct(Ot);break;case 10:Le(e.type);break;case 22:case 23:ce(e),es(),t!==null&&ct(qn);break;case 24:Le(_t)}}function ha(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var u=l.next;n=u;do{if((n.tag&t)===t){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==u)}}catch(h){mt(e,e.return,h)}}function dn(t,e,n){try{var l=e.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var s=u.next;l=s;do{if((l.tag&t)===t){var r=l.inst,h=r.destroy;if(h!==void 0){r.destroy=void 0,u=e;var b=n,N=h;try{N()}catch(x){mt(u,b,x)}}}l=l.next}while(l!==s)}}catch(x){mt(e,e.return,x)}}function vr(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{cf(e,n)}catch(l){mt(t,t.return,l)}}}function br(t,e,n){n.props=Yn(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){mt(t,e,l)}}function ga(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(u){mt(t,e,u)}}function _e(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(u){mt(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){mt(t,e,u)}else n.current=null}function Sr(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(u){mt(t,t.return,u)}}function Rs(t,e,n){try{var l=t.stateNode;Ig(l,t.type,n,e),l[$t]=e}catch(u){mt(t,t.return,u)}}function Tr(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bn(t.type)||t.tag===4}function ws(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Tr(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Us(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=we));else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Us(t,e,n),t=t.sibling;t!==null;)Us(t,e,n),t=t.sibling}function Ei(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ei(t,e,n),t=t.sibling;t!==null;)Ei(t,e,n),t=t.sibling}function kr(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);Qt(e,l,n),e[Vt]=t,e[$t]=n}catch(s){mt(t,t.return,s)}}var Xe=!1,wt=!1,Bs=!1,zr=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function _g(t,e){if(t=t.containerInfo,lc=Qi,t=wo(t),ju(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var u=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var r=0,h=-1,b=-1,N=0,x=0,M=t,A=null;e:for(;;){for(var O;M!==n||u!==0&&M.nodeType!==3||(h=r+u),M!==s||l!==0&&M.nodeType!==3||(b=r+l),M.nodeType===3&&(r+=M.nodeValue.length),(O=M.firstChild)!==null;)A=M,M=O;for(;;){if(M===t)break e;if(A===n&&++N===u&&(h=r),A===s&&++x===l&&(b=r),(O=M.nextSibling)!==null)break;M=A,A=M.parentNode}M=O}n=h===-1||b===-1?null:{start:h,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(ac={focusedElem:t,selectionRange:n},Qi=!1,Lt=e;Lt!==null;)if(e=Lt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Lt=t;else for(;Lt!==null;){switch(e=Lt,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),Qt(s,l,n),s[Vt]=t,Ct(s),l=s;break t;case"link":var r=jd("link","href",u).get(l+(n.href||""));if(r){for(var h=0;hvt&&(r=vt,vt=X,X=r);var k=Mo(h,X),T=Mo(h,vt);if(k&&T&&(O.rangeCount!==1||O.anchorNode!==k.node||O.anchorOffset!==k.offset||O.focusNode!==T.node||O.focusOffset!==T.offset)){var E=M.createRange();E.setStart(k.node,k.offset),O.removeAllRanges(),X>vt?(O.addRange(E),O.extend(T.node,T.offset)):(E.setEnd(T.node,T.offset),O.addRange(E))}}}}for(M=[],O=h;O=O.parentNode;)O.nodeType===1&&M.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;hn?32:n,_.T=null,n=Gs,Gs=null;var s=yn,r=$e;if(Ut=0,El=yn=null,$e=0,(dt&6)!==0)throw Error(o(331));var h=dt;if(dt|=4,wr(s.current),_r(s,s.current,r,n),dt=h,Sa(0,!1),le&&typeof le.onPostCommitFiberRoot=="function")try{le.onPostCommitFiberRoot(Cl,s)}catch{}return!0}finally{B.p=u,_.T=l,Ir(t,e)}}function td(t,e,n){e=pe(n,e),e=ks(t.stateNode,e,2),t=on(t,e,2),t!==null&&(Hl(t,2),Me(t))}function mt(t,e,n){if(t.tag===3)td(t,t,n);else for(;e!==null;){if(e.tag===3){td(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(mn===null||!mn.has(l))){t=pe(n,t),n=er(2),l=on(e,n,2),l!==null&&(nr(n,l,e,t),Hl(l,2),Me(l));break}}e=e.return}}function Zs(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new wg;var u=new Set;l.set(e,u)}else u=l.get(e),u===void 0&&(u=new Set,l.set(e,u));u.has(n)||(Ls=!0,u.add(n),t=Lg.bind(null,t,e,n),e.then(t,t))}function Lg(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,St===t&&(lt&n)===n&&(Nt===4||Nt===3&&(lt&62914560)===lt&&300>ne()-Oi?(dt&2)===0&&Nl(t,0):Hs|=n,zl===lt&&(zl=0)),Me(t)}function ed(t,e){e===0&&(e=Zc()),t=Mn(t,e),t!==null&&(Hl(t,e),Me(t))}function Hg(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),ed(t,n)}function Vg(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(e),ed(t,n)}function Yg(t,e){return uu(t,e)}var wi=null,Ol=null,Js=!1,Ui=!1,$s=!1,vn=0;function Me(t){t!==Ol&&t.next===null&&(Ol===null?wi=Ol=t:Ol=Ol.next=t),Ui=!0,Js||(Js=!0,Xg())}function Sa(t,e){if(!$s&&Ui){$s=!0;do for(var n=!1,l=wi;l!==null;){if(t!==0){var u=l.pendingLanes;if(u===0)var s=0;else{var r=l.suspendedLanes,h=l.pingedLanes;s=(1<<31-ae(42|t)+1)-1,s&=u&~(r&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,id(l,s))}else s=lt,s=La(l,l===St?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Ll(l,s)||(n=!0,id(l,s));l=l.next}while(n);$s=!1}}function Gg(){nd()}function nd(){Ui=Js=!1;var t=0;vn!==0&&tm()&&(t=vn);for(var e=ne(),n=null,l=wi;l!==null;){var u=l.next,s=ld(l,e);s===0?(l.next=null,n===null?wi=u:n.next=u,u===null&&(Ol=n)):(n=l,(t!==0||(s&3)!==0)&&(Ui=!0)),l=u}Ut!==0&&Ut!==5||Sa(t),vn!==0&&(vn=0)}function ld(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,u=t.expirationTimes,s=t.pendingLanes&-62914561;0h)break;var x=b.transferSize,M=b.initiatorType;x&&hd(M)&&(b=b.responseEnd,r+=x*(b"u"?null:document;function Nd(t,e,n){var l=xl;if(l&&typeof e=="string"&&e){var u=me(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Ed.has(u)||(Ed.add(u),t={rel:t,crossOrigin:n,href:e},l.querySelector(u)===null&&(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function om(t){We.D(t),Nd("dns-prefetch",t,null)}function fm(t,e){We.C(t,e),Nd("preconnect",t,e)}function rm(t,e,n){We.L(t,e,n);var l=xl;if(l&&t&&e){var u='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+me(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+me(n.imageSizes)+'"]')):u+='[href="'+me(t)+'"]';var s=u;switch(e){case"style":s=jl(t);break;case"script":s=Dl(t)}ze.has(s)||(t=j({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),ze.set(s,t),l.querySelector(u)!==null||e==="style"&&l.querySelector(Ea(s))||e==="script"&&l.querySelector(Na(s))||(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function dm(t,e){We.m(t,e);var n=xl;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+me(l)+'"][href="'+me(t)+'"]',s=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Dl(t)}if(!ze.has(s)&&(t=j({rel:"modulepreload",href:t},e),ze.set(s,t),n.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Na(s)))return}l=n.createElement("link"),Qt(l,"link",t),Ct(l),n.head.appendChild(l)}}}function hm(t,e,n){We.S(t,e,n);var l=xl;if(l&&t){var u=Fn(l).hoistableStyles,s=jl(t);e=e||"default";var r=u.get(s);if(!r){var h={loading:0,preload:null};if(r=l.querySelector(Ea(s)))h.loading=5;else{t=j({rel:"stylesheet",href:t,"data-precedence":e},n),(n=ze.get(s))&&rc(t,n);var b=r=l.createElement("link");Ct(b),Qt(b,"link",t),b._p=new Promise(function(N,x){b.onload=N,b.onerror=x}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Hi(r,e,l)}r={type:"stylesheet",instance:r,count:1,state:h},u.set(s,r)}}}function gm(t,e){We.X(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function mm(t,e){We.M(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0,type:"module"},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function Ad(t,e,n,l){var u=(u=Ie.current)?Li(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=jl(n.href),n=Fn(u).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=jl(n.href);var s=Fn(u).hoistableStyles,r=s.get(t);if(r||(u=u.ownerDocument||u,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,r),(s=u.querySelector(Ea(t)))&&!s._p&&(r.instance=s,r.state.loading=5),ze.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ze.set(t,n),s||ym(u,t,n,r.state))),e&&l===null)throw Error(o(528,""));return r}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Dl(n),n=Fn(u).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function jl(t){return'href="'+me(t)+'"'}function Ea(t){return'link[rel="stylesheet"]['+t+"]"}function Od(t){return j({},t,{"data-precedence":t.precedence,precedence:null})}function ym(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),Qt(e,"link",n),Ct(e),t.head.appendChild(e))}function Dl(t){return'[src="'+me(t)+'"]'}function Na(t){return"script[async]"+t}function xd(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+me(n.href)+'"]');if(l)return e.instance=l,Ct(l),l;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ct(l),Qt(l,"style",u),Hi(l,n.precedence,t),e.instance=l;case"stylesheet":u=jl(n.href);var s=t.querySelector(Ea(u));if(s)return e.state.loading|=4,e.instance=s,Ct(s),s;l=Od(n),(u=ze.get(u))&&rc(l,u),s=(t.ownerDocument||t).createElement("link"),Ct(s);var r=s;return r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),e.state.loading|=4,Hi(s,n.precedence,t),e.instance=s;case"script":return s=Dl(n.src),(u=t.querySelector(Na(s)))?(e.instance=u,Ct(u),u):(l=n,(u=ze.get(s))&&(l=j({},n),dc(l,u)),t=t.ownerDocument||t,u=t.createElement("script"),Ct(u),Qt(u,"link",l),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,Hi(l,n.precedence,t));return e.instance}function Hi(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,s=u,r=0;r title"):null)}function pm(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function _d(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function vm(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=jl(l.href),s=e.querySelector(Ea(u));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Yi.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,Ct(s);return}s=e.ownerDocument||e,l=Od(l),(u=ze.get(u))&&rc(l,u),s=s.createElement("link"),Ct(s);var r=s;r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Yi.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var hc=0;function bm(t,e){return t.stylesheets&&t.count===0&&Xi(t,t.stylesheets),0hc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Yi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xi(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Gi=null;function Xi(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gi=new Map,e.forEach(Sm,t),Gi=null,Yi.call(t))}function Sm(t,e){if(!(e.state.loading&4)){var n=Gi.get(t);if(n)var l=n.get(null);else{n=new Map,Gi.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y)}catch(a){console.error(a)}}return y(),Sc.exports=Gm(),Sc.exports}var Qm=Xm();class Km extends W{constructor(){super("avalanche.operator.Empty",[])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poszc},{no:6,name:"run_id",kind:"scalar",T:9},{no:7,name:"workflow_selector",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.flowName="",i.inputJson="",i.contextJson="",i.inputFiles=[],i.runId="",i.workflowSelector="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:3,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.agentMetadataJson={},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:5,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"cron",kind:"scalar",T:9},{no:8,name:"next_run_at",kind:"scalar",T:1},{no:9,name:"last_run_at",kind:"scalar",T:1},{no:10,name:"workflow_id",kind:"scalar",T:9},{no:11,name:"display_name",kind:"scalar",T:9},{no:12,name:"root_alias",kind:"scalar",T:9},{no:13,name:"relative_file",kind:"scalar",T:9},{no:14,name:"builder_symbol",kind:"scalar",T:9},{no:15,name:"agent_node_ids",kind:"scalar",repeat:2,T:9},{no:16,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:17,name:"webhook_path",kind:"scalar",T:9},{no:18,name:"webhook_url",kind:"scalar",T:9},{no:19,name:"webhook_active",kind:"scalar",T:8}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.name="",i.filePath="",i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.cron="",i.nextRunAt=0,i.lastRunAt=0,i.workflowId="",i.displayName="",i.rootAlias="",i.relativeFile="",i.builderSymbol="",i.agentNodeIds=[],i.agentMetadataJson={},i.webhookPath="",i.webhookUrl="",i.webhookActive=!1,a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posEc},{no:5,name:"scan_targets",kind:"message",repeat:2,T:()=>Ac},{no:6,name:"diagnostics",kind:"message",repeat:2,T:()=>Nc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.revision="0",i.workflows=[],i.scanTargets=[],i.diagnostics=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posOc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.valueJson="",i.files=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posxc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.status="",i.revision="0",i.available=!1,i.complete=!1,i.eventCount="0",i.sizeBytes="0",i.latestEventSequence="0",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl},{no:8,name:"revision",kind:"scalar",T:4},{no:9,name:"event_page_token",kind:"scalar",T:9},{no:10,name:"error",kind:"scalar",opt:!0,T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeId="",i.name="",i.nodeType="",i.status="",i.startedAt=0,i.endedAt=0,i.revision="0",i.eventPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:5,name:"latest_log_sequence",kind:"scalar",T:4},{no:6,name:"log_page_token",kind:"scalar",T:9},{no:7,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.nodes=[],i.latestLogSequence="0",i.logPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.logs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql},{no:6,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runId="",i.nodeId="",i.events=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:2,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:3,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodes=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posPi}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posjc},{no:3,name:"run_status_changed",kind:"message",oneof:"change",T:()=>Dc},{no:4,name:"node_status_changed",kind:"message",oneof:"change",T:()=>_c},{no:5,name:"log_appended",kind:"message",oneof:"change",T:()=>Mc},{no:6,name:"agent_event_appended",kind:"message",oneof:"change",T:()=>Rc},{no:7,name:"trace_finalized",kind:"message",oneof:"change",T:()=>wc},{no:8,name:"catalog_replaced",kind:"message",oneof:"change",T:()=>Uc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.sequence="0",i.change={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBc},{no:3,name:"reset_required",kind:"message",oneof:"payload",T:()=>qc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.payload={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posawait this.client.getRunSnapshot({runId:g.runId,operatorInstanceId:f,asOfSequence:c}).response)),d=await this.getCatalog();if(a.operatorInstanceId!==f||d.operatorInstanceId!==f||a.revision!==d.revision||BigInt(a.asOfSequence)>BigInt(c)||BigInt(d.asOfSequence)d.nodeId===i);if(!o?.eventPageToken)return[];const f=[];let c=o.eventPageToken,v="0";do{const d=await this.client.listAgentEvents({pageToken:c,afterEventSequence:v,pageSize:100}).response;f.push(...d.events),d.events.length&&(v=d.events.at(-1).eventSequence),c=d.nextPageToken}while(c);return f}async listLogs(a){if(!a.logPageToken)return[];const i=[];let o=a.logPageToken,f="0";do{const c=await this.client.listLogs({pageToken:o,afterSequence:f,pageSize:100}).response;i.push(...c.logs),c.logs.length&&(f=c.logs.at(-1).sequence),o=c.nextPageToken}while(o);return i}async readDetail(a){const i=[];for await(const v of this.client.readDetail({bodyToken:a}).responses)i.push(v.data);const o=i.reduce((v,d)=>v+d.length,0),f=new Uint8Array(o);let c=0;for(const v of i)f.set(v,c),c+=v.length;return JSON.parse(new TextDecoder().decode(f))}async startRun(a,i){return(await this.client.startRun({flowName:"",workflowSelector:a,runId:"",inputJson:i===void 0?"":JSON.stringify(i),contextJson:"",inputFiles:[]}).response).runId}async cancelRun(a){await this.client.cancelRun({runId:a}).response}}function np(y){return y==="success"?"✓":y==="failed"?"!":y==="running"?"●":"·"}function lp({workflow:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState(!0);return p.jsxs("div",{className:"workflow-branch",children:[p.jsxs("div",{className:"tree-row",children:[p.jsx("button",{type:"button",className:"tree-disclosure",onClick:()=>c(v=>!v),"aria-label":`${f?"Collapse":"Expand"} ${y.displayName}`,children:f?"⌄":"›"}),p.jsxs("button",{type:"button",className:i?.kind==="workflow"&&i.workflowId===y.workflowId?"tree-select active":"tree-select",onClick:()=>o({kind:"workflow",workflowId:y.workflowId}),children:[p.jsx("span",{className:"workflow-glyph",children:"◇"}),p.jsxs("span",{children:[p.jsx("strong",{children:y.displayName}),p.jsx("small",{children:y.relativeFile})]})]})]}),f&&p.jsxs("div",{className:"run-branches",children:[a.map(v=>{const d=v.summary;return p.jsxs("button",{type:"button",className:i?.kind==="run"&&i.runId===d.runId?"run-select active":"run-select",onClick:()=>o({kind:"run",workflowId:y.workflowId,runId:d.runId}),children:[p.jsx("span",{className:`run-dot status-${d.status}`,children:np(d.status)}),p.jsxs("span",{children:[p.jsx("strong",{children:d.runId}),p.jsx("small",{children:d.startedAt?`Created at sequence ${d.createdSequence}`:"Awaiting start"})]})]},d.runId)}),!a.length&&p.jsx("span",{className:"no-runs",children:"No runs yet"})]})]})}function ap(y,a){return y.workflows.filter(i=>i.rootAlias===a.alias)}function ip({catalog:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState({});if(!y)return p.jsxs("aside",{className:"explorer skeleton","aria-label":"Explorer",children:[p.jsx("div",{}),p.jsx("div",{}),p.jsx("div",{})]});const v=y.scanTargets.length?y.scanTargets:[{alias:"workflows",targetPath:"Configured workflows",kind:"directory"}];return p.jsxs("aside",{className:"explorer","aria-label":"Explorer",children:[p.jsxs("header",{children:[p.jsx("span",{className:"eyebrow",children:"Navigator"}),p.jsx("h2",{children:"Explorer"}),p.jsxs("span",{className:"catalog-revision",children:["catalog r",y.revision]})]}),y.diagnostics.length>0&&p.jsxs("details",{className:"diagnostics",open:!0,children:[p.jsxs("summary",{children:[y.diagnostics.length," reload issue",y.diagnostics.length===1?"":"s"]}),y.diagnostics.map(d=>p.jsxs("div",{children:[p.jsx("strong",{children:d.kind.replaceAll("_"," ")}),p.jsx("span",{children:d.path}),p.jsx("p",{children:d.message})]},`${d.path}-${d.kind}`))]}),p.jsx("div",{className:"target-list",children:v.map(d=>{const g=d.alias==="workflows"?y.workflows:ap(y,d),m=!!f[d.alias];return p.jsxs("section",{className:"target",children:[p.jsxs("button",{type:"button",className:"target-heading",onClick:()=>c(z=>{const j={...z};return j[d.alias]?delete j[d.alias]:j[d.alias]=!0,j}),children:[p.jsx("span",{children:m?"›":"⌄"}),p.jsx("span",{className:"target-kind",children:d.kind==="file"?"F":"D"}),p.jsxs("span",{children:[p.jsx("strong",{children:d.alias}),p.jsx("small",{title:d.targetPath,children:d.targetPath})]})]}),!m&&p.jsx("div",{className:"workflow-list",children:g.map(z=>p.jsx(lp,{workflow:z,runs:Object.values(a).filter(j=>j.summary?.workflowId===z.workflowId).sort((j,R)=>Number(R.summary.createdSequence)-Number(j.summary.createdSequence)),selection:i,onSelect:o},z.workflowId))})]},d.alias)})})]})}function Kn(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function Id(y){return Array.isArray(y)?y.flatMap(a=>!Kn(a)||typeof a.name!="string"?[]:[{name:a.name,type:typeof a.type=="string"?a.type:void 0,description:typeof a.description=="string"?a.description:void 0}]):[]}function eh(y){if(y)try{const a=JSON.parse(y);if(!Kn(a))return;const i=Kn(a.signature)?a.signature:{};return{instructions:typeof i.instructions=="string"?i.instructions:"",inputs:Id(i.inputs),outputs:Id(i.outputs),model:a.models,runtime:a.runtime,skills:a.skills,tools:a.tools}}catch{return}}const nh=J.memo(({data:y})=>p.jsxs("button",{type:"button",className:`node-card ${y.status?`status-${y.status}`:"blueprint"}`,onClick:y.onOpen,"aria-label":`Inspect ${y.label}`,children:[p.jsx(Qd,{type:"target",position:Kd.Left,isConnectable:!1}),p.jsx("span",{className:"node-kicker",children:y.nodeType}),p.jsx("strong",{children:y.label}),y.status&&p.jsx("span",{className:"node-status",children:y.status}),y.duration&&p.jsx("span",{className:"node-duration",children:y.duration}),y.error&&p.jsx("span",{className:"node-error",children:y.error}),y.declaration&&p.jsxs("span",{className:"field-grid",children:[p.jsxs("span",{children:[p.jsx("small",{children:"Inputs"}),y.declaration.inputs.map(a=>p.jsx("span",{className:"field",children:a.name},`input-${a.name}`))]}),p.jsxs("span",{children:[p.jsx("small",{children:"Outputs"}),y.declaration.outputs.map(a=>p.jsx("span",{className:"field",children:a.name},`output-${a.name}`))]})]}),p.jsx(Qd,{type:"source",position:Kd.Right,isConnectable:!1})]}));nh.displayName="WorkflowNodeCard";function up(y){const a=Object.fromEntries(y.nodeIds.map(c=>[c,0]));for(const c of Object.values(y.graph))for(const v of c.children)a[v]=(a[v]??0)+1;const i={},o=y.nodeIds.filter(c=>a[c]===0);for(const c of o)i[c]=0;for(let c=0;cv.map((d,g)=>[d,{x:Number(c)*330,y:g*220-(v.length-1)*110}])))}function sp(y){if(!y.startedAt)return;const a=y.endedAt||Date.now()/1e3,i=Math.max(0,a-y.startedAt);return i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m`}function cp({workflow:y,runTopology:a,runNodes:i=[],onOpenNode:o}){const f=J.useMemo(()=>{if(a)return a;if(y)return{nodeIds:y.nodeIds,graph:y.graph,nodeTypes:y.nodeTypes,displayNames:y.displayNames,agentMetadataJson:y.agentMetadataJson}},[a,y]),c=J.useMemo(()=>{if(!f)return{nodes:[],edges:[]};const v=up(f),d=Object.fromEntries(i.map(j=>[j.nodeId,j])),g=f.nodeIds.map(j=>{const R=d[j];return{id:j,type:"workflow",position:v[j],data:{label:f.displayNames[j]||R?.name||j,nodeType:f.nodeTypes[j]||R?.nodeType||"step",status:R?.status,error:R?.error,duration:R?sp(R):void 0,declaration:y?eh(y.agentMetadataJson[j]):void 0,onOpen:()=>o(j)}}}),m=new Set,z=[];for(const[j,R]of Object.entries(f.graph))for(const C of R.children){const V=`${j}->${C}`;m.has(V)||(m.add(V),z.push({id:V,source:j,target:C,markerEnd:{type:_m.ArrowClosed},className:"dag-edge"}))}return{nodes:g,edges:z}},[o,i,f,y]);return p.jsxs(Mm,{nodes:c.nodes,edges:c.edges,nodeTypes:{workflow:nh},fitView:!0,fitViewOptions:{padding:.24},minZoom:.25,maxZoom:1.8,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[p.jsx(Rm,{color:"rgba(255,255,255,.06)",gap:24,size:1}),p.jsx(wm,{showInteractive:!1})]})}function op(y,a,i){const o=new Array(y);return new Proxy(o,{get(f,c,v){if(typeof c=="string"){const d=c.charCodeAt(0);if(d>=48&&d<=57){const g=+c;if(Number.isInteger(g)&&g>=0&&go[z]!==m))&&(o=d,f=a(...d),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(f),c=!1),f}return v.updateDeps=d=>{o=d},v}function Pd(y,a){if(y===void 0)throw new Error("Unexpected undefined");return y}const fp=(y,a)=>Math.abs(y-a)<1.01,rp=(y,a,i)=>{let o;return function(...f){y.clearTimeout(o),o=y.setTimeout(()=>a.apply(this,f),i)}};let _a;const Lc=()=>{if(_a!==void 0)return _a;if(typeof navigator>"u")return _a=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return _a=!0;const y=navigator.maxTouchPoints;return _a=navigator.platform==="MacIntel"&&y!==void 0&&y>0},th=y=>{const{offsetWidth:a,offsetHeight:i}=y;return{width:a,height:i}},dp=y=>y,hp=y=>{const a=Math.max(y.startIndex-y.overscan,0),o=Math.min(y.endIndex+y.overscan,y.count-1)-a+1,f=new Array(o);for(let c=0;c{const i=y.scrollElement;if(!i)return;const o=y.targetWindow;if(!o)return;const f=v=>{const{width:d,height:g}=v;a({width:Math.round(d),height:Math.round(g)})};if(f(th(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(v=>{const d=()=>{const g=v[0];if(g?.borderBoxSize){const m=g.borderBoxSize[0];if(m){f({width:m.inlineSize,height:m.blockSize});return}}f(th(i))};y.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},tu={passive:!0},mp=typeof window>"u"?!0:"onscrollend"in window,yp=(y,a,i)=>{const o=y.scrollElement;if(!o)return;const f=y.targetWindow;if(!f)return;const c=y.options.useScrollendEvent&∓let v=0;const d=c?null:rp(f,()=>a(v,!1),y.options.isScrollingResetDelay),g=j=>()=>{v=i(o),d?.(),a(v,j)},m=g(!0),z=g(!1);return o.addEventListener("scroll",m,tu),c&&o.addEventListener("scrollend",z,tu),()=>{o.removeEventListener("scroll",m),c&&o.removeEventListener("scrollend",z)}},pp=(y,a)=>yp(y,a,i=>{const{horizontal:o,isRtl:f}=y.options;return o?i.scrollLeft*(f&&-1||1):i.scrollTop}),vp=(y,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(y),f=i.options.getItemKey(o);return i.itemSizeCache.get(f)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(y),f=i.options.getItemKey(o),c=i.itemSizeCache.get(f);if(c!==void 0)return c}return y[i.options.horizontal?"offsetWidth":"offsetHeight"]},bp=(y,{adjustments:a=0,behavior:i},o)=>{var f,c;(c=(f=o.scrollElement)==null?void 0:f.scrollTo)==null||c.call(f,{[o.options.horizontal?"left":"top"]:y+a,behavior:i})},Sp=bp;class Tp{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,f;return((f=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:f.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(f=>{f.forEach(c=>{const v=()=>{const d=c.target,g=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,z]of this.elementsCache)if(z===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(d,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(v):v()})}));return{disconnect:()=>{var f;(f=o())==null||f.disconnect(),i=null},observe:f=>{var c;return(c=o())==null?void 0:c.observe(f,{box:"border-box"})},unobserve:f=>{var c;return(c=o())==null?void 0:c.unobserve(f)}}})(),this.range=null,this.setOptions=i=>{var o,f;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:dp,rangeExtractor:hp,onChange:()=>{},measureElement:vp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const R in i){const C=i[R];C!==void 0&&(c[R]=C)}const v=this.options;let d=null,g=null,m=!1;if(v!==void 0&&v.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const R=v.count,C=c.count,V=this.getMeasurements(),G=R>0?((o=V[0])==null?void 0:o.key)??v.getItemKey(0):null,it=R>0?((f=V[R-1])==null?void 0:f.key)??v.getItemKey(R-1):null;if(C!==R||R>0&&C>0&&(c.getItemKey(0)!==G||c.getItemKey(C-1)!==it)){m=!0;const tt=R>0?this.getVirtualItemForOffset(this.getScrollOffset())??V[0]:null;tt&&(d=[tt.key,this.getScrollOffset()-tt.start]);const ht=c.followOnAppend===!0?"auto":c.followOnAppend||null;ht&&C>R&&this.isAtEnd(v.scrollEndThreshold)&&(R===0||c.getItemKey(C-1)!==it)&&(g=ht)}}this.options=c,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let z=!1,j=0;if(d&&this.scrollOffset!==null){const[R,C]=d,V=this.getMeasurements(),{count:G,getItemKey:it}=this.options;let K=0;for(;K{var o,f;(f=(o=this.options).onChange)==null||f.call(o,this,i)},this.maybeNotify=Ml(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,v)=>{if(v&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=v?d===c?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Lc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",v,tu),c.addEventListener("touchend",d,tu),this.unsubs.push(()=>{c.removeEventListener("touchstart",v),c.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const f=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,f&&this.scrollElement&&this.options.enabled){const[c,v,d,g]=f;c!==null&&!d&&(Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?g!==0&&(this._iosDeferredAdjustment+=g):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const f=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=f,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ml(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,f,c,v,d,g,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m}),{key:!1}),this.getMeasurements=Ml(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m},z)=>{const j=this.itemSizeCache;if(!v)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const K of this.laneAssignments.keys())K>=i&&this.laneAssignments.delete(K);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(K=>{this.itemSizeCache.set(K.key,K.size)}));const R=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),d===1){const K=i*2;let Z=this._flatMeasurements;if(!Z||Z.length0&&st.set(Z.subarray(0,R*2)),Z=st,this._flatMeasurements=Z}let tt;if(R===0)tt=o+f;else{const st=R-1;tt=Z[st*2]+Z[st*2+1]+m}for(let st=R;st1){ht=tt;const Kt=V[ht],At=Kt!==void 0?C[Kt]:void 0;st=At?At.end+m:o+f}else if(it===d){let Kt=0,At=G[0],Ht=V[0];for(let Jt=1;Jtthis.options.debug}),this.calculateRange=Ml(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,f,c)=>i.length===0||o===0?(this.range=null,null):(this.range=zp(i,o,f,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ml(()=>{let i=null,o=null;const f=this.calculateRange();return f&&(i=f.startIndex,o=f.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,f,c,v)=>c===null||v===null?[]:i({startIndex:c,endIndex:v,overscan:o,count:f}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,f=i.getAttribute(o);return f?parseInt(f,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const f=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(f!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),v=Math.max(0,f-c),d=Math.min(this.options.count-1,f+c);return i>=v&&i<=d}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((v,d)=>{v.isConnected||(this.observer.unobserve(v),this.elementsCache.delete(d))});return}const o=this.indexFromElement(i),f=this.options.getItemKey(o),c=this.elementsCache.get(f);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(f,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var f,c;if(i<0||i>=this.options.count)return;let v,d,g;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)g=this.options.getItemKey(i),d=m[i*2],v=m[i*2+1];else{const R=this.measurementsCache[i];if(!R)return;g=R.key,d=R.start,v=R.size}const z=this.itemSizeCache.get(g)??v,j=o-z;if(j!==0){const R=this.options.anchorTo==="end"&&((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,C=R?this.getTotalSize():0,V=this.getScrollOffset()+this.scrollAdjustments,it=!this.itemSizeCache.has(g)?d[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const f=[];for(let c=0,v=i.length;cthis.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const f=this._flatMeasurements,c=this.options.lanes===1&&f!=null,v=lh(0,o.length-1,c?d=>f[d*2]:d=>Pd(o[d]).start,i);return Pd(o[v])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,f=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),v=this.getScrollOffset();o==="auto"&&(o=i>=v+c?"end":"start"),o==="center"?i+=(f-c)/2:o==="end"&&(i-=c);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const f=this.getSize(),c=this.getScrollOffset(),v=this.measurementsCache[i];if(!v)return;if(o==="auto")if(v.end>=c+f-this.options.scrollPaddingEnd)o="end";else if(v.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?v.end+this.options.scrollPaddingEnd:v.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,v.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),v=this.now();this.scrollState={index:null,align:o,behavior:f,startedAt:v,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[v,d]=c,g=this.now();this.scrollState={index:i,align:d,behavior:f,startedAt:g,lastTargetOffset:v,stableFrames:0},this._scrollToOffset(v,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const f=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let f;if(o.length===0)f=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,v=this._flatMeasurements;v!=null?f=v[c*2]+v[c*2+1]:f=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let v=o.length-1;for(;v>=0&&c.some(d=>d===null);){const d=o[v];c[d.lane]===null&&(c[d.lane]=d.end),v--}f=Math.max(...c.filter(d=>d!==null))}return Math.max(f-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const f of o)f&&this.itemSizeCache.has(f.key)&&i.push({index:f.index,key:f.key,start:f.start,size:f.size,end:f.end,lane:f.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:f})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:f,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,f=o?o[0]:this.scrollState.lastTargetOffset,c=1,v=f!==this.scrollState.lastTargetOffset;if(!v&&fp(f,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==f&&this._scrollToOffset(f,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,v){const d=this.getSize()||600,g=Math.abs(f-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&g>d;this.scrollState.lastTargetOffset=f,m||(this.scrollState.behavior="auto"),this._scrollToOffset(f,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const lh=(y,a,i,o)=>{for(;y<=a;){const f=(y+a)/2|0,c=i(f);if(co)a=f-1;else return f}return y>0?y-1:0};function kp(y,a,i){let o=0;for(;o<=a;){const f=(o+a)/2|0,c=y[f*2];if(ci)a=f-1;else return f}return o>0?o-1:0}function zp(y,a,i,o,f){const c=y.length-1;if(y.length<=o)return{startIndex:0,endIndex:c};if(o===1&&f!==null){const m=kp(f,c,i);let z=m;const j=i+a;for(;zy[m].start,i),g=d;if(o===1)for(;g1){const m=Array(o).fill(0);for(;gj=0&&z.some(j=>j>=i);){const j=y[d];z[j.lane]=j.start,d--}d=Math.max(0,d-d%o),g=Math.min(c,g+(o-1-g%o))}return{startIndex:d,endIndex:g}}const Hc=typeof document<"u"?J.useLayoutEffect:J.useEffect;function Ep({useFlushSync:y=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const f=J.useReducer(z=>z+1,0)[1],c=J.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const v=z=>{const j=c.current;if(!j.enabled||!j.container)return;const R=z.getTotalSize();if(R!==j.lastSize){j.lastSize=R;const C=z.options.horizontal?"width":"height";j.container.style[C]=`${R}px`}},d=z=>{const j=c.current;if(!j.enabled||!j.container)return;v(z);const R=!!z.options.horizontal,C=j.mode==="transform",V=R?"left":"top",G=z.options.scrollMargin,it=z.getVirtualItems();for(const K of it){const Z=K.start-G,tt=z.elementsCache.get(K.key);tt&&j.lastPositions.get(tt)!==Z&&(j.lastPositions.set(tt,Z),C?tt.style.transform=R?`translate3d(${Z}px, 0, 0)`:`translate3d(0, ${Z}px, 0)`:tt.style[V]=`${Z}px`)}},g={...o,onChange:(z,j)=>{var R;const C=c.current;let V=!0;if(C.enabled){d(z);const G=z.range,it=C.prevRange;V=!it||it.isScrolling!==z.isScrolling||it.startIndex!==G?.startIndex||it.endIndex!==G?.endIndex,V&&(C.prevRange=G?{startIndex:G.startIndex,endIndex:G.endIndex,isScrolling:z.isScrolling}:null)}V&&(y&&j?Um.flushSync(f):f()),(R=o.onChange)==null||R.call(o,z,j)}},[m]=J.useState(()=>{const z=new Tp(g);return Object.assign(z,{containerRef:j=>{const R=c.current;if(R.container=j,R.lastSize=null,j&&R.enabled){const C=z.getTotalSize();R.lastSize=C;const V=z.options.horizontal?"width":"height";j.style[V]=`${C}px`}}})});return m.setOptions(g),Hc(()=>m._didMount(),[]),Hc(()=>(v(m),m._willUpdate())),Hc(()=>{d(m)}),m}function Np(y){return Ep({observeElementRect:gp,observeElementOffset:pp,scrollToFn:Sp,...y})}function Qn({value:y,depth:a=0}){return y===null?p.jsx("span",{className:"value-null",children:"null"}):typeof y=="string"?p.jsx("span",{className:"value-string",children:y}):typeof y=="number"||typeof y=="boolean"?p.jsx("span",{className:"value-scalar",children:String(y)}):Array.isArray(y)?p.jsx("ol",{className:"value-list",children:y.map((i,o)=>p.jsx("li",{children:p.jsx(Qn,{value:i,depth:a+1})},`${a}-${o}`))}):Kn(y)?y.kind==="predict_rlm_file"&&typeof y.path=="string"?p.jsxs("span",{className:"file-value",title:"Reported host path; contents are not copied",children:[p.jsx("span",{"aria-hidden":"true",children:"↗"}),p.jsxs("span",{children:[p.jsx("small",{children:"PredictRLM file"}),p.jsx("code",{children:y.path})]})]}):y.kind==="unavailable"&&typeof y.reason=="string"?p.jsxs("span",{className:"value-unavailable",children:["Unavailable · ",y.reason]}):p.jsx("dl",{className:"value-object",children:Object.entries(y).map(([i,o])=>p.jsxs("div",{children:[p.jsx("dt",{children:i}),p.jsx("dd",{children:p.jsx(Qn,{value:o,depth:a+1})})]},i))}):p.jsx("span",{className:"value-unavailable",children:"Unavailable"})}function Vc({value:y}){return p.jsx("pre",{className:"json-block",children:JSON.stringify(y,null,2)})}function Ap(y){if(Kn(y))return Kn(y.data)?y.data:y}function Op({api:y,workflow:a,run:i,nodeId:o,liveEvents:f=[],liveLogs:c=[],onClose:v}){const[d,g]=J.useState("overview"),[m,z]=J.useState([]),[j,R]=J.useState([]),[C,V]=J.useState(),[G,it]=J.useState(),[K,Z]=J.useState(),[tt,ht]=J.useState(!0),st=J.useRef(new Map),Bt=J.useRef(null),$=i?.nodes.find(w=>w.nodeId===o),jt=i?i.topology?.agentMetadataJson[o??""]:a?.agentMetadataJson[o??""],Dt=jt?eh(jt):void 0;J.useEffect(()=>{if(g("overview"),z([]),R([]),V(void 0),it(void 0),ht(!0),st.current.clear(),!i||!o)return;let w=!0;return Promise.all([y.listAgentEvents(i,o),y.listLogs(i)]).then(([H,bt])=>{w&&(z(H),R(bt.filter(ct=>!ct.nodeId||ct.nodeId===o)))}).catch(H=>{w&&Z(H instanceof Error?H.message:"Details unavailable")}),()=>{w=!1}},[y,o,i]);const Kt=J.useMemo(()=>{const w=new Map;for(const H of[...m,...f])w.set(H.eventSequence,H);return[...w.values()].sort((H,bt)=>Number(H.eventSequence)-Number(bt.eventSequence))},[m,f]),At=Kt.filter(w=>w.eventKind==="iteration.recorded"),Ht=J.useMemo(()=>{const w=new Map;for(const H of[...j,...c])w.set(H.sequence,H);return[...w.values()].sort((H,bt)=>Number(H.sequence)-Number(bt.sequence))},[c,j]),Jt=J.useMemo(()=>{const w=$?.trace?.header?.usageJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.usageJson]),de=J.useMemo(()=>{const w=$?.trace?.header?.telemetryJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.telemetryJson]),he=d==="inputs"?Dt?.inputs:d==="output"?Dt?.outputs:void 0,_=Np({count:At.length,getScrollElement:()=>Bt.current,estimateSize:()=>64,overscan:6});if(J.useEffect(()=>{!tt||!At.length||V(At.at(-1).eventSequence)},[tt,At]),J.useEffect(()=>{const w=Kt.find(ct=>ct.eventSequence===C);if(!w?.bodyToken){it(void 0);return}const H=st.current.get(w.bodyToken);if(H!==void 0){it(H);return}let bt=!0;return it(void 0),Z(void 0),y.readDetail(w.bodyToken).then(ct=>{if(bt){for(st.current.delete(w.bodyToken),st.current.set(w.bodyToken,ct);st.current.size>8;){const ot=st.current.keys().next().value;if(ot===void 0)break;st.current.delete(ot)}it(ct)}}).catch(ct=>{bt&&Z(ct instanceof Error?ct.message:"Detail unavailable")}),()=>{bt=!1}},[y,Kt,C]),J.useEffect(()=>{const w=d==="inputs"?"run.started":d==="output"?"run.succeeded":void 0;if(!w)return;const H=[...Kt].reverse().find(bt=>bt.eventKind===w);H&&V(H.eventSequence)},[Kt,d]),!i&&a&&o)return p.jsxs("aside",{className:"inspector","aria-label":"Node declaration",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Declaration"}),p.jsx("h2",{children:a.displayNames[o]||o})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),Dt?p.jsxs("div",{className:"inspector-body declaration",children:[p.jsxs("section",{children:[p.jsx("h3",{children:"Instructions"}),p.jsx("p",{className:"instructions",children:Dt.instructions||"No instructions"})]}),p.jsxs("section",{className:"signature-columns",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"Inputs"}),Dt.inputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]}),p.jsxs("div",{children:[p.jsx("h3",{children:"Outputs"}),Dt.outputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Runtime"}),p.jsx(Vc,{value:Dt.runtime})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Models"}),p.jsx(Vc,{value:Dt.model})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Skills & tools"}),p.jsx(Vc,{value:{skills:Dt.skills,tools:Dt.tools}})]})]}):p.jsx("p",{className:"empty-copy",children:"This node has no agent declaration metadata."})]});if(!i||!$)return null;const B=Ap(G),Q=d==="inputs"?"inputs":"outputs";return p.jsxs("aside",{className:"inspector","aria-label":"Run inspector",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Historical execution"}),p.jsx("h2",{children:$.name}),p.jsx("span",{className:`status-pill status-${$.status}`,children:$.status})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),p.jsx("nav",{className:"inspector-tabs","aria-label":"Run detail views",children:["overview","inputs","output","trace","logs"].map(w=>p.jsx("button",{type:"button",className:d===w?"active":"",onClick:()=>g(w),children:w},w))}),p.jsxs("div",{className:"inspector-body",children:[K&&p.jsx("p",{className:"error-banner",children:K}),d==="overview"&&p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:"metric-grid",children:[p.jsxs("div",{children:[p.jsx("small",{children:"Status"}),p.jsx("strong",{children:$.status})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Revision"}),p.jsx("strong",{children:$.revision})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Started"}),p.jsx("strong",{children:$.startedAt?"yes":"—"})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Duration"}),p.jsx("strong",{children:$.startedAt&&$.endedAt?`${Math.max(0,$.endedAt-$.startedAt).toFixed(2)}s`:"—"})]})]}),$.error&&p.jsx("p",{className:"node-failure",children:$.error}),$.trace&&p.jsxs("section",{children:[p.jsx("h3",{children:"Trace header"}),p.jsxs("dl",{className:"trace-header",children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Status"}),p.jsx("dd",{children:$.trace.status})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Events"}),p.jsx("dd",{children:$.trace.eventCount})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Size"}),p.jsxs("dd",{children:[$.trace.sizeBytes," B"]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Complete"}),p.jsx("dd",{children:$.trace.complete?"yes":"no"})]}),$.trace.header&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Model"}),p.jsx("dd",{children:$.trace.header.model})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Iterations"}),p.jsxs("dd",{children:[$.trace.header.iterations,"/",$.trace.header.maxIterations]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Duration"}),p.jsxs("dd",{children:[$.trace.header.durationMs," ms"]})]})]})]}),Jt!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Usage"}),p.jsx(Qn,{value:Jt})]}),de!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Telemetry"}),p.jsx(Qn,{value:de})]})]})]}),(d==="inputs"||d==="output")&&p.jsxs("section",{children:[p.jsx("h3",{children:d==="inputs"?"Invocation inputs":"Terminal output"}),he?.length?p.jsxs("div",{className:"declared-fields",children:[p.jsx("small",{children:"Declared fields"}),he.map(w=>p.jsxs("span",{children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type})]},w.name))]}):null,B&&Q in B?p.jsx(Qn,{value:B[Q]}):p.jsxs("p",{className:"empty-copy",children:["No retained ",d," are available."]})]}),d==="trace"&&p.jsxs("section",{className:"trace-layout",children:[p.jsxs("div",{className:"trace-toolbar",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"RunTrace"}),p.jsxs("span",{children:[At.length," complete turns"]})]}),p.jsx("button",{type:"button",className:tt?"toggle active":"toggle",onClick:()=>ht(w=>!w),children:tt?"Following live":"Follow latest"})]}),p.jsx("div",{className:"turn-list",ref:Bt,children:p.jsx("div",{style:{height:_.getTotalSize(),position:"relative"},children:_.getVirtualItems().map(w=>{const H=At[w.index];return p.jsxs("button",{type:"button",className:`turn-row ${C===H.eventSequence?"active":""} ${H.error?"failed":""}`,style:{transform:`translateY(${w.start}px)`},onClick:()=>{ht(!1),V(H.eventSequence)},children:[p.jsxs("strong",{children:["Turn ",H.iteration??w.index+1]}),p.jsx("span",{children:H.durationMs?`${H.durationMs} ms`:"—"}),p.jsxs("small",{children:[H.toolCount," tools · ",H.predictCount," predicts"]})]},H.eventSequence)})})}),p.jsx("div",{className:"turn-detail",children:G!==void 0?p.jsx(Qn,{value:G}):p.jsx("p",{className:"empty-copy",children:"Select a turn."})})]}),d==="logs"&&p.jsxs("section",{children:[p.jsx("h3",{children:"Node logs"}),p.jsx("div",{className:"log-list",children:Ht.map(w=>p.jsxs("button",{type:"button",onClick:()=>{y.readDetail(w.bodyToken).then(it).catch(H=>{Z(H instanceof Error?H.message:"Log unavailable")})},children:[p.jsx("span",{className:`log-level level-${w.level}`,children:w.level}),p.jsx("time",{children:new Date(w.timestamp*1e3).toLocaleTimeString()}),p.jsxs("span",{children:["#",w.sequence]})]},w.sequence))}),G!==void 0&&p.jsx(Qn,{value:G})]})]})]})}function xp({value:y,onChange:a}){const i=J.useRef(null);return J.useEffect(()=>{if(!i.current)return;const o=new Ii({parent:i.current,state:Cm.create({doc:y,extensions:[Lm(),Hm.of([]),Ii.lineWrapping,Ii.theme({"&":{backgroundColor:"#0e1112",color:"#dce4df"},".cm-content":{caretColor:"#eeff8c",minHeight:"110px"},".cm-gutters":{backgroundColor:"#0e1112",color:"#626b67",border:"0"},"&.cm-focused":{outline:"1px solid #778357"}}),Ii.updateListener.of(f=>{f.docChanged&&a(f.state.doc.toString())})]})});return()=>o.destroy()},[]),p.jsx("div",{className:"json-editor",ref:i})}function jp({workflow:y,run:a,pending:i,onStart:o,onCancel:f}){const[c,v]=J.useState(!1),[d,g]=J.useState("{}"),[m,z]=J.useState(),j=a?.summary?.status==="pending"||a?.summary?.status==="running",R=async()=>{if(!y)return;z(void 0);let C;if(c)try{const V=JSON.parse(d);if(!Kn(V))throw new Error("Run input must be a JSON object");C=V}catch(V){z(V instanceof Error?V.message:"Run input is invalid JSON");return}try{await o(y.workflowId,C)}catch(V){z(V instanceof Error?V.message:"Operator rejected the run")}};return p.jsxs("div",{className:"run-controls",children:[y&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"run-button",disabled:i?.kind==="start",onClick:()=>{R()},children:i?.kind==="start"?"Requesting…":"Run"}),p.jsx("button",{type:"button",className:`input-toggle ${c?"active":""}`,onClick:()=>v(C=>!C),children:c?"Hide JSON input":"Add JSON input"})]}),j&&a?.summary&&p.jsx("button",{type:"button",className:"cancel-button",disabled:i?.kind==="cancel",onClick:()=>{z(void 0),f(a.summary.runId).catch(C=>{z(C instanceof Error?C.message:"Cancellation failed")})},children:i?.kind==="cancel"?"Cancelling…":"Cancel run"}),c&&y&&p.jsxs("div",{className:"input-popover",children:[p.jsxs("div",{children:[p.jsx("strong",{children:"Workflow input"}),p.jsx("span",{children:"Schema-blind JSON object"})]}),p.jsx(xp,{value:d,onChange:g})]}),m&&p.jsx("div",{className:"action-error",children:m})]})}const ah={runs:{},liveEvents:{},liveLogs:{},operatorInstanceId:"",sequence:"0",connection:"connecting"};function Dp(y,a){if(a.type==="baseline"){const g=Object.fromEntries(a.baseline.runs.filter(m=>m.summary).map(m=>[m.summary.runId,m]));return{...ah,catalog:a.baseline.catalog,runs:g,operatorInstanceId:a.baseline.catalog.operatorInstanceId,sequence:a.baseline.asOfSequence,connection:"live"}}if(a.type==="connection")return{...y,connection:a.connection,error:a.error};if(a.type==="action")return{...y,action:a.action};const{envelope:i}=a;if(i.operatorInstanceId!==y.operatorInstanceId)throw new Error("Operator epoch changed");if(i.payload.oneofKind!=="update")throw new Error("Operator requested a structural reset");const o=i.payload.update;if(BigInt(o.sequence)!==BigInt(y.sequence)+1n)throw new Error(`Operator update gap after sequence ${y.sequence}`);const f={...y,sequence:o.sequence,error:void 0},c=o.change;if(c.oneofKind==="catalogReplaced")return c.catalogReplaced.catalog&&(f.catalog=c.catalogReplaced.catalog),f;if(c.oneofKind==="runCreated"&&c.runCreated.summary){const g=c.runCreated.summary;return f.runs={...y.runs,[g.runId]:{operatorInstanceId:y.operatorInstanceId,asOfSequence:o.sequence,summary:g,nodes:c.runCreated.nodes,latestLogSequence:"0",logPageToken:"",topology:c.runCreated.topology}},f}const v=c.oneofKind==="runStatusChanged"?c.runStatusChanged.runId:c.oneofKind==="nodeStatusChanged"?c.nodeStatusChanged.runId:c.oneofKind==="logAppended"?c.logAppended.runId:c.oneofKind==="agentEventAppended"?c.agentEventAppended.runId:c.oneofKind==="traceFinalized"?c.traceFinalized.runId:"",d=y.runs[v];if(!d)throw new Error(`Operator update referenced unknown run ${v}`);if(c.oneofKind==="runStatusChanged"&&d.summary)f.runs={...y.runs,[v]:{...d,summary:{...d.summary,status:c.runStatusChanged.status,startedAt:c.runStatusChanged.startedAt,endedAt:c.runStatusChanged.endedAt,revision:c.runStatusChanged.revision}}};else if(c.oneofKind==="nodeStatusChanged"){const g=c.nodeStatusChanged;f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(m=>m.nodeId===g.nodeId?{...m,status:g.status,startedAt:g.startedAt,endedAt:g.endedAt,revision:g.revision,error:g.error}:m)}}}else if(c.oneofKind==="logAppended"&&c.logAppended.log)f.liveLogs={...y.liveLogs,[v]:[...y.liveLogs[v]??[],c.logAppended.log]};else if(c.oneofKind==="agentEventAppended"&&c.agentEventAppended.event){const g=`${v}:${c.agentEventAppended.nodeId}`;f.liveEvents={...y.liveEvents,[g]:[...y.liveEvents[g]??[],c.agentEventAppended.event]}}else c.oneofKind==="traceFinalized"&&c.traceFinalized.trace&&(f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(g=>g.nodeId===c.traceFinalized.nodeId?{...g,trace:c.traceFinalized.trace}:g)}});return f}function _p(y){const[a,i]=J.useReducer(Dp,ah),o=J.useRef(0),f=J.useCallback(async()=>{const d=await y.loadBaseline();return i({type:"baseline",baseline:d}),d},[y]);J.useEffect(()=>{const d=++o.current;let g=!1;return(async()=>{let z=250;for(;!g&&o.current===d;)try{i({type:"connection",connection:"connecting"});const j=await y.loadBaseline();if(g)return;i({type:"baseline",baseline:j}),z=250;let R=j.asOfSequence;for await(const C of y.streamUpdates(j.catalog.operatorInstanceId,R)){if(g)return;if(C.payload.oneofKind!=="update"||BigInt(C.payload.update.sequence)!==BigInt(R)+1n)break;i({type:"envelope",envelope:C}),R=C.payload.update.sequence}i({type:"connection",connection:"reconnecting"})}catch(j){if(g)return;i({type:"connection",connection:"reconnecting",error:j instanceof Error?j.message:"Operator connection failed"});const{promise:R,resolve:C}=Promise.withResolvers();window.setTimeout(C,z),await R,z=Math.min(z*2,4e3)}})(),()=>{g=!0,o.current+=1}},[y]);const c=J.useCallback(async(d,g)=>{i({type:"action",action:{kind:"start",target:d}});try{return await y.startRun(d,g)}finally{i({type:"action",action:void 0})}},[y]),v=J.useCallback(async d=>{i({type:"action",action:{kind:"cancel",target:d}});try{await y.cancelRun(d)}finally{i({type:"action",action:void 0})}},[y]);return{state:a,reconcile:f,startRun:c,cancelRun:v}}function Mp({api:y}){const{state:a,startRun:i,cancelRun:o}=_p(y),[f,c]=J.useState(),[v,d]=J.useState();J.useEffect(()=>{const G=a.catalog?.workflows??[];if(!G.length){c(void 0);return}if(!f){c({kind:"workflow",workflowId:G[0].workflowId});return}G.some(it=>it.workflowId===f.workflowId)||c({kind:"workflow",workflowId:G[0].workflowId})},[f,a.catalog]);const g=a.catalog?.workflows.find(G=>G.workflowId===f?.workflowId),m=f?.kind==="run"?a.runs[f.runId]:void 0,z=J.useMemo(()=>Object.values(a.runs).filter(G=>G.summary?.workflowId===g?.workflowId).sort((G,it)=>Number(it.summary.createdSequence)-Number(G.summary.createdSequence))[0],[a.runs,g?.workflowId]),j=J.useCallback(G=>d(G),[]),R=J.useCallback(G=>{c(G),d(void 0)},[]),C=m??(f?.kind==="workflow"?z:void 0),V=m&&v?`${m.summary?.runId}:${v}`:"";return p.jsxs("div",{className:"app-shell",children:[p.jsxs("header",{className:"topbar",children:[p.jsxs("div",{className:"brand",children:[p.jsx("span",{className:"brand-mark","aria-hidden":"true",children:"A"}),p.jsxs("div",{children:[p.jsx("strong",{children:"Avalanche"}),p.jsx("span",{children:"Operator"})]})]}),p.jsxs("div",{className:"breadcrumb",children:[p.jsx("span",{children:g?.rootAlias||"Local operator"}),g&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:g.displayName})]}),m?.summary&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:m.summary.runId})]})]}),p.jsxs("div",{className:`connection connection-${a.connection}`,children:[p.jsx("span",{}),a.connection==="live"?"Live":a.connection,p.jsxs("small",{children:["seq ",a.sequence]})]})]}),a.error&&p.jsx("div",{className:"connection-error",children:a.error}),p.jsxs("main",{className:`workspace ${v?"with-inspector":""}`,children:[p.jsx(ip,{catalog:a.catalog,runs:a.runs,selection:f,onSelect:R}),p.jsxs("section",{className:"canvas-shell",children:[p.jsxs("header",{className:"view-header",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:m?"Historical run":"Current definition"}),p.jsx("h1",{children:m?.summary?.runId||g?.displayName||"Operator"}),p.jsx("p",{children:m?`Recorded topology · ${m.summary?.status??"unknown"}`:g?`${g.nodeIds.length} nodes · ${g.relativeFile}`:"Waiting for a workflow catalog"})]}),p.jsx(jp,{workflow:m?void 0:g,run:m??C,pending:a.action,onStart:i,onCancel:o})]}),p.jsxs("div",{className:m?"canvas run-canvas":"canvas blueprint-canvas",children:[g||m?.topology?p.jsx(cp,{workflow:m?void 0:g,runTopology:m?.topology,runNodes:m?.nodes,onOpenNode:j}):p.jsxs("div",{className:"empty-state",children:[p.jsx("span",{children:"◇"}),p.jsx("h2",{children:"No workflows discovered"}),p.jsx("p",{children:"Catalog changes will appear here as the operator scans configured targets."})]}),m&&p.jsxs("div",{className:"historical-badge",children:[p.jsx("span",{children:"Immutable run snapshot"}),"Current workflow changes do not alter this canvas"]})]})]}),v&&p.jsx(Op,{api:y,workflow:g,run:m,nodeId:v,liveEvents:a.liveEvents[V],liveLogs:m?.summary?a.liveLogs[m.summary.runId]:void 0,onClose:()=>d(void 0)})]})]})}const ih=document.getElementById("root");if(!ih)throw new Error("Operator UI root element is missing");Qm.createRoot(ih).render(p.jsx(J.StrictMode,{children:p.jsx(Mp,{api:new ep})})); diff --git a/src/runtime/operator/web_assets/index.html b/src/runtime/operator/web_assets/index.html index 996e876..3815b93 100644 --- a/src/runtime/operator/web_assets/index.html +++ b/src/runtime/operator/web_assets/index.html @@ -5,11 +5,11 @@ Avalanche Operator - + - +
diff --git a/test/operator_tests/test_operator.py b/test/operator_tests/test_operator.py index 1f07b28..2d3469a 100644 --- a/test/operator_tests/test_operator.py +++ b/test/operator_tests/test_operator.py @@ -687,6 +687,13 @@ def test_operator_merges_ordered_evidence_and_final_trace(self): "invocation_id": "agent-invocation", "trace": { "status": "completed", + "model": "main", + "sub_model": "sub", + "iterations": 1, + "max_iterations": 4, + "duration_ms": 125, + "usage": {"main": {"input_tokens": 12}, "sub": {}}, + "telemetry_ref": {"trace_id": "trace-1"}, "evidence": { "run_id": "agent-run", "complete": True, @@ -716,6 +723,11 @@ def test_operator_merges_ordered_evidence_and_final_trace(self): assert node.trace.available is True assert node.trace.complete is True assert node.trace.event_count == 1 + assert node.trace.header is not None + assert node.trace.header.model == "main" + assert node.trace.header.iterations == 1 + assert json.loads(node.trace.header.usage_json)["main"]["input_tokens"] == 12 + assert json.loads(node.trace.header.telemetry_json)["trace_id"] == "trace-1" events = operator.list_agent_events(page_token=node.event_page_token) assert [item.event_sequence for item in events.events] == [1] @@ -890,6 +902,7 @@ def test_prepared_run_retains_immutable_topology_after_source_metadata_changes() "graph": {"source_1": ["step_1"], "step_1": []}, "node_types": {"source_1": "source", "step_1": "step"}, "display_names": {"source_1": "Source", "step_1": "Step"}, + "agent_metadata_json": {"step_1": '{"signature":{"name":"Analyze"}}'}, } run = Operator._run_from_prepared( @@ -902,7 +915,11 @@ def test_prepared_run_retains_immutable_topology_after_source_metadata_changes() prepared["node_ids"].append("new_1") prepared["graph"]["source_1"] = ["new_1"] prepared["display_names"]["step_1"] = "Changed" + prepared["agent_metadata_json"]["step_1"] = '{"signature":{"name":"Changed"}}' assert run.topology.node_ids == ("source_1", "step_1") assert run.topology.graph == (("source_1", ("step_1",)), ("step_1", ())) assert dict(run.topology.display_names) == {"source_1": "Source", "step_1": "Step"} + assert dict(run.topology.agent_metadata_json) == { + "step_1": '{"signature":{"name":"Analyze"}}' + } diff --git a/test/operator_tests/test_protocol_contract.py b/test/operator_tests/test_protocol_contract.py index dd9b387..b89af93 100644 --- a/test/operator_tests/test_protocol_contract.py +++ b/test/operator_tests/test_protocol_contract.py @@ -20,6 +20,7 @@ RunStatus, RunSummary, TraceDescriptor, + TraceHeader, WorkflowTopology, ) from runtime.operator.operator import Operator @@ -71,6 +72,16 @@ def test_snapshot_detail_cursor_and_descriptor_roundtrip(): event_count=42, size_bytes=5_000_000, latest_event_sequence=42, + header=TraceHeader( + status="completed", + model="main", + sub_model="sub", + iterations=3, + max_iterations=5, + duration_ms=1250, + usage_json='{"main":{"input_tokens":12}}', + telemetry_json='{"trace_id":"trace-1"}', + ), ) snapshot = RunSnapshot( operator_instance_id="operator-1", @@ -102,6 +113,7 @@ def test_snapshot_detail_cursor_and_descriptor_roundtrip(): graph=(("agent_1", ()),), node_types=(("agent_1", "step"),), display_names=(("agent_1", "Agent"),), + agent_metadata_json=(("agent_1", '{"signature":{"name":"Analyze"}}'),), ), ) diff --git a/web/operator/src/GraphCanvas.tsx b/web/operator/src/GraphCanvas.tsx index 0767369..ea75852 100644 --- a/web/operator/src/GraphCanvas.tsx +++ b/web/operator/src/GraphCanvas.tsx @@ -178,6 +178,7 @@ export function GraphCanvas({ graph: workflow.graph, nodeTypes: workflow.nodeTypes, displayNames: workflow.displayNames, + agentMetadataJson: workflow.agentMetadataJson, }; }, [runTopology, workflow]); const graph = useMemo(() => { diff --git a/web/operator/src/Inspector.test.tsx b/web/operator/src/Inspector.test.tsx new file mode 100644 index 0000000..d12b3f5 --- /dev/null +++ b/web/operator/src/Inspector.test.tsx @@ -0,0 +1,153 @@ +import { fireEvent, render, screen, waitFor } from "@testing-library/react"; +import { describe, expect, it } from "vitest"; + +import type { OperatorApi } from "./api"; +import type { + AgentEventDescriptorMsg, + CatalogSnapshotMsg, + FlowInfoMsg, + RunSnapshotMsg, +} from "./generated/operator"; +import { Inspector } from "./Inspector"; + +const declaration = JSON.stringify({ + signature: { + name: "Analyze", + inputs: [{ name: "question", type: "str", description: "Question to answer" }], + outputs: [{ name: "answer", type: "str", description: "Final answer" }], + }, +}); + +const workflow: FlowInfoMsg = { + name: "agent_flow", + filePath: "agent_flow.py", + nodeIds: ["agent_1"], + graph: { agent_1: { children: [] } }, + nodeTypes: { agent_1: "step" }, + displayNames: { agent_1: "Agent" }, + cron: "", + nextRunAt: 0, + lastRunAt: 0, + workflowId: "agent_flow.py::agent_flow", + displayName: "agent_flow", + rootAlias: "examples", + relativeFile: "agent_flow.py", + builderSymbol: "agent_flow", + agentNodeIds: ["agent_1"], + agentMetadataJson: { agent_1: declaration }, + webhookPath: "", + webhookUrl: "", + webhookActive: false, +}; + +const run: RunSnapshotMsg = { + operatorInstanceId: "operator-1", + asOfSequence: "9", + summary: { + runId: "run-1", + flowName: "agent_flow", + status: "success", + startedAt: 10, + endedAt: 11, + triggeredBy: "manual", + workflowId: workflow.workflowId, + workflowDisplayName: workflow.displayName, + createdSequence: "2", + revision: "9", + }, + nodes: [ + { + nodeId: "agent_1", + name: "Agent", + nodeType: "step", + status: "success", + startedAt: 10, + endedAt: 11, + trace: { + status: "completed", + revision: "4", + available: true, + complete: true, + eventCount: "1", + sizeBytes: "256", + latestEventSequence: "1", + header: { + status: "completed", + model: "main-model", + subModel: "sub-model", + iterations: "1", + maxIterations: "4", + durationMs: "125", + usageJson: '{"main":{"input_tokens":12}}', + telemetryJson: '{"trace_id":"trace-1"}', + }, + }, + revision: "4", + eventPageToken: "events", + }, + ], + latestLogSequence: "0", + logPageToken: "logs", + topology: { + nodeIds: ["agent_1"], + graph: { agent_1: { children: [] } }, + nodeTypes: { agent_1: "step" }, + displayNames: { agent_1: "Agent" }, + agentMetadataJson: { agent_1: declaration }, + }, +}; + +function api(): OperatorApi { + const events: AgentEventDescriptorMsg[] = [ + { + eventSequence: "1", + sizeBytes: "64", + bodyToken: "input-body", + invocationId: "invocation-1", + eventKind: "run.started", + toolCount: 0, + predictCount: 0, + error: false, + }, + ]; + return { + getCatalog: async (): Promise => { + throw new Error("unused"); + }, + loadBaseline: async () => { + throw new Error("unused"); + }, + streamUpdates: async function* () { + return; + }, + listAgentEvents: async () => events, + listLogs: async () => [], + readDetail: async () => ({ inputs: { question: "Why?" } }), + startRun: async () => "unused", + cancelRun: async () => undefined, + }; +} + +describe("Inspector", () => { + it("renders bounded trace metadata and versioned field associations", async () => { + render( + undefined} + />, + ); + + expect(screen.getByText("main-model")).toBeInTheDocument(); + expect(screen.getByText("12")).toBeInTheDocument(); + expect(screen.getByText("trace-1")).toBeInTheDocument(); + + fireEvent.click(screen.getByRole("button", { name: "inputs" })); + + expect(screen.getByText("Declared fields")).toBeInTheDocument(); + expect(screen.getByText("question")).toBeInTheDocument(); + await waitFor(() => expect(screen.getByText("Why?")).toBeInTheDocument()); + }); +}); diff --git a/web/operator/src/Inspector.tsx b/web/operator/src/Inspector.tsx index d02114b..3e2eb8f 100644 --- a/web/operator/src/Inspector.tsx +++ b/web/operator/src/Inspector.tsx @@ -53,9 +53,10 @@ export function Inspector({ const detailCache = useRef(new Map()); const scrollParent = useRef(null); const node: NodeSnapshotMsg | undefined = run?.nodes.find((item) => item.nodeId === nodeId); - const declaration = workflow - ? parseAgentDeclaration(workflow.agentMetadataJson[nodeId ?? ""]) - : undefined; + const declarationJson = run + ? run.topology?.agentMetadataJson[nodeId ?? ""] + : workflow?.agentMetadataJson[nodeId ?? ""]; + const declaration = declarationJson ? parseAgentDeclaration(declarationJson) : undefined; useEffect(() => { setTab("overview"); @@ -98,6 +99,16 @@ export function Inspector({ (left, right) => Number(left.sequence) - Number(right.sequence), ); }, [liveLogs, logs]); + const traceUsage = useMemo(() => { + const usageJson = node?.trace?.header?.usageJson; + return usageJson ? JSON.parse(usageJson) : undefined; + }, [node?.trace?.header?.usageJson]); + const traceTelemetry = useMemo(() => { + const telemetryJson = node?.trace?.header?.telemetryJson; + return telemetryJson ? JSON.parse(telemetryJson) : undefined; + }, [node?.trace?.header?.telemetryJson]); + const declaredFields = + tab === "inputs" ? declaration?.inputs : tab === "output" ? declaration?.outputs : undefined; const virtualizer = useVirtualizer({ count: turns.length, getScrollElement: () => scrollParent.current, @@ -271,7 +282,31 @@ export function Inspector({
Events
{node.trace.eventCount}
Size
{node.trace.sizeBytes} B
Complete
{node.trace.complete ? "yes" : "no"}
+ {node.trace.header && ( + <> +
Model
{node.trace.header.model}
+
+
Iterations
+
+ {node.trace.header.iterations}/{node.trace.header.maxIterations} +
+
+
Duration
{node.trace.header.durationMs} ms
+ + )} + {traceUsage !== undefined && ( +
+

Usage

+ +
+ )} + {traceTelemetry !== undefined && ( +
+

Telemetry

+ +
+ )} )} @@ -279,6 +314,17 @@ export function Inspector({ {(tab === "inputs" || tab === "output") && (

{tab === "inputs" ? "Invocation inputs" : "Terminal output"}

+ {declaredFields?.length ? ( +
+ Declared fields + {declaredFields.map((field) => ( + + {field.name} + {field.type} + + ))} +
+ ) : null} {selectedPayload && valueKey in selectedPayload ? ( ) : ( diff --git a/web/operator/src/generated/operator.ts b/web/operator/src/generated/operator.ts index 580789f..31048d8 100644 --- a/web/operator/src/generated/operator.ts +++ b/web/operator/src/generated/operator.ts @@ -259,6 +259,12 @@ export interface WorkflowTopologyMsg { displayNames: { [key: string]: string; }; + /** + * @generated from protobuf field: map agent_metadata_json = 5 + */ + agentMetadataJson: { + [key: string]: string; + }; } /** * @generated from protobuf message avalanche.operator.FlowInfoMsg @@ -495,6 +501,43 @@ export interface RunSummaryMsg { */ revision: string; } +/** + * @generated from protobuf message avalanche.operator.TraceHeaderMsg + */ +export interface TraceHeaderMsg { + /** + * @generated from protobuf field: string status = 1 + */ + status: string; + /** + * @generated from protobuf field: string model = 2 + */ + model: string; + /** + * @generated from protobuf field: optional string sub_model = 3 + */ + subModel?: string; + /** + * @generated from protobuf field: uint64 iterations = 4 + */ + iterations: string; + /** + * @generated from protobuf field: uint64 max_iterations = 5 + */ + maxIterations: string; + /** + * @generated from protobuf field: uint64 duration_ms = 6 + */ + durationMs: string; + /** + * @generated from protobuf field: string usage_json = 7 + */ + usageJson: string; + /** + * @generated from protobuf field: optional string telemetry_json = 8 + */ + telemetryJson?: string; +} /** * @generated from protobuf message avalanche.operator.TraceDescriptorMsg */ @@ -527,6 +570,10 @@ export interface TraceDescriptorMsg { * @generated from protobuf field: uint64 latest_event_sequence = 7 */ latestEventSequence: string; + /** + * @generated from protobuf field: avalanche.operator.TraceHeaderMsg header = 8 + */ + header?: TraceHeaderMsg; } /** * @generated from protobuf message avalanche.operator.NodeSnapshotMsg @@ -1841,7 +1888,8 @@ class WorkflowTopologyMsg$Type extends MessageType { { no: 1, name: "node_ids", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "graph", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => NodeEdges } }, { no: 3, name: "node_types", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }, - { no: 4, name: "display_names", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } } + { no: 4, name: "display_names", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }, + { no: 5, name: "agent_metadata_json", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } } ]); } create(value?: PartialMessage): WorkflowTopologyMsg { @@ -1850,6 +1898,7 @@ class WorkflowTopologyMsg$Type extends MessageType { message.graph = {}; message.nodeTypes = {}; message.displayNames = {}; + message.agentMetadataJson = {}; if (value !== undefined) reflectionMergePartial(this, message, value); return message; @@ -1871,6 +1920,9 @@ class WorkflowTopologyMsg$Type extends MessageType { case /* map display_names */ 4: this.binaryReadMap4(message.displayNames, reader, options); break; + case /* map agent_metadata_json */ 5: + this.binaryReadMap5(message.agentMetadataJson, reader, options); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -1930,6 +1982,22 @@ class WorkflowTopologyMsg$Type extends MessageType { } map[key ?? ""] = val ?? ""; } + private binaryReadMap5(map: WorkflowTopologyMsg["agentMetadataJson"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof WorkflowTopologyMsg["agentMetadataJson"] | undefined, val: WorkflowTopologyMsg["agentMetadataJson"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.string(); + break; + default: throw new globalThis.Error("unknown map entry field for avalanche.operator.WorkflowTopologyMsg.agent_metadata_json"); + } + } + map[key ?? ""] = val ?? ""; + } internalBinaryWrite(message: WorkflowTopologyMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* repeated string node_ids = 1; */ for (let i = 0; i < message.nodeIds.length; i++) @@ -1947,6 +2015,9 @@ class WorkflowTopologyMsg$Type extends MessageType { /* map display_names = 4; */ for (let k of globalThis.Object.keys(message.displayNames)) writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.displayNames[k]).join(); + /* map agent_metadata_json = 5; */ + for (let k of globalThis.Object.keys(message.agentMetadataJson)) + writer.tag(5, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.agentMetadataJson[k]).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -2681,6 +2752,107 @@ class RunSummaryMsg$Type extends MessageType { */ export const RunSummaryMsg = new RunSummaryMsg$Type(); // @generated message type with reflection information, may provide speed optimized methods +class TraceHeaderMsg$Type extends MessageType { + constructor() { + super("avalanche.operator.TraceHeaderMsg", [ + { no: 1, name: "status", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "model", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "sub_model", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "iterations", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 5, name: "max_iterations", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 6, name: "duration_ms", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 7, name: "usage_json", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "telemetry_json", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): TraceHeaderMsg { + const message = globalThis.Object.create((this.messagePrototype!)); + message.status = ""; + message.model = ""; + message.iterations = "0"; + message.maxIterations = "0"; + message.durationMs = "0"; + message.usageJson = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TraceHeaderMsg): TraceHeaderMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string status */ 1: + message.status = reader.string(); + break; + case /* string model */ 2: + message.model = reader.string(); + break; + case /* optional string sub_model */ 3: + message.subModel = reader.string(); + break; + case /* uint64 iterations */ 4: + message.iterations = reader.uint64().toString(); + break; + case /* uint64 max_iterations */ 5: + message.maxIterations = reader.uint64().toString(); + break; + case /* uint64 duration_ms */ 6: + message.durationMs = reader.uint64().toString(); + break; + case /* string usage_json */ 7: + message.usageJson = reader.string(); + break; + case /* optional string telemetry_json */ 8: + message.telemetryJson = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TraceHeaderMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string status = 1; */ + if (message.status !== "") + writer.tag(1, WireType.LengthDelimited).string(message.status); + /* string model = 2; */ + if (message.model !== "") + writer.tag(2, WireType.LengthDelimited).string(message.model); + /* optional string sub_model = 3; */ + if (message.subModel !== undefined) + writer.tag(3, WireType.LengthDelimited).string(message.subModel); + /* uint64 iterations = 4; */ + if (message.iterations !== "0") + writer.tag(4, WireType.Varint).uint64(message.iterations); + /* uint64 max_iterations = 5; */ + if (message.maxIterations !== "0") + writer.tag(5, WireType.Varint).uint64(message.maxIterations); + /* uint64 duration_ms = 6; */ + if (message.durationMs !== "0") + writer.tag(6, WireType.Varint).uint64(message.durationMs); + /* string usage_json = 7; */ + if (message.usageJson !== "") + writer.tag(7, WireType.LengthDelimited).string(message.usageJson); + /* optional string telemetry_json = 8; */ + if (message.telemetryJson !== undefined) + writer.tag(8, WireType.LengthDelimited).string(message.telemetryJson); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.TraceHeaderMsg + */ +export const TraceHeaderMsg = new TraceHeaderMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods class TraceDescriptorMsg$Type extends MessageType { constructor() { super("avalanche.operator.TraceDescriptorMsg", [ @@ -2690,7 +2862,8 @@ class TraceDescriptorMsg$Type extends MessageType { { no: 4, name: "complete", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 5, name: "event_count", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, { no: 6, name: "size_bytes", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 7, name: "latest_event_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 7, name: "latest_event_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 8, name: "header", kind: "message", T: () => TraceHeaderMsg } ]); } create(value?: PartialMessage): TraceDescriptorMsg { @@ -2732,6 +2905,9 @@ class TraceDescriptorMsg$Type extends MessageType { case /* uint64 latest_event_sequence */ 7: message.latestEventSequence = reader.uint64().toString(); break; + case /* avalanche.operator.TraceHeaderMsg header */ 8: + message.header = TraceHeaderMsg.internalBinaryRead(reader, reader.uint32(), options, message.header); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -2765,6 +2941,9 @@ class TraceDescriptorMsg$Type extends MessageType { /* uint64 latest_event_sequence = 7; */ if (message.latestEventSequence !== "0") writer.tag(7, WireType.Varint).uint64(message.latestEventSequence); + /* avalanche.operator.TraceHeaderMsg header = 8; */ + if (message.header) + TraceHeaderMsg.internalBinaryWrite(message.header, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); diff --git a/web/operator/src/styles.css b/web/operator/src/styles.css index cb00655..a189e4a 100644 --- a/web/operator/src/styles.css +++ b/web/operator/src/styles.css @@ -148,6 +148,10 @@ h1, h2, h3, p { margin-top: 0; } .field-detail strong, .field-detail code { display: block; font-size: 10px; } .field-detail code { color: #79837f; font-size: 8px; margin-top: 2px; } .field-detail p { color: #78817d; font-size: 9px; margin: 4px 0 0; } +.declared-fields { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; } +.declared-fields > small { width: 100%; color: #69736e; font-size: 8px; text-transform: uppercase; } +.declared-fields > span { display: inline-flex; gap: 5px; padding: 4px 6px; border: 1px solid var(--line); background: #111516; font-size: 9px; } +.declared-fields code { color: #77837d; } .json-block { padding: 11px; background: #101415; border: 1px solid var(--line); border-radius: 4px; overflow: auto; color: #aab5af; font-size: 9px; white-space: pre-wrap; } .metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .metric-grid > div { background: #111516; border: 1px solid var(--line); padding: 10px; } From c5a3049058ea68ebae605b4074b5f459883d2d3f Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:11:54 +0000 Subject: [PATCH 08/25] Cover operator browser behavior --- .../{index-mLerAYW4.js => index-B3SIpuZV.js} | 8 +- src/runtime/operator/web_assets/index.html | 2 +- web/operator/src/Explorer.test.tsx | 72 ++++++++++++ web/operator/src/GraphCanvas.test.tsx | 105 +++++++++++++++++ web/operator/src/GraphCanvas.tsx | 10 +- web/operator/src/Inspector.test.tsx | 109 +++++++++++++++++- web/operator/src/Inspector.tsx | 9 +- web/operator/src/RunControls.test.tsx | 62 ++++++++++ web/operator/src/RunControls.tsx | 11 +- web/operator/src/state.test.ts | 54 ++++++++- web/operator/src/test/setup.ts | 5 + 11 files changed, 429 insertions(+), 18 deletions(-) rename src/runtime/operator/web_assets/assets/{index-mLerAYW4.js => index-B3SIpuZV.js} (77%) create mode 100644 web/operator/src/Explorer.test.tsx create mode 100644 web/operator/src/GraphCanvas.test.tsx create mode 100644 web/operator/src/RunControls.test.tsx diff --git a/src/runtime/operator/web_assets/assets/index-mLerAYW4.js b/src/runtime/operator/web_assets/assets/index-B3SIpuZV.js similarity index 77% rename from src/runtime/operator/web_assets/assets/index-mLerAYW4.js rename to src/runtime/operator/web_assets/assets/index-B3SIpuZV.js index d3b88b3..1ce75a0 100644 --- a/src/runtime/operator/web_assets/assets/index-mLerAYW4.js +++ b/src/runtime/operator/web_assets/assets/index-B3SIpuZV.js @@ -1,9 +1,9 @@ -import{r as jm,a as Dm,b as J,j as p,H as Qd,P as Kd,M as _m,i as Mm,B as Rm,C as wm,c as Um}from"./graph-CoDTrhFP.js";import{S as Bm,M as W,r as F,U,W as S,s as Oe,G as qm}from"./protobuf-BR9ifi4u.js";import{E as Ii,a as Cm,j as Lm,k as Hm}from"./editor-Dh6wG2B-.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const c of f)if(c.type==="childList")for(const v of c.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function i(f){const c={};return f.integrity&&(c.integrity=f.integrity),f.referrerPolicy&&(c.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?c.credentials="include":f.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(f){if(f.ep)return;f.ep=!0;const c=i(f);fetch(f.href,c)}})();var Sc={exports:{}},Da={},Tc={exports:{}},kc={};var Zd;function Vm(){return Zd||(Zd=1,(function(y){function a(_,B){var Q=_.length;_.push(B);t:for(;0>>1,H=_[w];if(0>>1;wf(ot,Q))qtf(xe,ot)?(_[w]=xe,_[qt]=Q,w=qt):(_[w]=ot,_[ct]=Q,w=ct);else if(qtf(xe,Q))_[w]=xe,_[qt]=Q,w=qt;else break t}}return B}function f(_,B){var Q=_.sortIndex-B.sortIndex;return Q!==0?Q:_.id-B.id}if(y.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;y.unstable_now=function(){return c.now()}}else{var v=Date,d=v.now();y.unstable_now=function(){return v.now()-d}}var g=[],m=[],z=1,j=null,R=3,C=!1,V=!1,G=!1,it=!1,K=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,tt=typeof setImmediate<"u"?setImmediate:null;function ht(_){for(var B=i(m);B!==null;){if(B.callback===null)o(m);else if(B.startTime<=_)o(m),B.sortIndex=B.expirationTime,a(g,B);else break;B=i(m)}}function st(_){if(G=!1,ht(_),!V)if(i(g)!==null)V=!0,Bt||(Bt=!0,Ht());else{var B=i(m);B!==null&&he(st,B.startTime-_)}}var Bt=!1,$=-1,jt=5,Dt=-1;function Kt(){return it?!0:!(y.unstable_now()-Dt_&&Kt());){var w=j.callback;if(typeof w=="function"){j.callback=null,R=j.priorityLevel;var H=w(j.expirationTime<=_);if(_=y.unstable_now(),typeof H=="function"){j.callback=H,ht(_),B=!0;break e}j===i(g)&&o(g),ht(_)}else o(g);j=i(g)}if(j!==null)B=!0;else{var bt=i(m);bt!==null&&he(st,bt.startTime-_),B=!1}}break t}finally{j=null,R=Q,C=!1}B=void 0}}finally{B?Ht():Bt=!1}}}var Ht;if(typeof tt=="function")Ht=function(){tt(At)};else if(typeof MessageChannel<"u"){var Jt=new MessageChannel,de=Jt.port2;Jt.port1.onmessage=At,Ht=function(){de.postMessage(null)}}else Ht=function(){K(At,0)};function he(_,B){$=K(function(){_(y.unstable_now())},B)}y.unstable_IdlePriority=5,y.unstable_ImmediatePriority=1,y.unstable_LowPriority=4,y.unstable_NormalPriority=3,y.unstable_Profiling=null,y.unstable_UserBlockingPriority=2,y.unstable_cancelCallback=function(_){_.callback=null},y.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):jt=0<_?Math.floor(1e3/_):5},y.unstable_getCurrentPriorityLevel=function(){return R},y.unstable_next=function(_){switch(R){case 1:case 2:case 3:var B=3;break;default:B=R}var Q=R;R=B;try{return _()}finally{R=Q}},y.unstable_requestPaint=function(){it=!0},y.unstable_runWithPriority=function(_,B){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var Q=R;R=_;try{return B()}finally{R=Q}},y.unstable_scheduleCallback=function(_,B,Q){var w=y.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0w?(_.sortIndex=Q,a(m,_),i(g)===null&&_===i(m)&&(G?(Z($),$=-1):G=!0,he(st,Q-w))):(_.sortIndex=H,a(g,_),V||C||(V=!0,Bt||(Bt=!0,Ht()))),_},y.unstable_shouldYield=Kt,y.unstable_wrapCallback=function(_){var B=R;return function(){var Q=R;R=B;try{return _.apply(this,arguments)}finally{R=Q}}}})(kc)),kc}var Jd;function Ym(){return Jd||(Jd=1,Tc.exports=Vm()),Tc.exports}var $d;function Gm(){if($d)return Da;$d=1;var y=Ym(),a=jm(),i=Dm();function o(t){var e="https://react.dev/errors/"+t;if(1H||(t.current=w[H],w[H]=null,H--)}function ot(t,e){H++,w[H]=t.current,t.current=e}var qt=bt(null),xe=bt(null),Ie=bt(null),Ma=bt(null);function Ra(t,e){switch(ot(Ie,e),ot(xe,t),ot(qt,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?gd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=gd(e),t=md(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ct(qt),ot(qt,t)}function Zn(){ct(qt),ct(xe),ct(Ie)}function eu(t){t.memoizedState!==null&&ot(Ma,t);var e=qt.current,n=md(e,t.type);e!==n&&(ot(xe,t),ot(qt,n))}function wa(t){xe.current===t&&(ct(qt),ct(xe)),Ma.current===t&&(ct(Ma),Aa._currentValue=Q)}var nu,Yc;function An(t){if(nu===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);nu=e&&e[1]||"",Yc=-1{for(const c of f)if(c.type==="childList")for(const v of c.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function i(f){const c={};return f.integrity&&(c.integrity=f.integrity),f.referrerPolicy&&(c.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?c.credentials="include":f.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(f){if(f.ep)return;f.ep=!0;const c=i(f);fetch(f.href,c)}})();var Sc={exports:{}},Da={},Tc={exports:{}},kc={};var Zd;function Vm(){return Zd||(Zd=1,(function(y){function a(M,B){var Q=M.length;M.push(B);t:for(;0>>1,H=M[w];if(0>>1;wf(ot,Q))qtf(xe,ot)?(M[w]=xe,M[qt]=Q,w=qt):(M[w]=ot,M[ct]=Q,w=ct);else if(qtf(xe,Q))M[w]=xe,M[qt]=Q,w=qt;else break t}}return B}function f(M,B){var Q=M.sortIndex-B.sortIndex;return Q!==0?Q:M.id-B.id}if(y.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;y.unstable_now=function(){return c.now()}}else{var v=Date,d=v.now();y.unstable_now=function(){return v.now()-d}}var g=[],m=[],z=1,j=null,R=3,C=!1,Y=!1,G=!1,ut=!1,K=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,tt=typeof setImmediate<"u"?setImmediate:null;function ht(M){for(var B=i(m);B!==null;){if(B.callback===null)o(m);else if(B.startTime<=M)o(m),B.sortIndex=B.expirationTime,a(g,B);else break;B=i(m)}}function lt(M){if(G=!1,ht(M),!Y)if(i(g)!==null)Y=!0,Bt||(Bt=!0,Ht());else{var B=i(m);B!==null&&he(lt,B.startTime-M)}}var Bt=!1,$=-1,jt=5,Dt=-1;function Kt(){return ut?!0:!(y.unstable_now()-DtM&&Kt());){var w=j.callback;if(typeof w=="function"){j.callback=null,R=j.priorityLevel;var H=w(j.expirationTime<=M);if(M=y.unstable_now(),typeof H=="function"){j.callback=H,ht(M),B=!0;break e}j===i(g)&&o(g),ht(M)}else o(g);j=i(g)}if(j!==null)B=!0;else{var bt=i(m);bt!==null&&he(lt,bt.startTime-M),B=!1}}break t}finally{j=null,R=Q,C=!1}B=void 0}}finally{B?Ht():Bt=!1}}}var Ht;if(typeof tt=="function")Ht=function(){tt(At)};else if(typeof MessageChannel<"u"){var Jt=new MessageChannel,de=Jt.port2;Jt.port1.onmessage=At,Ht=function(){de.postMessage(null)}}else Ht=function(){K(At,0)};function he(M,B){$=K(function(){M(y.unstable_now())},B)}y.unstable_IdlePriority=5,y.unstable_ImmediatePriority=1,y.unstable_LowPriority=4,y.unstable_NormalPriority=3,y.unstable_Profiling=null,y.unstable_UserBlockingPriority=2,y.unstable_cancelCallback=function(M){M.callback=null},y.unstable_forceFrameRate=function(M){0>M||125w?(M.sortIndex=Q,a(m,M),i(g)===null&&M===i(m)&&(G?(Z($),$=-1):G=!0,he(lt,Q-w))):(M.sortIndex=H,a(g,M),Y||C||(Y=!0,Bt||(Bt=!0,Ht()))),M},y.unstable_shouldYield=Kt,y.unstable_wrapCallback=function(M){var B=R;return function(){var Q=R;R=B;try{return M.apply(this,arguments)}finally{R=Q}}}})(kc)),kc}var Jd;function Ym(){return Jd||(Jd=1,Tc.exports=Vm()),Tc.exports}var $d;function Gm(){if($d)return Da;$d=1;var y=Ym(),a=jm(),i=Dm();function o(t){var e="https://react.dev/errors/"+t;if(1H||(t.current=w[H],w[H]=null,H--)}function ot(t,e){H++,w[H]=t.current,t.current=e}var qt=bt(null),xe=bt(null),Ie=bt(null),_a=bt(null);function Ra(t,e){switch(ot(Ie,e),ot(xe,t),ot(qt,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?gd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=gd(e),t=md(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ct(qt),ot(qt,t)}function Zn(){ct(qt),ct(xe),ct(Ie)}function eu(t){t.memoizedState!==null&&ot(_a,t);var e=qt.current,n=md(e,t.type);e!==n&&(ot(xe,t),ot(qt,n))}function wa(t){xe.current===t&&(ct(qt),ct(xe)),_a.current===t&&(ct(_a),Aa._currentValue=Q)}var nu,Yc;function An(t){if(nu===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);nu=e&&e[1]||"",Yc=-1)":-1u||b[l]!==N[u]){var x=` `+b[l].replace(" at new "," at ");return t.displayName&&x.includes("")&&(x=x.replace("",t.displayName)),x}while(1<=l&&0<=u);break}}}finally{lu=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?An(n):""}function uh(t,e){switch(t.tag){case 26:case 27:case 5:return An(t.type);case 16:return An("Lazy");case 13:return t.child!==e&&e!==null?An("Suspense Fallback"):An("Suspense");case 19:return An("SuspenseList");case 0:case 15:return au(t.type,!1);case 11:return au(t.type.render,!1);case 1:return au(t.type,!0);case 31:return An("Activity");default:return""}}function Gc(t){try{var e="",n=null;do e+=uh(t,n),n=t,t=t.return;while(t);return e}catch(l){return` Error generating stack: `+l.message+` -`+l.stack}}var iu=Object.prototype.hasOwnProperty,uu=y.unstable_scheduleCallback,su=y.unstable_cancelCallback,sh=y.unstable_shouldYield,ch=y.unstable_requestPaint,ne=y.unstable_now,oh=y.unstable_getCurrentPriorityLevel,Xc=y.unstable_ImmediatePriority,Qc=y.unstable_UserBlockingPriority,Ua=y.unstable_NormalPriority,fh=y.unstable_LowPriority,Kc=y.unstable_IdlePriority,rh=y.log,dh=y.unstable_setDisableYieldValue,Cl=null,le=null;function Pe(t){if(typeof rh=="function"&&dh(t),le&&typeof le.setStrictMode=="function")try{le.setStrictMode(Cl,t)}catch{}}var ae=Math.clz32?Math.clz32:mh,hh=Math.log,gh=Math.LN2;function mh(t){return t>>>=0,t===0?32:31-(hh(t)/gh|0)|0}var Ba=256,qa=262144,Ca=4194304;function On(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function La(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var u=0,s=t.suspendedLanes,r=t.pingedLanes;t=t.warmLanes;var h=l&134217727;return h!==0?(l=h&~s,l!==0?u=On(l):(r&=h,r!==0?u=On(r):n||(n=h&~t,n!==0&&(u=On(n))))):(h=l&~s,h!==0?u=On(h):r!==0?u=On(r):n||(n=l&~t,n!==0&&(u=On(n)))),u===0?0:e!==0&&e!==u&&(e&s)===0&&(s=u&-u,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:u}function Ll(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function yh(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zc(){var t=Ca;return Ca<<=1,(Ca&62914560)===0&&(Ca=4194304),t}function cu(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Hl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ph(t,e,n,l,u,s){var r=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,b=t.expirationTimes,N=t.hiddenUpdates;for(n=r&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var zh=/[\n"\\]/g;function me(t){return t.replace(zh,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function gu(t,e,n,l,u,s,r,h){t.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.type=r:t.removeAttribute("type"),e!=null?r==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ge(e)):t.value!==""+ge(e)&&(t.value=""+ge(e)):r!=="submit"&&r!=="reset"||t.removeAttribute("value"),e!=null?mu(t,r,ge(e)):n!=null?mu(t,r,ge(n)):l!=null&&t.removeAttribute("value"),u==null&&s!=null&&(t.defaultChecked=!!s),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+ge(h):t.removeAttribute("name")}function uo(t,e,n,l,u,s,r,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){hu(t);return}n=n!=null?""+ge(n):"",e=e!=null?""+ge(e):n,h||e===t.value||(t.value=e),t.defaultValue=e}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=h?t.checked:!!l,t.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.name=r),hu(t)}function mu(t,e,n){e==="number"&&Ya(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Pn(t,e,n,l){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=!1;if(Ue)try{var Xl={};Object.defineProperty(Xl,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{Su=!1}var en=null,Tu=null,Xa=null;function go(){if(Xa)return Xa;var t,e=Tu,n=e.length,l,u="value"in en?en.value:en.textContent,s=u.length;for(t=0;t=Zl),So=" ",To=!1;function ko(t,e){switch(t){case"keyup":return Fh.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ll=!1;function Ph(t,e){switch(t){case"compositionend":return zo(e);case"keypress":return e.which!==32?null:(To=!0,So);case"textInput":return t=e.data,t===So&&To?null:t;default:return null}}function tg(t,e){if(ll)return t==="compositionend"||!Au&&ko(t,e)?(t=go(),Xa=Tu=en=null,ll=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=_o(n)}}function Ro(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ro(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function wo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ya(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ya(t.document)}return e}function ju(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var cg=Ue&&"documentMode"in document&&11>=document.documentMode,al=null,Du=null,Fl=null,_u=!1;function Uo(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_u||al==null||al!==Ya(l)||(l=al,"selectionStart"in l&&ju(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Fl&&Wl(Fl,l)||(Fl=l,l=qi(Du,"onSelect"),0>=r,u-=r,je=1<<32-ae(e)+u|n<P?(at=L,L=null):at=L.sibling;var rt=A(k,L,E[P],D);if(rt===null){L===null&&(L=at);break}t&&L&&rt.alternate===null&&e(k,L),T=s(rt,T,P),ft===null?Y=rt:ft.sibling=rt,ft=rt,L=at}if(P===E.length)return n(k,L),ut&&qe(k,P),Y;if(L===null){for(;PP?(at=L,L=null):at=L.sibling;var En=A(k,L,rt.value,D);if(En===null){L===null&&(L=at);break}t&&L&&En.alternate===null&&e(k,L),T=s(En,T,P),ft===null?Y=En:ft.sibling=En,ft=En,L=at}if(rt.done)return n(k,L),ut&&qe(k,P),Y;if(L===null){for(;!rt.done;P++,rt=E.next())rt=M(k,rt.value,D),rt!==null&&(T=s(rt,T,P),ft===null?Y=rt:ft.sibling=rt,ft=rt);return ut&&qe(k,P),Y}for(L=l(L);!rt.done;P++,rt=E.next())rt=O(L,k,P,rt.value,D),rt!==null&&(t&&rt.alternate!==null&&L.delete(rt.key===null?P:rt.key),T=s(rt,T,P),ft===null?Y=rt:ft.sibling=rt,ft=rt);return t&&L.forEach(function(xm){return e(k,xm)}),ut&&qe(k,P),Y}function vt(k,T,E,D){if(typeof E=="object"&&E!==null&&E.type===G&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case C:t:{for(var Y=E.key;T!==null;){if(T.key===Y){if(Y=E.type,Y===G){if(T.tag===7){n(k,T.sibling),D=u(T,E.props.children),D.return=k,k=D;break t}}else if(T.elementType===Y||typeof Y=="object"&&Y!==null&&Y.$$typeof===jt&&Cn(Y)===T.type){n(k,T.sibling),D=u(T,E.props),la(D,E),D.return=k,k=D;break t}n(k,T);break}else e(k,T);T=T.sibling}E.type===G?(D=Rn(E.props.children,k.mode,D,E.key),D.return=k,k=D):(D=ti(E.type,E.key,E.props,null,k.mode,D),la(D,E),D.return=k,k=D)}return r(k);case V:t:{for(Y=E.key;T!==null;){if(T.key===Y)if(T.tag===4&&T.stateNode.containerInfo===E.containerInfo&&T.stateNode.implementation===E.implementation){n(k,T.sibling),D=u(T,E.children||[]),D.return=k,k=D;break t}else{n(k,T);break}else e(k,T);T=T.sibling}D=Cu(E,k.mode,D),D.return=k,k=D}return r(k);case jt:return E=Cn(E),vt(k,T,E,D)}if(he(E))return q(k,T,E,D);if(Ht(E)){if(Y=Ht(E),typeof Y!="function")throw Error(o(150));return E=Y.call(E),X(k,T,E,D)}if(typeof E.then=="function")return vt(k,T,si(E),D);if(E.$$typeof===tt)return vt(k,T,li(k,E),D);ci(k,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,T!==null&&T.tag===6?(n(k,T.sibling),D=u(T,E),D.return=k,k=D):(n(k,T),D=qu(E,k.mode,D),D.return=k,k=D),r(k)):n(k,T)}return function(k,T,E,D){try{na=0;var Y=vt(k,T,E,D);return ml=null,Y}catch(L){if(L===gl||L===ii)throw L;var ft=ue(29,L,null,k.mode);return ft.lanes=D,ft.return=k,ft}}}var Hn=af(!0),uf=af(!1),sn=!1;function Wu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fu(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function on(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(dt&2)!==0){var u=l.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),l.pending=e,e=Pa(t),Yo(t,null,n),e}return Ia(t,l,e,n),Pa(t)}function aa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,$c(t,n)}}function Iu(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var u=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?u=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?u=s=e:s=s.next=e}else u=s=e;n={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Pu=!1;function ia(){if(Pu){var t=hl;if(t!==null)throw t}}function ua(t,e,n,l){Pu=!1;var u=t.updateQueue;sn=!1;var s=u.firstBaseUpdate,r=u.lastBaseUpdate,h=u.shared.pending;if(h!==null){u.shared.pending=null;var b=h,N=b.next;b.next=null,r===null?s=N:r.next=N,r=b;var x=t.alternate;x!==null&&(x=x.updateQueue,h=x.lastBaseUpdate,h!==r&&(h===null?x.firstBaseUpdate=N:h.next=N,x.lastBaseUpdate=b))}if(s!==null){var M=u.baseState;r=0,x=N=b=null,h=s;do{var A=h.lane&-536870913,O=A!==h.lane;if(O?(lt&A)===A:(l&A)===A){A!==0&&A===dl&&(Pu=!0),x!==null&&(x=x.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var q=t,X=h;A=e;var vt=n;switch(X.tag){case 1:if(q=X.payload,typeof q=="function"){M=q.call(vt,M,A);break t}M=q;break t;case 3:q.flags=q.flags&-65537|128;case 0:if(q=X.payload,A=typeof q=="function"?q.call(vt,M,A):q,A==null)break t;M=j({},M,A);break t;case 2:sn=!0}}A=h.callback,A!==null&&(t.flags|=64,O&&(t.flags|=8192),O=u.callbacks,O===null?u.callbacks=[A]:O.push(A))}else O={lane:A,tag:h.tag,payload:h.payload,callback:h.callback,next:null},x===null?(N=x=O,b=M):x=x.next=O,r|=A;if(h=h.next,h===null){if(h=u.shared.pending,h===null)break;O=h,h=O.next,O.next=null,u.lastBaseUpdate=O,u.shared.pending=null}}while(!0);x===null&&(b=M),u.baseState=b,u.firstBaseUpdate=N,u.lastBaseUpdate=x,s===null&&(u.shared.lanes=0),gn|=r,t.lanes=r,t.memoizedState=M}}function sf(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function cf(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ts?s:8;var r=_.T,h={};_.T=h,vs(t,!1,e,n);try{var b=u(),N=_.S;if(N!==null&&N(h,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var x=pg(b,l);oa(t,e,x,re(t))}else oa(t,e,l,re(t))}catch(M){oa(t,e,{then:function(){},status:"rejected",reason:M},re())}finally{B.p=s,r!==null&&h.types!==null&&(r.types=h.types),_.T=r}}function zg(){}function ys(t,e,n,l){if(t.tag!==5)throw Error(o(476));var u=Hf(t).queue;Lf(t,u,e,Q,n===null?zg:function(){return Vf(t),n(l)})}function Hf(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:Q},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Vf(t){var e=Hf(t);e.next===null&&(e=t.alternate.memoizedState),oa(t,e.next.queue,{},re())}function ps(){return Gt(Aa)}function Yf(){return xt().memoizedState}function Gf(){return xt().memoizedState}function Eg(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=re();t=cn(n);var l=on(e,t,n);l!==null&&(ee(l,e,n),aa(l,e,n)),e={cache:Ku()},t.payload=e;return}e=e.return}}function Ng(t,e,n){var l=re();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},vi(t)?Qf(e,n):(n=Uu(t,e,n,l),n!==null&&(ee(n,t,l),Kf(n,e,l)))}function Xf(t,e,n){var l=re();oa(t,e,n,l)}function oa(t,e,n,l){var u={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(vi(t))Qf(e,u);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var r=e.lastRenderedState,h=s(r,n);if(u.hasEagerState=!0,u.eagerState=h,ie(h,r))return Ia(t,e,u,0),St===null&&Fa(),!1}catch{}if(n=Uu(t,e,u,l),n!==null)return ee(n,t,l),Kf(n,e,l),!0}return!1}function vs(t,e,n,l){if(l={lane:2,revertLane:Ws(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},vi(t)){if(e)throw Error(o(479))}else e=Uu(t,n,l,2),e!==null&&ee(e,t,2)}function vi(t){var e=t.alternate;return t===I||e!==null&&e===I}function Qf(t,e){pl=ri=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Kf(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,$c(t,n)}}var fa={readContext:Gt,use:gi,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};fa.useEffectEvent=Et;var Zf={readContext:Gt,use:gi,useCallback:function(t,e){return Zt().memoizedState=[t,e===void 0?null:e],t},useContext:Gt,useEffect:Df,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,yi(4194308,4,wf.bind(null,e,t),n)},useLayoutEffect:function(t,e){return yi(4194308,4,t,e)},useInsertionEffect:function(t,e){yi(4,2,t,e)},useMemo:function(t,e){var n=Zt();e=e===void 0?null:e;var l=t();if(Vn){Pe(!0);try{t()}finally{Pe(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=Zt();if(n!==void 0){var u=n(e);if(Vn){Pe(!0);try{n(e)}finally{Pe(!1)}}}else u=e;return l.memoizedState=l.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},l.queue=t,t=t.dispatch=Ng.bind(null,I,t),[l.memoizedState,t]},useRef:function(t){var e=Zt();return t={current:t},e.memoizedState=t},useState:function(t){t=rs(t);var e=t.queue,n=Xf.bind(null,I,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(t,e){var n=Zt();return ms(n,t,e)},useTransition:function(){var t=rs(!1);return t=Lf.bind(null,I,t.queue,!0,!1),Zt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=I,u=Zt();if(ut){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),St===null)throw Error(o(349));(lt&127)!==0||gf(l,e,n)}u.memoizedState=n;var s={value:n,getSnapshot:e};return u.queue=s,Df(yf.bind(null,l,s,t),[t]),l.flags|=2048,bl(9,{destroy:void 0},mf.bind(null,l,s,n,e),null),n},useId:function(){var t=Zt(),e=St.identifierPrefix;if(ut){var n=De,l=je;n=(l&~(1<<32-ae(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=di++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(u,{is:l.is}):r.createElement(u)}}s[Vt]=e,s[$t]=l;t:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break t;for(;r.sibling===null;){if(r.return===null||r.return===e)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=s;t:switch(Qt(s,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&Ge(e)}}return kt(e),Ms(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Ge(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(o(166));if(t=Ie.current,fl(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,u=Yt,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}t[Vt]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||dd(t.nodeValue,n)),t||an(e,!0)}else t=Ci(t).createTextNode(l),t[Vt]=e,e.stateNode=t}return kt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=fl(e),n!==null){if(t===null){if(!l)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Vt]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),t=!1}else n=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(ce(e),e):(ce(e),null);if((e.flags&128)!==0)throw Error(o(558))}return kt(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=fl(e),l!==null&&l.dehydrated!==null){if(t===null){if(!u)throw Error(o(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Vt]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),u=!1}else u=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(ce(e),e):(ce(e),null)}return ce(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),zi(e,e.updateQueue),kt(e),null);case 4:return Zn(),t===null&&tc(e.stateNode.containerInfo),kt(e),null;case 10:return Le(e.type),kt(e),null;case 19:if(ct(Ot),l=e.memoizedState,l===null)return kt(e),null;if(u=(e.flags&128)!==0,s=l.rendering,s===null)if(u)da(l,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=fi(t),s!==null){for(e.flags|=128,da(l,!1),t=s.updateQueue,e.updateQueue=t,zi(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Go(n,t),n=n.sibling;return ot(Ot,Ot.current&1|2),ut&&qe(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&ne()>xi&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304)}else{if(!u)if(t=fi(s),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,zi(e,t),da(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!ut)return kt(e),null}else 2*ne()-l.renderingStartTime>xi&&n!==536870912&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304);l.isBackwards?(s.sibling=e.child,e.child=s):(t=l.last,t!==null?t.sibling=s:e.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ne(),t.sibling=null,n=Ot.current,ot(Ot,u?n&1|2:n&1),ut&&qe(e,l.treeForkCount),t):(kt(e),null);case 22:case 23:return ce(e),es(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(kt(e),e.subtreeFlags&6&&(e.flags|=8192)):kt(e),n=e.updateQueue,n!==null&&zi(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&ct(qn),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Le(_t),kt(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function Dg(t,e){switch(Hu(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Le(_t),Zn(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return wa(e),null;case 31:if(e.memoizedState!==null){if(ce(e),e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ce(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(Ot),null;case 4:return Zn(),null;case 10:return Le(e.type),null;case 22:case 23:return ce(e),es(),t!==null&&ct(qn),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Le(_t),null;case 25:return null;default:return null}}function pr(t,e){switch(Hu(e),e.tag){case 3:Le(_t),Zn();break;case 26:case 27:case 5:wa(e);break;case 4:Zn();break;case 31:e.memoizedState!==null&&ce(e);break;case 13:ce(e);break;case 19:ct(Ot);break;case 10:Le(e.type);break;case 22:case 23:ce(e),es(),t!==null&&ct(qn);break;case 24:Le(_t)}}function ha(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var u=l.next;n=u;do{if((n.tag&t)===t){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==u)}}catch(h){mt(e,e.return,h)}}function dn(t,e,n){try{var l=e.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var s=u.next;l=s;do{if((l.tag&t)===t){var r=l.inst,h=r.destroy;if(h!==void 0){r.destroy=void 0,u=e;var b=n,N=h;try{N()}catch(x){mt(u,b,x)}}}l=l.next}while(l!==s)}}catch(x){mt(e,e.return,x)}}function vr(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{cf(e,n)}catch(l){mt(t,t.return,l)}}}function br(t,e,n){n.props=Yn(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){mt(t,e,l)}}function ga(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(u){mt(t,e,u)}}function _e(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(u){mt(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){mt(t,e,u)}else n.current=null}function Sr(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(u){mt(t,t.return,u)}}function Rs(t,e,n){try{var l=t.stateNode;Ig(l,t.type,n,e),l[$t]=e}catch(u){mt(t,t.return,u)}}function Tr(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bn(t.type)||t.tag===4}function ws(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Tr(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Us(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=we));else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Us(t,e,n),t=t.sibling;t!==null;)Us(t,e,n),t=t.sibling}function Ei(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ei(t,e,n),t=t.sibling;t!==null;)Ei(t,e,n),t=t.sibling}function kr(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);Qt(e,l,n),e[Vt]=t,e[$t]=n}catch(s){mt(t,t.return,s)}}var Xe=!1,wt=!1,Bs=!1,zr=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function _g(t,e){if(t=t.containerInfo,lc=Qi,t=wo(t),ju(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var u=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var r=0,h=-1,b=-1,N=0,x=0,M=t,A=null;e:for(;;){for(var O;M!==n||u!==0&&M.nodeType!==3||(h=r+u),M!==s||l!==0&&M.nodeType!==3||(b=r+l),M.nodeType===3&&(r+=M.nodeValue.length),(O=M.firstChild)!==null;)A=M,M=O;for(;;){if(M===t)break e;if(A===n&&++N===u&&(h=r),A===s&&++x===l&&(b=r),(O=M.nextSibling)!==null)break;M=A,A=M.parentNode}M=O}n=h===-1||b===-1?null:{start:h,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(ac={focusedElem:t,selectionRange:n},Qi=!1,Lt=e;Lt!==null;)if(e=Lt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Lt=t;else for(;Lt!==null;){switch(e=Lt,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),Qt(s,l,n),s[Vt]=t,Ct(s),l=s;break t;case"link":var r=jd("link","href",u).get(l+(n.href||""));if(r){for(var h=0;hvt&&(r=vt,vt=X,X=r);var k=Mo(h,X),T=Mo(h,vt);if(k&&T&&(O.rangeCount!==1||O.anchorNode!==k.node||O.anchorOffset!==k.offset||O.focusNode!==T.node||O.focusOffset!==T.offset)){var E=M.createRange();E.setStart(k.node,k.offset),O.removeAllRanges(),X>vt?(O.addRange(E),O.extend(T.node,T.offset)):(E.setEnd(T.node,T.offset),O.addRange(E))}}}}for(M=[],O=h;O=O.parentNode;)O.nodeType===1&&M.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;hn?32:n,_.T=null,n=Gs,Gs=null;var s=yn,r=$e;if(Ut=0,El=yn=null,$e=0,(dt&6)!==0)throw Error(o(331));var h=dt;if(dt|=4,wr(s.current),_r(s,s.current,r,n),dt=h,Sa(0,!1),le&&typeof le.onPostCommitFiberRoot=="function")try{le.onPostCommitFiberRoot(Cl,s)}catch{}return!0}finally{B.p=u,_.T=l,Ir(t,e)}}function td(t,e,n){e=pe(n,e),e=ks(t.stateNode,e,2),t=on(t,e,2),t!==null&&(Hl(t,2),Me(t))}function mt(t,e,n){if(t.tag===3)td(t,t,n);else for(;e!==null;){if(e.tag===3){td(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(mn===null||!mn.has(l))){t=pe(n,t),n=er(2),l=on(e,n,2),l!==null&&(nr(n,l,e,t),Hl(l,2),Me(l));break}}e=e.return}}function Zs(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new wg;var u=new Set;l.set(e,u)}else u=l.get(e),u===void 0&&(u=new Set,l.set(e,u));u.has(n)||(Ls=!0,u.add(n),t=Lg.bind(null,t,e,n),e.then(t,t))}function Lg(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,St===t&&(lt&n)===n&&(Nt===4||Nt===3&&(lt&62914560)===lt&&300>ne()-Oi?(dt&2)===0&&Nl(t,0):Hs|=n,zl===lt&&(zl=0)),Me(t)}function ed(t,e){e===0&&(e=Zc()),t=Mn(t,e),t!==null&&(Hl(t,e),Me(t))}function Hg(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),ed(t,n)}function Vg(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(e),ed(t,n)}function Yg(t,e){return uu(t,e)}var wi=null,Ol=null,Js=!1,Ui=!1,$s=!1,vn=0;function Me(t){t!==Ol&&t.next===null&&(Ol===null?wi=Ol=t:Ol=Ol.next=t),Ui=!0,Js||(Js=!0,Xg())}function Sa(t,e){if(!$s&&Ui){$s=!0;do for(var n=!1,l=wi;l!==null;){if(t!==0){var u=l.pendingLanes;if(u===0)var s=0;else{var r=l.suspendedLanes,h=l.pingedLanes;s=(1<<31-ae(42|t)+1)-1,s&=u&~(r&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,id(l,s))}else s=lt,s=La(l,l===St?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Ll(l,s)||(n=!0,id(l,s));l=l.next}while(n);$s=!1}}function Gg(){nd()}function nd(){Ui=Js=!1;var t=0;vn!==0&&tm()&&(t=vn);for(var e=ne(),n=null,l=wi;l!==null;){var u=l.next,s=ld(l,e);s===0?(l.next=null,n===null?wi=u:n.next=u,u===null&&(Ol=n)):(n=l,(t!==0||(s&3)!==0)&&(Ui=!0)),l=u}Ut!==0&&Ut!==5||Sa(t),vn!==0&&(vn=0)}function ld(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,u=t.expirationTimes,s=t.pendingLanes&-62914561;0h)break;var x=b.transferSize,M=b.initiatorType;x&&hd(M)&&(b=b.responseEnd,r+=x*(b"u"?null:document;function Nd(t,e,n){var l=xl;if(l&&typeof e=="string"&&e){var u=me(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Ed.has(u)||(Ed.add(u),t={rel:t,crossOrigin:n,href:e},l.querySelector(u)===null&&(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function om(t){We.D(t),Nd("dns-prefetch",t,null)}function fm(t,e){We.C(t,e),Nd("preconnect",t,e)}function rm(t,e,n){We.L(t,e,n);var l=xl;if(l&&t&&e){var u='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+me(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+me(n.imageSizes)+'"]')):u+='[href="'+me(t)+'"]';var s=u;switch(e){case"style":s=jl(t);break;case"script":s=Dl(t)}ze.has(s)||(t=j({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),ze.set(s,t),l.querySelector(u)!==null||e==="style"&&l.querySelector(Ea(s))||e==="script"&&l.querySelector(Na(s))||(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function dm(t,e){We.m(t,e);var n=xl;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+me(l)+'"][href="'+me(t)+'"]',s=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Dl(t)}if(!ze.has(s)&&(t=j({rel:"modulepreload",href:t},e),ze.set(s,t),n.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Na(s)))return}l=n.createElement("link"),Qt(l,"link",t),Ct(l),n.head.appendChild(l)}}}function hm(t,e,n){We.S(t,e,n);var l=xl;if(l&&t){var u=Fn(l).hoistableStyles,s=jl(t);e=e||"default";var r=u.get(s);if(!r){var h={loading:0,preload:null};if(r=l.querySelector(Ea(s)))h.loading=5;else{t=j({rel:"stylesheet",href:t,"data-precedence":e},n),(n=ze.get(s))&&rc(t,n);var b=r=l.createElement("link");Ct(b),Qt(b,"link",t),b._p=new Promise(function(N,x){b.onload=N,b.onerror=x}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Hi(r,e,l)}r={type:"stylesheet",instance:r,count:1,state:h},u.set(s,r)}}}function gm(t,e){We.X(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function mm(t,e){We.M(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0,type:"module"},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function Ad(t,e,n,l){var u=(u=Ie.current)?Li(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=jl(n.href),n=Fn(u).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=jl(n.href);var s=Fn(u).hoistableStyles,r=s.get(t);if(r||(u=u.ownerDocument||u,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,r),(s=u.querySelector(Ea(t)))&&!s._p&&(r.instance=s,r.state.loading=5),ze.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ze.set(t,n),s||ym(u,t,n,r.state))),e&&l===null)throw Error(o(528,""));return r}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Dl(n),n=Fn(u).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function jl(t){return'href="'+me(t)+'"'}function Ea(t){return'link[rel="stylesheet"]['+t+"]"}function Od(t){return j({},t,{"data-precedence":t.precedence,precedence:null})}function ym(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),Qt(e,"link",n),Ct(e),t.head.appendChild(e))}function Dl(t){return'[src="'+me(t)+'"]'}function Na(t){return"script[async]"+t}function xd(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+me(n.href)+'"]');if(l)return e.instance=l,Ct(l),l;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ct(l),Qt(l,"style",u),Hi(l,n.precedence,t),e.instance=l;case"stylesheet":u=jl(n.href);var s=t.querySelector(Ea(u));if(s)return e.state.loading|=4,e.instance=s,Ct(s),s;l=Od(n),(u=ze.get(u))&&rc(l,u),s=(t.ownerDocument||t).createElement("link"),Ct(s);var r=s;return r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),e.state.loading|=4,Hi(s,n.precedence,t),e.instance=s;case"script":return s=Dl(n.src),(u=t.querySelector(Na(s)))?(e.instance=u,Ct(u),u):(l=n,(u=ze.get(s))&&(l=j({},n),dc(l,u)),t=t.ownerDocument||t,u=t.createElement("script"),Ct(u),Qt(u,"link",l),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,Hi(l,n.precedence,t));return e.instance}function Hi(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,s=u,r=0;r title"):null)}function pm(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function _d(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function vm(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=jl(l.href),s=e.querySelector(Ea(u));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Yi.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,Ct(s);return}s=e.ownerDocument||e,l=Od(l),(u=ze.get(u))&&rc(l,u),s=s.createElement("link"),Ct(s);var r=s;r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Yi.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var hc=0;function bm(t,e){return t.stylesheets&&t.count===0&&Xi(t,t.stylesheets),0hc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Yi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xi(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Gi=null;function Xi(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gi=new Map,e.forEach(Sm,t),Gi=null,Yi.call(t))}function Sm(t,e){if(!(e.state.loading&4)){var n=Gi.get(t);if(n)var l=n.get(null);else{n=new Map,Gi.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y)}catch(a){console.error(a)}}return y(),Sc.exports=Gm(),Sc.exports}var Qm=Xm();class Km extends W{constructor(){super("avalanche.operator.Empty",[])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poszc},{no:6,name:"run_id",kind:"scalar",T:9},{no:7,name:"workflow_selector",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.flowName="",i.inputJson="",i.contextJson="",i.inputFiles=[],i.runId="",i.workflowSelector="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:3,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.agentMetadataJson={},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:5,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"cron",kind:"scalar",T:9},{no:8,name:"next_run_at",kind:"scalar",T:1},{no:9,name:"last_run_at",kind:"scalar",T:1},{no:10,name:"workflow_id",kind:"scalar",T:9},{no:11,name:"display_name",kind:"scalar",T:9},{no:12,name:"root_alias",kind:"scalar",T:9},{no:13,name:"relative_file",kind:"scalar",T:9},{no:14,name:"builder_symbol",kind:"scalar",T:9},{no:15,name:"agent_node_ids",kind:"scalar",repeat:2,T:9},{no:16,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:17,name:"webhook_path",kind:"scalar",T:9},{no:18,name:"webhook_url",kind:"scalar",T:9},{no:19,name:"webhook_active",kind:"scalar",T:8}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.name="",i.filePath="",i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.cron="",i.nextRunAt=0,i.lastRunAt=0,i.workflowId="",i.displayName="",i.rootAlias="",i.relativeFile="",i.builderSymbol="",i.agentNodeIds=[],i.agentMetadataJson={},i.webhookPath="",i.webhookUrl="",i.webhookActive=!1,a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posEc},{no:5,name:"scan_targets",kind:"message",repeat:2,T:()=>Ac},{no:6,name:"diagnostics",kind:"message",repeat:2,T:()=>Nc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.revision="0",i.workflows=[],i.scanTargets=[],i.diagnostics=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posOc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.valueJson="",i.files=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posxc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.status="",i.revision="0",i.available=!1,i.complete=!1,i.eventCount="0",i.sizeBytes="0",i.latestEventSequence="0",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl},{no:8,name:"revision",kind:"scalar",T:4},{no:9,name:"event_page_token",kind:"scalar",T:9},{no:10,name:"error",kind:"scalar",opt:!0,T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeId="",i.name="",i.nodeType="",i.status="",i.startedAt=0,i.endedAt=0,i.revision="0",i.eventPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:5,name:"latest_log_sequence",kind:"scalar",T:4},{no:6,name:"log_page_token",kind:"scalar",T:9},{no:7,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.nodes=[],i.latestLogSequence="0",i.logPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.logs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql},{no:6,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runId="",i.nodeId="",i.events=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:2,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:3,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodes=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posPi}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posjc},{no:3,name:"run_status_changed",kind:"message",oneof:"change",T:()=>Dc},{no:4,name:"node_status_changed",kind:"message",oneof:"change",T:()=>_c},{no:5,name:"log_appended",kind:"message",oneof:"change",T:()=>Mc},{no:6,name:"agent_event_appended",kind:"message",oneof:"change",T:()=>Rc},{no:7,name:"trace_finalized",kind:"message",oneof:"change",T:()=>wc},{no:8,name:"catalog_replaced",kind:"message",oneof:"change",T:()=>Uc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.sequence="0",i.change={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBc},{no:3,name:"reset_required",kind:"message",oneof:"payload",T:()=>qc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.payload={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posawait this.client.getRunSnapshot({runId:g.runId,operatorInstanceId:f,asOfSequence:c}).response)),d=await this.getCatalog();if(a.operatorInstanceId!==f||d.operatorInstanceId!==f||a.revision!==d.revision||BigInt(a.asOfSequence)>BigInt(c)||BigInt(d.asOfSequence)d.nodeId===i);if(!o?.eventPageToken)return[];const f=[];let c=o.eventPageToken,v="0";do{const d=await this.client.listAgentEvents({pageToken:c,afterEventSequence:v,pageSize:100}).response;f.push(...d.events),d.events.length&&(v=d.events.at(-1).eventSequence),c=d.nextPageToken}while(c);return f}async listLogs(a){if(!a.logPageToken)return[];const i=[];let o=a.logPageToken,f="0";do{const c=await this.client.listLogs({pageToken:o,afterSequence:f,pageSize:100}).response;i.push(...c.logs),c.logs.length&&(f=c.logs.at(-1).sequence),o=c.nextPageToken}while(o);return i}async readDetail(a){const i=[];for await(const v of this.client.readDetail({bodyToken:a}).responses)i.push(v.data);const o=i.reduce((v,d)=>v+d.length,0),f=new Uint8Array(o);let c=0;for(const v of i)f.set(v,c),c+=v.length;return JSON.parse(new TextDecoder().decode(f))}async startRun(a,i){return(await this.client.startRun({flowName:"",workflowSelector:a,runId:"",inputJson:i===void 0?"":JSON.stringify(i),contextJson:"",inputFiles:[]}).response).runId}async cancelRun(a){await this.client.cancelRun({runId:a}).response}}function np(y){return y==="success"?"✓":y==="failed"?"!":y==="running"?"●":"·"}function lp({workflow:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState(!0);return p.jsxs("div",{className:"workflow-branch",children:[p.jsxs("div",{className:"tree-row",children:[p.jsx("button",{type:"button",className:"tree-disclosure",onClick:()=>c(v=>!v),"aria-label":`${f?"Collapse":"Expand"} ${y.displayName}`,children:f?"⌄":"›"}),p.jsxs("button",{type:"button",className:i?.kind==="workflow"&&i.workflowId===y.workflowId?"tree-select active":"tree-select",onClick:()=>o({kind:"workflow",workflowId:y.workflowId}),children:[p.jsx("span",{className:"workflow-glyph",children:"◇"}),p.jsxs("span",{children:[p.jsx("strong",{children:y.displayName}),p.jsx("small",{children:y.relativeFile})]})]})]}),f&&p.jsxs("div",{className:"run-branches",children:[a.map(v=>{const d=v.summary;return p.jsxs("button",{type:"button",className:i?.kind==="run"&&i.runId===d.runId?"run-select active":"run-select",onClick:()=>o({kind:"run",workflowId:y.workflowId,runId:d.runId}),children:[p.jsx("span",{className:`run-dot status-${d.status}`,children:np(d.status)}),p.jsxs("span",{children:[p.jsx("strong",{children:d.runId}),p.jsx("small",{children:d.startedAt?`Created at sequence ${d.createdSequence}`:"Awaiting start"})]})]},d.runId)}),!a.length&&p.jsx("span",{className:"no-runs",children:"No runs yet"})]})]})}function ap(y,a){return y.workflows.filter(i=>i.rootAlias===a.alias)}function ip({catalog:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState({});if(!y)return p.jsxs("aside",{className:"explorer skeleton","aria-label":"Explorer",children:[p.jsx("div",{}),p.jsx("div",{}),p.jsx("div",{})]});const v=y.scanTargets.length?y.scanTargets:[{alias:"workflows",targetPath:"Configured workflows",kind:"directory"}];return p.jsxs("aside",{className:"explorer","aria-label":"Explorer",children:[p.jsxs("header",{children:[p.jsx("span",{className:"eyebrow",children:"Navigator"}),p.jsx("h2",{children:"Explorer"}),p.jsxs("span",{className:"catalog-revision",children:["catalog r",y.revision]})]}),y.diagnostics.length>0&&p.jsxs("details",{className:"diagnostics",open:!0,children:[p.jsxs("summary",{children:[y.diagnostics.length," reload issue",y.diagnostics.length===1?"":"s"]}),y.diagnostics.map(d=>p.jsxs("div",{children:[p.jsx("strong",{children:d.kind.replaceAll("_"," ")}),p.jsx("span",{children:d.path}),p.jsx("p",{children:d.message})]},`${d.path}-${d.kind}`))]}),p.jsx("div",{className:"target-list",children:v.map(d=>{const g=d.alias==="workflows"?y.workflows:ap(y,d),m=!!f[d.alias];return p.jsxs("section",{className:"target",children:[p.jsxs("button",{type:"button",className:"target-heading",onClick:()=>c(z=>{const j={...z};return j[d.alias]?delete j[d.alias]:j[d.alias]=!0,j}),children:[p.jsx("span",{children:m?"›":"⌄"}),p.jsx("span",{className:"target-kind",children:d.kind==="file"?"F":"D"}),p.jsxs("span",{children:[p.jsx("strong",{children:d.alias}),p.jsx("small",{title:d.targetPath,children:d.targetPath})]})]}),!m&&p.jsx("div",{className:"workflow-list",children:g.map(z=>p.jsx(lp,{workflow:z,runs:Object.values(a).filter(j=>j.summary?.workflowId===z.workflowId).sort((j,R)=>Number(R.summary.createdSequence)-Number(j.summary.createdSequence)),selection:i,onSelect:o},z.workflowId))})]},d.alias)})})]})}function Kn(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function Id(y){return Array.isArray(y)?y.flatMap(a=>!Kn(a)||typeof a.name!="string"?[]:[{name:a.name,type:typeof a.type=="string"?a.type:void 0,description:typeof a.description=="string"?a.description:void 0}]):[]}function eh(y){if(y)try{const a=JSON.parse(y);if(!Kn(a))return;const i=Kn(a.signature)?a.signature:{};return{instructions:typeof i.instructions=="string"?i.instructions:"",inputs:Id(i.inputs),outputs:Id(i.outputs),model:a.models,runtime:a.runtime,skills:a.skills,tools:a.tools}}catch{return}}const nh=J.memo(({data:y})=>p.jsxs("button",{type:"button",className:`node-card ${y.status?`status-${y.status}`:"blueprint"}`,onClick:y.onOpen,"aria-label":`Inspect ${y.label}`,children:[p.jsx(Qd,{type:"target",position:Kd.Left,isConnectable:!1}),p.jsx("span",{className:"node-kicker",children:y.nodeType}),p.jsx("strong",{children:y.label}),y.status&&p.jsx("span",{className:"node-status",children:y.status}),y.duration&&p.jsx("span",{className:"node-duration",children:y.duration}),y.error&&p.jsx("span",{className:"node-error",children:y.error}),y.declaration&&p.jsxs("span",{className:"field-grid",children:[p.jsxs("span",{children:[p.jsx("small",{children:"Inputs"}),y.declaration.inputs.map(a=>p.jsx("span",{className:"field",children:a.name},`input-${a.name}`))]}),p.jsxs("span",{children:[p.jsx("small",{children:"Outputs"}),y.declaration.outputs.map(a=>p.jsx("span",{className:"field",children:a.name},`output-${a.name}`))]})]}),p.jsx(Qd,{type:"source",position:Kd.Right,isConnectable:!1})]}));nh.displayName="WorkflowNodeCard";function up(y){const a=Object.fromEntries(y.nodeIds.map(c=>[c,0]));for(const c of Object.values(y.graph))for(const v of c.children)a[v]=(a[v]??0)+1;const i={},o=y.nodeIds.filter(c=>a[c]===0);for(const c of o)i[c]=0;for(let c=0;cv.map((d,g)=>[d,{x:Number(c)*330,y:g*220-(v.length-1)*110}])))}function sp(y){if(!y.startedAt)return;const a=y.endedAt||Date.now()/1e3,i=Math.max(0,a-y.startedAt);return i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m`}function cp({workflow:y,runTopology:a,runNodes:i=[],onOpenNode:o}){const f=J.useMemo(()=>{if(a)return a;if(y)return{nodeIds:y.nodeIds,graph:y.graph,nodeTypes:y.nodeTypes,displayNames:y.displayNames,agentMetadataJson:y.agentMetadataJson}},[a,y]),c=J.useMemo(()=>{if(!f)return{nodes:[],edges:[]};const v=up(f),d=Object.fromEntries(i.map(j=>[j.nodeId,j])),g=f.nodeIds.map(j=>{const R=d[j];return{id:j,type:"workflow",position:v[j],data:{label:f.displayNames[j]||R?.name||j,nodeType:f.nodeTypes[j]||R?.nodeType||"step",status:R?.status,error:R?.error,duration:R?sp(R):void 0,declaration:y?eh(y.agentMetadataJson[j]):void 0,onOpen:()=>o(j)}}}),m=new Set,z=[];for(const[j,R]of Object.entries(f.graph))for(const C of R.children){const V=`${j}->${C}`;m.has(V)||(m.add(V),z.push({id:V,source:j,target:C,markerEnd:{type:_m.ArrowClosed},className:"dag-edge"}))}return{nodes:g,edges:z}},[o,i,f,y]);return p.jsxs(Mm,{nodes:c.nodes,edges:c.edges,nodeTypes:{workflow:nh},fitView:!0,fitViewOptions:{padding:.24},minZoom:.25,maxZoom:1.8,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[p.jsx(Rm,{color:"rgba(255,255,255,.06)",gap:24,size:1}),p.jsx(wm,{showInteractive:!1})]})}function op(y,a,i){const o=new Array(y);return new Proxy(o,{get(f,c,v){if(typeof c=="string"){const d=c.charCodeAt(0);if(d>=48&&d<=57){const g=+c;if(Number.isInteger(g)&&g>=0&&go[z]!==m))&&(o=d,f=a(...d),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(f),c=!1),f}return v.updateDeps=d=>{o=d},v}function Pd(y,a){if(y===void 0)throw new Error("Unexpected undefined");return y}const fp=(y,a)=>Math.abs(y-a)<1.01,rp=(y,a,i)=>{let o;return function(...f){y.clearTimeout(o),o=y.setTimeout(()=>a.apply(this,f),i)}};let _a;const Lc=()=>{if(_a!==void 0)return _a;if(typeof navigator>"u")return _a=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return _a=!0;const y=navigator.maxTouchPoints;return _a=navigator.platform==="MacIntel"&&y!==void 0&&y>0},th=y=>{const{offsetWidth:a,offsetHeight:i}=y;return{width:a,height:i}},dp=y=>y,hp=y=>{const a=Math.max(y.startIndex-y.overscan,0),o=Math.min(y.endIndex+y.overscan,y.count-1)-a+1,f=new Array(o);for(let c=0;c{const i=y.scrollElement;if(!i)return;const o=y.targetWindow;if(!o)return;const f=v=>{const{width:d,height:g}=v;a({width:Math.round(d),height:Math.round(g)})};if(f(th(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(v=>{const d=()=>{const g=v[0];if(g?.borderBoxSize){const m=g.borderBoxSize[0];if(m){f({width:m.inlineSize,height:m.blockSize});return}}f(th(i))};y.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},tu={passive:!0},mp=typeof window>"u"?!0:"onscrollend"in window,yp=(y,a,i)=>{const o=y.scrollElement;if(!o)return;const f=y.targetWindow;if(!f)return;const c=y.options.useScrollendEvent&∓let v=0;const d=c?null:rp(f,()=>a(v,!1),y.options.isScrollingResetDelay),g=j=>()=>{v=i(o),d?.(),a(v,j)},m=g(!0),z=g(!1);return o.addEventListener("scroll",m,tu),c&&o.addEventListener("scrollend",z,tu),()=>{o.removeEventListener("scroll",m),c&&o.removeEventListener("scrollend",z)}},pp=(y,a)=>yp(y,a,i=>{const{horizontal:o,isRtl:f}=y.options;return o?i.scrollLeft*(f&&-1||1):i.scrollTop}),vp=(y,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(y),f=i.options.getItemKey(o);return i.itemSizeCache.get(f)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(y),f=i.options.getItemKey(o),c=i.itemSizeCache.get(f);if(c!==void 0)return c}return y[i.options.horizontal?"offsetWidth":"offsetHeight"]},bp=(y,{adjustments:a=0,behavior:i},o)=>{var f,c;(c=(f=o.scrollElement)==null?void 0:f.scrollTo)==null||c.call(f,{[o.options.horizontal?"left":"top"]:y+a,behavior:i})},Sp=bp;class Tp{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,f;return((f=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:f.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(f=>{f.forEach(c=>{const v=()=>{const d=c.target,g=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,z]of this.elementsCache)if(z===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(d,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(v):v()})}));return{disconnect:()=>{var f;(f=o())==null||f.disconnect(),i=null},observe:f=>{var c;return(c=o())==null?void 0:c.observe(f,{box:"border-box"})},unobserve:f=>{var c;return(c=o())==null?void 0:c.unobserve(f)}}})(),this.range=null,this.setOptions=i=>{var o,f;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:dp,rangeExtractor:hp,onChange:()=>{},measureElement:vp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const R in i){const C=i[R];C!==void 0&&(c[R]=C)}const v=this.options;let d=null,g=null,m=!1;if(v!==void 0&&v.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const R=v.count,C=c.count,V=this.getMeasurements(),G=R>0?((o=V[0])==null?void 0:o.key)??v.getItemKey(0):null,it=R>0?((f=V[R-1])==null?void 0:f.key)??v.getItemKey(R-1):null;if(C!==R||R>0&&C>0&&(c.getItemKey(0)!==G||c.getItemKey(C-1)!==it)){m=!0;const tt=R>0?this.getVirtualItemForOffset(this.getScrollOffset())??V[0]:null;tt&&(d=[tt.key,this.getScrollOffset()-tt.start]);const ht=c.followOnAppend===!0?"auto":c.followOnAppend||null;ht&&C>R&&this.isAtEnd(v.scrollEndThreshold)&&(R===0||c.getItemKey(C-1)!==it)&&(g=ht)}}this.options=c,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let z=!1,j=0;if(d&&this.scrollOffset!==null){const[R,C]=d,V=this.getMeasurements(),{count:G,getItemKey:it}=this.options;let K=0;for(;K{var o,f;(f=(o=this.options).onChange)==null||f.call(o,this,i)},this.maybeNotify=Ml(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,v)=>{if(v&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=v?d===c?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Lc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",v,tu),c.addEventListener("touchend",d,tu),this.unsubs.push(()=>{c.removeEventListener("touchstart",v),c.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const f=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,f&&this.scrollElement&&this.options.enabled){const[c,v,d,g]=f;c!==null&&!d&&(Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?g!==0&&(this._iosDeferredAdjustment+=g):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const f=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=f,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ml(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,f,c,v,d,g,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m}),{key:!1}),this.getMeasurements=Ml(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m},z)=>{const j=this.itemSizeCache;if(!v)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const K of this.laneAssignments.keys())K>=i&&this.laneAssignments.delete(K);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(K=>{this.itemSizeCache.set(K.key,K.size)}));const R=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),d===1){const K=i*2;let Z=this._flatMeasurements;if(!Z||Z.length0&&st.set(Z.subarray(0,R*2)),Z=st,this._flatMeasurements=Z}let tt;if(R===0)tt=o+f;else{const st=R-1;tt=Z[st*2]+Z[st*2+1]+m}for(let st=R;st1){ht=tt;const Kt=V[ht],At=Kt!==void 0?C[Kt]:void 0;st=At?At.end+m:o+f}else if(it===d){let Kt=0,At=G[0],Ht=V[0];for(let Jt=1;Jtthis.options.debug}),this.calculateRange=Ml(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,f,c)=>i.length===0||o===0?(this.range=null,null):(this.range=zp(i,o,f,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ml(()=>{let i=null,o=null;const f=this.calculateRange();return f&&(i=f.startIndex,o=f.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,f,c,v)=>c===null||v===null?[]:i({startIndex:c,endIndex:v,overscan:o,count:f}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,f=i.getAttribute(o);return f?parseInt(f,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const f=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(f!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),v=Math.max(0,f-c),d=Math.min(this.options.count-1,f+c);return i>=v&&i<=d}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((v,d)=>{v.isConnected||(this.observer.unobserve(v),this.elementsCache.delete(d))});return}const o=this.indexFromElement(i),f=this.options.getItemKey(o),c=this.elementsCache.get(f);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(f,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var f,c;if(i<0||i>=this.options.count)return;let v,d,g;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)g=this.options.getItemKey(i),d=m[i*2],v=m[i*2+1];else{const R=this.measurementsCache[i];if(!R)return;g=R.key,d=R.start,v=R.size}const z=this.itemSizeCache.get(g)??v,j=o-z;if(j!==0){const R=this.options.anchorTo==="end"&&((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,C=R?this.getTotalSize():0,V=this.getScrollOffset()+this.scrollAdjustments,it=!this.itemSizeCache.has(g)?d[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const f=[];for(let c=0,v=i.length;cthis.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const f=this._flatMeasurements,c=this.options.lanes===1&&f!=null,v=lh(0,o.length-1,c?d=>f[d*2]:d=>Pd(o[d]).start,i);return Pd(o[v])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,f=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),v=this.getScrollOffset();o==="auto"&&(o=i>=v+c?"end":"start"),o==="center"?i+=(f-c)/2:o==="end"&&(i-=c);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const f=this.getSize(),c=this.getScrollOffset(),v=this.measurementsCache[i];if(!v)return;if(o==="auto")if(v.end>=c+f-this.options.scrollPaddingEnd)o="end";else if(v.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?v.end+this.options.scrollPaddingEnd:v.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,v.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),v=this.now();this.scrollState={index:null,align:o,behavior:f,startedAt:v,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[v,d]=c,g=this.now();this.scrollState={index:i,align:d,behavior:f,startedAt:g,lastTargetOffset:v,stableFrames:0},this._scrollToOffset(v,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const f=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let f;if(o.length===0)f=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,v=this._flatMeasurements;v!=null?f=v[c*2]+v[c*2+1]:f=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let v=o.length-1;for(;v>=0&&c.some(d=>d===null);){const d=o[v];c[d.lane]===null&&(c[d.lane]=d.end),v--}f=Math.max(...c.filter(d=>d!==null))}return Math.max(f-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const f of o)f&&this.itemSizeCache.has(f.key)&&i.push({index:f.index,key:f.key,start:f.start,size:f.size,end:f.end,lane:f.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:f})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:f,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,f=o?o[0]:this.scrollState.lastTargetOffset,c=1,v=f!==this.scrollState.lastTargetOffset;if(!v&&fp(f,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==f&&this._scrollToOffset(f,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,v){const d=this.getSize()||600,g=Math.abs(f-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&g>d;this.scrollState.lastTargetOffset=f,m||(this.scrollState.behavior="auto"),this._scrollToOffset(f,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const lh=(y,a,i,o)=>{for(;y<=a;){const f=(y+a)/2|0,c=i(f);if(co)a=f-1;else return f}return y>0?y-1:0};function kp(y,a,i){let o=0;for(;o<=a;){const f=(o+a)/2|0,c=y[f*2];if(ci)a=f-1;else return f}return o>0?o-1:0}function zp(y,a,i,o,f){const c=y.length-1;if(y.length<=o)return{startIndex:0,endIndex:c};if(o===1&&f!==null){const m=kp(f,c,i);let z=m;const j=i+a;for(;zy[m].start,i),g=d;if(o===1)for(;g1){const m=Array(o).fill(0);for(;gj=0&&z.some(j=>j>=i);){const j=y[d];z[j.lane]=j.start,d--}d=Math.max(0,d-d%o),g=Math.min(c,g+(o-1-g%o))}return{startIndex:d,endIndex:g}}const Hc=typeof document<"u"?J.useLayoutEffect:J.useEffect;function Ep({useFlushSync:y=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const f=J.useReducer(z=>z+1,0)[1],c=J.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const v=z=>{const j=c.current;if(!j.enabled||!j.container)return;const R=z.getTotalSize();if(R!==j.lastSize){j.lastSize=R;const C=z.options.horizontal?"width":"height";j.container.style[C]=`${R}px`}},d=z=>{const j=c.current;if(!j.enabled||!j.container)return;v(z);const R=!!z.options.horizontal,C=j.mode==="transform",V=R?"left":"top",G=z.options.scrollMargin,it=z.getVirtualItems();for(const K of it){const Z=K.start-G,tt=z.elementsCache.get(K.key);tt&&j.lastPositions.get(tt)!==Z&&(j.lastPositions.set(tt,Z),C?tt.style.transform=R?`translate3d(${Z}px, 0, 0)`:`translate3d(0, ${Z}px, 0)`:tt.style[V]=`${Z}px`)}},g={...o,onChange:(z,j)=>{var R;const C=c.current;let V=!0;if(C.enabled){d(z);const G=z.range,it=C.prevRange;V=!it||it.isScrolling!==z.isScrolling||it.startIndex!==G?.startIndex||it.endIndex!==G?.endIndex,V&&(C.prevRange=G?{startIndex:G.startIndex,endIndex:G.endIndex,isScrolling:z.isScrolling}:null)}V&&(y&&j?Um.flushSync(f):f()),(R=o.onChange)==null||R.call(o,z,j)}},[m]=J.useState(()=>{const z=new Tp(g);return Object.assign(z,{containerRef:j=>{const R=c.current;if(R.container=j,R.lastSize=null,j&&R.enabled){const C=z.getTotalSize();R.lastSize=C;const V=z.options.horizontal?"width":"height";j.style[V]=`${C}px`}}})});return m.setOptions(g),Hc(()=>m._didMount(),[]),Hc(()=>(v(m),m._willUpdate())),Hc(()=>{d(m)}),m}function Np(y){return Ep({observeElementRect:gp,observeElementOffset:pp,scrollToFn:Sp,...y})}function Qn({value:y,depth:a=0}){return y===null?p.jsx("span",{className:"value-null",children:"null"}):typeof y=="string"?p.jsx("span",{className:"value-string",children:y}):typeof y=="number"||typeof y=="boolean"?p.jsx("span",{className:"value-scalar",children:String(y)}):Array.isArray(y)?p.jsx("ol",{className:"value-list",children:y.map((i,o)=>p.jsx("li",{children:p.jsx(Qn,{value:i,depth:a+1})},`${a}-${o}`))}):Kn(y)?y.kind==="predict_rlm_file"&&typeof y.path=="string"?p.jsxs("span",{className:"file-value",title:"Reported host path; contents are not copied",children:[p.jsx("span",{"aria-hidden":"true",children:"↗"}),p.jsxs("span",{children:[p.jsx("small",{children:"PredictRLM file"}),p.jsx("code",{children:y.path})]})]}):y.kind==="unavailable"&&typeof y.reason=="string"?p.jsxs("span",{className:"value-unavailable",children:["Unavailable · ",y.reason]}):p.jsx("dl",{className:"value-object",children:Object.entries(y).map(([i,o])=>p.jsxs("div",{children:[p.jsx("dt",{children:i}),p.jsx("dd",{children:p.jsx(Qn,{value:o,depth:a+1})})]},i))}):p.jsx("span",{className:"value-unavailable",children:"Unavailable"})}function Vc({value:y}){return p.jsx("pre",{className:"json-block",children:JSON.stringify(y,null,2)})}function Ap(y){if(Kn(y))return Kn(y.data)?y.data:y}function Op({api:y,workflow:a,run:i,nodeId:o,liveEvents:f=[],liveLogs:c=[],onClose:v}){const[d,g]=J.useState("overview"),[m,z]=J.useState([]),[j,R]=J.useState([]),[C,V]=J.useState(),[G,it]=J.useState(),[K,Z]=J.useState(),[tt,ht]=J.useState(!0),st=J.useRef(new Map),Bt=J.useRef(null),$=i?.nodes.find(w=>w.nodeId===o),jt=i?i.topology?.agentMetadataJson[o??""]:a?.agentMetadataJson[o??""],Dt=jt?eh(jt):void 0;J.useEffect(()=>{if(g("overview"),z([]),R([]),V(void 0),it(void 0),ht(!0),st.current.clear(),!i||!o)return;let w=!0;return Promise.all([y.listAgentEvents(i,o),y.listLogs(i)]).then(([H,bt])=>{w&&(z(H),R(bt.filter(ct=>!ct.nodeId||ct.nodeId===o)))}).catch(H=>{w&&Z(H instanceof Error?H.message:"Details unavailable")}),()=>{w=!1}},[y,o,i]);const Kt=J.useMemo(()=>{const w=new Map;for(const H of[...m,...f])w.set(H.eventSequence,H);return[...w.values()].sort((H,bt)=>Number(H.eventSequence)-Number(bt.eventSequence))},[m,f]),At=Kt.filter(w=>w.eventKind==="iteration.recorded"),Ht=J.useMemo(()=>{const w=new Map;for(const H of[...j,...c])w.set(H.sequence,H);return[...w.values()].sort((H,bt)=>Number(H.sequence)-Number(bt.sequence))},[c,j]),Jt=J.useMemo(()=>{const w=$?.trace?.header?.usageJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.usageJson]),de=J.useMemo(()=>{const w=$?.trace?.header?.telemetryJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.telemetryJson]),he=d==="inputs"?Dt?.inputs:d==="output"?Dt?.outputs:void 0,_=Np({count:At.length,getScrollElement:()=>Bt.current,estimateSize:()=>64,overscan:6});if(J.useEffect(()=>{!tt||!At.length||V(At.at(-1).eventSequence)},[tt,At]),J.useEffect(()=>{const w=Kt.find(ct=>ct.eventSequence===C);if(!w?.bodyToken){it(void 0);return}const H=st.current.get(w.bodyToken);if(H!==void 0){it(H);return}let bt=!0;return it(void 0),Z(void 0),y.readDetail(w.bodyToken).then(ct=>{if(bt){for(st.current.delete(w.bodyToken),st.current.set(w.bodyToken,ct);st.current.size>8;){const ot=st.current.keys().next().value;if(ot===void 0)break;st.current.delete(ot)}it(ct)}}).catch(ct=>{bt&&Z(ct instanceof Error?ct.message:"Detail unavailable")}),()=>{bt=!1}},[y,Kt,C]),J.useEffect(()=>{const w=d==="inputs"?"run.started":d==="output"?"run.succeeded":void 0;if(!w)return;const H=[...Kt].reverse().find(bt=>bt.eventKind===w);H&&V(H.eventSequence)},[Kt,d]),!i&&a&&o)return p.jsxs("aside",{className:"inspector","aria-label":"Node declaration",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Declaration"}),p.jsx("h2",{children:a.displayNames[o]||o})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),Dt?p.jsxs("div",{className:"inspector-body declaration",children:[p.jsxs("section",{children:[p.jsx("h3",{children:"Instructions"}),p.jsx("p",{className:"instructions",children:Dt.instructions||"No instructions"})]}),p.jsxs("section",{className:"signature-columns",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"Inputs"}),Dt.inputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]}),p.jsxs("div",{children:[p.jsx("h3",{children:"Outputs"}),Dt.outputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Runtime"}),p.jsx(Vc,{value:Dt.runtime})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Models"}),p.jsx(Vc,{value:Dt.model})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Skills & tools"}),p.jsx(Vc,{value:{skills:Dt.skills,tools:Dt.tools}})]})]}):p.jsx("p",{className:"empty-copy",children:"This node has no agent declaration metadata."})]});if(!i||!$)return null;const B=Ap(G),Q=d==="inputs"?"inputs":"outputs";return p.jsxs("aside",{className:"inspector","aria-label":"Run inspector",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Historical execution"}),p.jsx("h2",{children:$.name}),p.jsx("span",{className:`status-pill status-${$.status}`,children:$.status})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),p.jsx("nav",{className:"inspector-tabs","aria-label":"Run detail views",children:["overview","inputs","output","trace","logs"].map(w=>p.jsx("button",{type:"button",className:d===w?"active":"",onClick:()=>g(w),children:w},w))}),p.jsxs("div",{className:"inspector-body",children:[K&&p.jsx("p",{className:"error-banner",children:K}),d==="overview"&&p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:"metric-grid",children:[p.jsxs("div",{children:[p.jsx("small",{children:"Status"}),p.jsx("strong",{children:$.status})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Revision"}),p.jsx("strong",{children:$.revision})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Started"}),p.jsx("strong",{children:$.startedAt?"yes":"—"})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Duration"}),p.jsx("strong",{children:$.startedAt&&$.endedAt?`${Math.max(0,$.endedAt-$.startedAt).toFixed(2)}s`:"—"})]})]}),$.error&&p.jsx("p",{className:"node-failure",children:$.error}),$.trace&&p.jsxs("section",{children:[p.jsx("h3",{children:"Trace header"}),p.jsxs("dl",{className:"trace-header",children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Status"}),p.jsx("dd",{children:$.trace.status})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Events"}),p.jsx("dd",{children:$.trace.eventCount})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Size"}),p.jsxs("dd",{children:[$.trace.sizeBytes," B"]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Complete"}),p.jsx("dd",{children:$.trace.complete?"yes":"no"})]}),$.trace.header&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Model"}),p.jsx("dd",{children:$.trace.header.model})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Iterations"}),p.jsxs("dd",{children:[$.trace.header.iterations,"/",$.trace.header.maxIterations]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Duration"}),p.jsxs("dd",{children:[$.trace.header.durationMs," ms"]})]})]})]}),Jt!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Usage"}),p.jsx(Qn,{value:Jt})]}),de!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Telemetry"}),p.jsx(Qn,{value:de})]})]})]}),(d==="inputs"||d==="output")&&p.jsxs("section",{children:[p.jsx("h3",{children:d==="inputs"?"Invocation inputs":"Terminal output"}),he?.length?p.jsxs("div",{className:"declared-fields",children:[p.jsx("small",{children:"Declared fields"}),he.map(w=>p.jsxs("span",{children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type})]},w.name))]}):null,B&&Q in B?p.jsx(Qn,{value:B[Q]}):p.jsxs("p",{className:"empty-copy",children:["No retained ",d," are available."]})]}),d==="trace"&&p.jsxs("section",{className:"trace-layout",children:[p.jsxs("div",{className:"trace-toolbar",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"RunTrace"}),p.jsxs("span",{children:[At.length," complete turns"]})]}),p.jsx("button",{type:"button",className:tt?"toggle active":"toggle",onClick:()=>ht(w=>!w),children:tt?"Following live":"Follow latest"})]}),p.jsx("div",{className:"turn-list",ref:Bt,children:p.jsx("div",{style:{height:_.getTotalSize(),position:"relative"},children:_.getVirtualItems().map(w=>{const H=At[w.index];return p.jsxs("button",{type:"button",className:`turn-row ${C===H.eventSequence?"active":""} ${H.error?"failed":""}`,style:{transform:`translateY(${w.start}px)`},onClick:()=>{ht(!1),V(H.eventSequence)},children:[p.jsxs("strong",{children:["Turn ",H.iteration??w.index+1]}),p.jsx("span",{children:H.durationMs?`${H.durationMs} ms`:"—"}),p.jsxs("small",{children:[H.toolCount," tools · ",H.predictCount," predicts"]})]},H.eventSequence)})})}),p.jsx("div",{className:"turn-detail",children:G!==void 0?p.jsx(Qn,{value:G}):p.jsx("p",{className:"empty-copy",children:"Select a turn."})})]}),d==="logs"&&p.jsxs("section",{children:[p.jsx("h3",{children:"Node logs"}),p.jsx("div",{className:"log-list",children:Ht.map(w=>p.jsxs("button",{type:"button",onClick:()=>{y.readDetail(w.bodyToken).then(it).catch(H=>{Z(H instanceof Error?H.message:"Log unavailable")})},children:[p.jsx("span",{className:`log-level level-${w.level}`,children:w.level}),p.jsx("time",{children:new Date(w.timestamp*1e3).toLocaleTimeString()}),p.jsxs("span",{children:["#",w.sequence]})]},w.sequence))}),G!==void 0&&p.jsx(Qn,{value:G})]})]})]})}function xp({value:y,onChange:a}){const i=J.useRef(null);return J.useEffect(()=>{if(!i.current)return;const o=new Ii({parent:i.current,state:Cm.create({doc:y,extensions:[Lm(),Hm.of([]),Ii.lineWrapping,Ii.theme({"&":{backgroundColor:"#0e1112",color:"#dce4df"},".cm-content":{caretColor:"#eeff8c",minHeight:"110px"},".cm-gutters":{backgroundColor:"#0e1112",color:"#626b67",border:"0"},"&.cm-focused":{outline:"1px solid #778357"}}),Ii.updateListener.of(f=>{f.docChanged&&a(f.state.doc.toString())})]})});return()=>o.destroy()},[]),p.jsx("div",{className:"json-editor",ref:i})}function jp({workflow:y,run:a,pending:i,onStart:o,onCancel:f}){const[c,v]=J.useState(!1),[d,g]=J.useState("{}"),[m,z]=J.useState(),j=a?.summary?.status==="pending"||a?.summary?.status==="running",R=async()=>{if(!y)return;z(void 0);let C;if(c)try{const V=JSON.parse(d);if(!Kn(V))throw new Error("Run input must be a JSON object");C=V}catch(V){z(V instanceof Error?V.message:"Run input is invalid JSON");return}try{await o(y.workflowId,C)}catch(V){z(V instanceof Error?V.message:"Operator rejected the run")}};return p.jsxs("div",{className:"run-controls",children:[y&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"run-button",disabled:i?.kind==="start",onClick:()=>{R()},children:i?.kind==="start"?"Requesting…":"Run"}),p.jsx("button",{type:"button",className:`input-toggle ${c?"active":""}`,onClick:()=>v(C=>!C),children:c?"Hide JSON input":"Add JSON input"})]}),j&&a?.summary&&p.jsx("button",{type:"button",className:"cancel-button",disabled:i?.kind==="cancel",onClick:()=>{z(void 0),f(a.summary.runId).catch(C=>{z(C instanceof Error?C.message:"Cancellation failed")})},children:i?.kind==="cancel"?"Cancelling…":"Cancel run"}),c&&y&&p.jsxs("div",{className:"input-popover",children:[p.jsxs("div",{children:[p.jsx("strong",{children:"Workflow input"}),p.jsx("span",{children:"Schema-blind JSON object"})]}),p.jsx(xp,{value:d,onChange:g})]}),m&&p.jsx("div",{className:"action-error",children:m})]})}const ah={runs:{},liveEvents:{},liveLogs:{},operatorInstanceId:"",sequence:"0",connection:"connecting"};function Dp(y,a){if(a.type==="baseline"){const g=Object.fromEntries(a.baseline.runs.filter(m=>m.summary).map(m=>[m.summary.runId,m]));return{...ah,catalog:a.baseline.catalog,runs:g,operatorInstanceId:a.baseline.catalog.operatorInstanceId,sequence:a.baseline.asOfSequence,connection:"live"}}if(a.type==="connection")return{...y,connection:a.connection,error:a.error};if(a.type==="action")return{...y,action:a.action};const{envelope:i}=a;if(i.operatorInstanceId!==y.operatorInstanceId)throw new Error("Operator epoch changed");if(i.payload.oneofKind!=="update")throw new Error("Operator requested a structural reset");const o=i.payload.update;if(BigInt(o.sequence)!==BigInt(y.sequence)+1n)throw new Error(`Operator update gap after sequence ${y.sequence}`);const f={...y,sequence:o.sequence,error:void 0},c=o.change;if(c.oneofKind==="catalogReplaced")return c.catalogReplaced.catalog&&(f.catalog=c.catalogReplaced.catalog),f;if(c.oneofKind==="runCreated"&&c.runCreated.summary){const g=c.runCreated.summary;return f.runs={...y.runs,[g.runId]:{operatorInstanceId:y.operatorInstanceId,asOfSequence:o.sequence,summary:g,nodes:c.runCreated.nodes,latestLogSequence:"0",logPageToken:"",topology:c.runCreated.topology}},f}const v=c.oneofKind==="runStatusChanged"?c.runStatusChanged.runId:c.oneofKind==="nodeStatusChanged"?c.nodeStatusChanged.runId:c.oneofKind==="logAppended"?c.logAppended.runId:c.oneofKind==="agentEventAppended"?c.agentEventAppended.runId:c.oneofKind==="traceFinalized"?c.traceFinalized.runId:"",d=y.runs[v];if(!d)throw new Error(`Operator update referenced unknown run ${v}`);if(c.oneofKind==="runStatusChanged"&&d.summary)f.runs={...y.runs,[v]:{...d,summary:{...d.summary,status:c.runStatusChanged.status,startedAt:c.runStatusChanged.startedAt,endedAt:c.runStatusChanged.endedAt,revision:c.runStatusChanged.revision}}};else if(c.oneofKind==="nodeStatusChanged"){const g=c.nodeStatusChanged;f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(m=>m.nodeId===g.nodeId?{...m,status:g.status,startedAt:g.startedAt,endedAt:g.endedAt,revision:g.revision,error:g.error}:m)}}}else if(c.oneofKind==="logAppended"&&c.logAppended.log)f.liveLogs={...y.liveLogs,[v]:[...y.liveLogs[v]??[],c.logAppended.log]};else if(c.oneofKind==="agentEventAppended"&&c.agentEventAppended.event){const g=`${v}:${c.agentEventAppended.nodeId}`;f.liveEvents={...y.liveEvents,[g]:[...y.liveEvents[g]??[],c.agentEventAppended.event]}}else c.oneofKind==="traceFinalized"&&c.traceFinalized.trace&&(f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(g=>g.nodeId===c.traceFinalized.nodeId?{...g,trace:c.traceFinalized.trace}:g)}});return f}function _p(y){const[a,i]=J.useReducer(Dp,ah),o=J.useRef(0),f=J.useCallback(async()=>{const d=await y.loadBaseline();return i({type:"baseline",baseline:d}),d},[y]);J.useEffect(()=>{const d=++o.current;let g=!1;return(async()=>{let z=250;for(;!g&&o.current===d;)try{i({type:"connection",connection:"connecting"});const j=await y.loadBaseline();if(g)return;i({type:"baseline",baseline:j}),z=250;let R=j.asOfSequence;for await(const C of y.streamUpdates(j.catalog.operatorInstanceId,R)){if(g)return;if(C.payload.oneofKind!=="update"||BigInt(C.payload.update.sequence)!==BigInt(R)+1n)break;i({type:"envelope",envelope:C}),R=C.payload.update.sequence}i({type:"connection",connection:"reconnecting"})}catch(j){if(g)return;i({type:"connection",connection:"reconnecting",error:j instanceof Error?j.message:"Operator connection failed"});const{promise:R,resolve:C}=Promise.withResolvers();window.setTimeout(C,z),await R,z=Math.min(z*2,4e3)}})(),()=>{g=!0,o.current+=1}},[y]);const c=J.useCallback(async(d,g)=>{i({type:"action",action:{kind:"start",target:d}});try{return await y.startRun(d,g)}finally{i({type:"action",action:void 0})}},[y]),v=J.useCallback(async d=>{i({type:"action",action:{kind:"cancel",target:d}});try{await y.cancelRun(d)}finally{i({type:"action",action:void 0})}},[y]);return{state:a,reconcile:f,startRun:c,cancelRun:v}}function Mp({api:y}){const{state:a,startRun:i,cancelRun:o}=_p(y),[f,c]=J.useState(),[v,d]=J.useState();J.useEffect(()=>{const G=a.catalog?.workflows??[];if(!G.length){c(void 0);return}if(!f){c({kind:"workflow",workflowId:G[0].workflowId});return}G.some(it=>it.workflowId===f.workflowId)||c({kind:"workflow",workflowId:G[0].workflowId})},[f,a.catalog]);const g=a.catalog?.workflows.find(G=>G.workflowId===f?.workflowId),m=f?.kind==="run"?a.runs[f.runId]:void 0,z=J.useMemo(()=>Object.values(a.runs).filter(G=>G.summary?.workflowId===g?.workflowId).sort((G,it)=>Number(it.summary.createdSequence)-Number(G.summary.createdSequence))[0],[a.runs,g?.workflowId]),j=J.useCallback(G=>d(G),[]),R=J.useCallback(G=>{c(G),d(void 0)},[]),C=m??(f?.kind==="workflow"?z:void 0),V=m&&v?`${m.summary?.runId}:${v}`:"";return p.jsxs("div",{className:"app-shell",children:[p.jsxs("header",{className:"topbar",children:[p.jsxs("div",{className:"brand",children:[p.jsx("span",{className:"brand-mark","aria-hidden":"true",children:"A"}),p.jsxs("div",{children:[p.jsx("strong",{children:"Avalanche"}),p.jsx("span",{children:"Operator"})]})]}),p.jsxs("div",{className:"breadcrumb",children:[p.jsx("span",{children:g?.rootAlias||"Local operator"}),g&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:g.displayName})]}),m?.summary&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:m.summary.runId})]})]}),p.jsxs("div",{className:`connection connection-${a.connection}`,children:[p.jsx("span",{}),a.connection==="live"?"Live":a.connection,p.jsxs("small",{children:["seq ",a.sequence]})]})]}),a.error&&p.jsx("div",{className:"connection-error",children:a.error}),p.jsxs("main",{className:`workspace ${v?"with-inspector":""}`,children:[p.jsx(ip,{catalog:a.catalog,runs:a.runs,selection:f,onSelect:R}),p.jsxs("section",{className:"canvas-shell",children:[p.jsxs("header",{className:"view-header",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:m?"Historical run":"Current definition"}),p.jsx("h1",{children:m?.summary?.runId||g?.displayName||"Operator"}),p.jsx("p",{children:m?`Recorded topology · ${m.summary?.status??"unknown"}`:g?`${g.nodeIds.length} nodes · ${g.relativeFile}`:"Waiting for a workflow catalog"})]}),p.jsx(jp,{workflow:m?void 0:g,run:m??C,pending:a.action,onStart:i,onCancel:o})]}),p.jsxs("div",{className:m?"canvas run-canvas":"canvas blueprint-canvas",children:[g||m?.topology?p.jsx(cp,{workflow:m?void 0:g,runTopology:m?.topology,runNodes:m?.nodes,onOpenNode:j}):p.jsxs("div",{className:"empty-state",children:[p.jsx("span",{children:"◇"}),p.jsx("h2",{children:"No workflows discovered"}),p.jsx("p",{children:"Catalog changes will appear here as the operator scans configured targets."})]}),m&&p.jsxs("div",{className:"historical-badge",children:[p.jsx("span",{children:"Immutable run snapshot"}),"Current workflow changes do not alter this canvas"]})]})]}),v&&p.jsx(Op,{api:y,workflow:g,run:m,nodeId:v,liveEvents:a.liveEvents[V],liveLogs:m?.summary?a.liveLogs[m.summary.runId]:void 0,onClose:()=>d(void 0)})]})]})}const ih=document.getElementById("root");if(!ih)throw new Error("Operator UI root element is missing");Qm.createRoot(ih).render(p.jsx(J.StrictMode,{children:p.jsx(Mp,{api:new ep})})); +`+l.stack}}var iu=Object.prototype.hasOwnProperty,uu=y.unstable_scheduleCallback,su=y.unstable_cancelCallback,sh=y.unstable_shouldYield,ch=y.unstable_requestPaint,ne=y.unstable_now,oh=y.unstable_getCurrentPriorityLevel,Xc=y.unstable_ImmediatePriority,Qc=y.unstable_UserBlockingPriority,Ua=y.unstable_NormalPriority,fh=y.unstable_LowPriority,Kc=y.unstable_IdlePriority,rh=y.log,dh=y.unstable_setDisableYieldValue,Cl=null,le=null;function Pe(t){if(typeof rh=="function"&&dh(t),le&&typeof le.setStrictMode=="function")try{le.setStrictMode(Cl,t)}catch{}}var ae=Math.clz32?Math.clz32:mh,hh=Math.log,gh=Math.LN2;function mh(t){return t>>>=0,t===0?32:31-(hh(t)/gh|0)|0}var Ba=256,qa=262144,Ca=4194304;function On(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function La(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var u=0,s=t.suspendedLanes,r=t.pingedLanes;t=t.warmLanes;var h=l&134217727;return h!==0?(l=h&~s,l!==0?u=On(l):(r&=h,r!==0?u=On(r):n||(n=h&~t,n!==0&&(u=On(n))))):(h=l&~s,h!==0?u=On(h):r!==0?u=On(r):n||(n=l&~t,n!==0&&(u=On(n)))),u===0?0:e!==0&&e!==u&&(e&s)===0&&(s=u&-u,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:u}function Ll(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function yh(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zc(){var t=Ca;return Ca<<=1,(Ca&62914560)===0&&(Ca=4194304),t}function cu(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Hl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ph(t,e,n,l,u,s){var r=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,b=t.expirationTimes,N=t.hiddenUpdates;for(n=r&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var zh=/[\n"\\]/g;function me(t){return t.replace(zh,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function gu(t,e,n,l,u,s,r,h){t.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.type=r:t.removeAttribute("type"),e!=null?r==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ge(e)):t.value!==""+ge(e)&&(t.value=""+ge(e)):r!=="submit"&&r!=="reset"||t.removeAttribute("value"),e!=null?mu(t,r,ge(e)):n!=null?mu(t,r,ge(n)):l!=null&&t.removeAttribute("value"),u==null&&s!=null&&(t.defaultChecked=!!s),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+ge(h):t.removeAttribute("name")}function uo(t,e,n,l,u,s,r,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){hu(t);return}n=n!=null?""+ge(n):"",e=e!=null?""+ge(e):n,h||e===t.value||(t.value=e),t.defaultValue=e}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=h?t.checked:!!l,t.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.name=r),hu(t)}function mu(t,e,n){e==="number"&&Ya(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Pn(t,e,n,l){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=!1;if(Ue)try{var Xl={};Object.defineProperty(Xl,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{Su=!1}var en=null,Tu=null,Xa=null;function go(){if(Xa)return Xa;var t,e=Tu,n=e.length,l,u="value"in en?en.value:en.textContent,s=u.length;for(t=0;t=Zl),So=" ",To=!1;function ko(t,e){switch(t){case"keyup":return Fh.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ll=!1;function Ph(t,e){switch(t){case"compositionend":return zo(e);case"keypress":return e.which!==32?null:(To=!0,So);case"textInput":return t=e.data,t===So&&To?null:t;default:return null}}function tg(t,e){if(ll)return t==="compositionend"||!Au&&ko(t,e)?(t=go(),Xa=Tu=en=null,ll=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Mo(n)}}function Ro(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ro(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function wo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ya(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ya(t.document)}return e}function ju(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var cg=Ue&&"documentMode"in document&&11>=document.documentMode,al=null,Du=null,Fl=null,Mu=!1;function Uo(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mu||al==null||al!==Ya(l)||(l=al,"selectionStart"in l&&ju(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Fl&&Wl(Fl,l)||(Fl=l,l=qi(Du,"onSelect"),0>=r,u-=r,je=1<<32-ae(e)+u|n<P?(it=L,L=null):it=L.sibling;var rt=A(k,L,E[P],D);if(rt===null){L===null&&(L=it);break}t&&L&&rt.alternate===null&&e(k,L),T=s(rt,T,P),ft===null?V=rt:ft.sibling=rt,ft=rt,L=it}if(P===E.length)return n(k,L),st&&qe(k,P),V;if(L===null){for(;PP?(it=L,L=null):it=L.sibling;var En=A(k,L,rt.value,D);if(En===null){L===null&&(L=it);break}t&&L&&En.alternate===null&&e(k,L),T=s(En,T,P),ft===null?V=En:ft.sibling=En,ft=En,L=it}if(rt.done)return n(k,L),st&&qe(k,P),V;if(L===null){for(;!rt.done;P++,rt=E.next())rt=_(k,rt.value,D),rt!==null&&(T=s(rt,T,P),ft===null?V=rt:ft.sibling=rt,ft=rt);return st&&qe(k,P),V}for(L=l(L);!rt.done;P++,rt=E.next())rt=O(L,k,P,rt.value,D),rt!==null&&(t&&rt.alternate!==null&&L.delete(rt.key===null?P:rt.key),T=s(rt,T,P),ft===null?V=rt:ft.sibling=rt,ft=rt);return t&&L.forEach(function(xm){return e(k,xm)}),st&&qe(k,P),V}function vt(k,T,E,D){if(typeof E=="object"&&E!==null&&E.type===G&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case C:t:{for(var V=E.key;T!==null;){if(T.key===V){if(V=E.type,V===G){if(T.tag===7){n(k,T.sibling),D=u(T,E.props.children),D.return=k,k=D;break t}}else if(T.elementType===V||typeof V=="object"&&V!==null&&V.$$typeof===jt&&Cn(V)===T.type){n(k,T.sibling),D=u(T,E.props),la(D,E),D.return=k,k=D;break t}n(k,T);break}else e(k,T);T=T.sibling}E.type===G?(D=Rn(E.props.children,k.mode,D,E.key),D.return=k,k=D):(D=ti(E.type,E.key,E.props,null,k.mode,D),la(D,E),D.return=k,k=D)}return r(k);case Y:t:{for(V=E.key;T!==null;){if(T.key===V)if(T.tag===4&&T.stateNode.containerInfo===E.containerInfo&&T.stateNode.implementation===E.implementation){n(k,T.sibling),D=u(T,E.children||[]),D.return=k,k=D;break t}else{n(k,T);break}else e(k,T);T=T.sibling}D=Cu(E,k.mode,D),D.return=k,k=D}return r(k);case jt:return E=Cn(E),vt(k,T,E,D)}if(he(E))return q(k,T,E,D);if(Ht(E)){if(V=Ht(E),typeof V!="function")throw Error(o(150));return E=V.call(E),X(k,T,E,D)}if(typeof E.then=="function")return vt(k,T,si(E),D);if(E.$$typeof===tt)return vt(k,T,li(k,E),D);ci(k,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,T!==null&&T.tag===6?(n(k,T.sibling),D=u(T,E),D.return=k,k=D):(n(k,T),D=qu(E,k.mode,D),D.return=k,k=D),r(k)):n(k,T)}return function(k,T,E,D){try{na=0;var V=vt(k,T,E,D);return ml=null,V}catch(L){if(L===gl||L===ii)throw L;var ft=ue(29,L,null,k.mode);return ft.lanes=D,ft.return=k,ft}}}var Hn=af(!0),uf=af(!1),sn=!1;function Wu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fu(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function on(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(dt&2)!==0){var u=l.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),l.pending=e,e=Pa(t),Yo(t,null,n),e}return Ia(t,l,e,n),Pa(t)}function aa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,$c(t,n)}}function Iu(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var u=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?u=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?u=s=e:s=s.next=e}else u=s=e;n={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Pu=!1;function ia(){if(Pu){var t=hl;if(t!==null)throw t}}function ua(t,e,n,l){Pu=!1;var u=t.updateQueue;sn=!1;var s=u.firstBaseUpdate,r=u.lastBaseUpdate,h=u.shared.pending;if(h!==null){u.shared.pending=null;var b=h,N=b.next;b.next=null,r===null?s=N:r.next=N,r=b;var x=t.alternate;x!==null&&(x=x.updateQueue,h=x.lastBaseUpdate,h!==r&&(h===null?x.firstBaseUpdate=N:h.next=N,x.lastBaseUpdate=b))}if(s!==null){var _=u.baseState;r=0,x=N=b=null,h=s;do{var A=h.lane&-536870913,O=A!==h.lane;if(O?(at&A)===A:(l&A)===A){A!==0&&A===dl&&(Pu=!0),x!==null&&(x=x.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var q=t,X=h;A=e;var vt=n;switch(X.tag){case 1:if(q=X.payload,typeof q=="function"){_=q.call(vt,_,A);break t}_=q;break t;case 3:q.flags=q.flags&-65537|128;case 0:if(q=X.payload,A=typeof q=="function"?q.call(vt,_,A):q,A==null)break t;_=j({},_,A);break t;case 2:sn=!0}}A=h.callback,A!==null&&(t.flags|=64,O&&(t.flags|=8192),O=u.callbacks,O===null?u.callbacks=[A]:O.push(A))}else O={lane:A,tag:h.tag,payload:h.payload,callback:h.callback,next:null},x===null?(N=x=O,b=_):x=x.next=O,r|=A;if(h=h.next,h===null){if(h=u.shared.pending,h===null)break;O=h,h=O.next,O.next=null,u.lastBaseUpdate=O,u.shared.pending=null}}while(!0);x===null&&(b=_),u.baseState=b,u.firstBaseUpdate=N,u.lastBaseUpdate=x,s===null&&(u.shared.lanes=0),gn|=r,t.lanes=r,t.memoizedState=_}}function sf(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function cf(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ts?s:8;var r=M.T,h={};M.T=h,vs(t,!1,e,n);try{var b=u(),N=M.S;if(N!==null&&N(h,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var x=pg(b,l);oa(t,e,x,re(t))}else oa(t,e,l,re(t))}catch(_){oa(t,e,{then:function(){},status:"rejected",reason:_},re())}finally{B.p=s,r!==null&&h.types!==null&&(r.types=h.types),M.T=r}}function zg(){}function ys(t,e,n,l){if(t.tag!==5)throw Error(o(476));var u=Hf(t).queue;Lf(t,u,e,Q,n===null?zg:function(){return Vf(t),n(l)})}function Hf(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:Q},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Vf(t){var e=Hf(t);e.next===null&&(e=t.alternate.memoizedState),oa(t,e.next.queue,{},re())}function ps(){return Gt(Aa)}function Yf(){return xt().memoizedState}function Gf(){return xt().memoizedState}function Eg(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=re();t=cn(n);var l=on(e,t,n);l!==null&&(ee(l,e,n),aa(l,e,n)),e={cache:Ku()},t.payload=e;return}e=e.return}}function Ng(t,e,n){var l=re();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},vi(t)?Qf(e,n):(n=Uu(t,e,n,l),n!==null&&(ee(n,t,l),Kf(n,e,l)))}function Xf(t,e,n){var l=re();oa(t,e,n,l)}function oa(t,e,n,l){var u={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(vi(t))Qf(e,u);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var r=e.lastRenderedState,h=s(r,n);if(u.hasEagerState=!0,u.eagerState=h,ie(h,r))return Ia(t,e,u,0),St===null&&Fa(),!1}catch{}if(n=Uu(t,e,u,l),n!==null)return ee(n,t,l),Kf(n,e,l),!0}return!1}function vs(t,e,n,l){if(l={lane:2,revertLane:Ws(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},vi(t)){if(e)throw Error(o(479))}else e=Uu(t,n,l,2),e!==null&&ee(e,t,2)}function vi(t){var e=t.alternate;return t===I||e!==null&&e===I}function Qf(t,e){pl=ri=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Kf(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,$c(t,n)}}var fa={readContext:Gt,use:gi,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};fa.useEffectEvent=Et;var Zf={readContext:Gt,use:gi,useCallback:function(t,e){return Zt().memoizedState=[t,e===void 0?null:e],t},useContext:Gt,useEffect:Df,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,yi(4194308,4,wf.bind(null,e,t),n)},useLayoutEffect:function(t,e){return yi(4194308,4,t,e)},useInsertionEffect:function(t,e){yi(4,2,t,e)},useMemo:function(t,e){var n=Zt();e=e===void 0?null:e;var l=t();if(Vn){Pe(!0);try{t()}finally{Pe(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=Zt();if(n!==void 0){var u=n(e);if(Vn){Pe(!0);try{n(e)}finally{Pe(!1)}}}else u=e;return l.memoizedState=l.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},l.queue=t,t=t.dispatch=Ng.bind(null,I,t),[l.memoizedState,t]},useRef:function(t){var e=Zt();return t={current:t},e.memoizedState=t},useState:function(t){t=rs(t);var e=t.queue,n=Xf.bind(null,I,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(t,e){var n=Zt();return ms(n,t,e)},useTransition:function(){var t=rs(!1);return t=Lf.bind(null,I,t.queue,!0,!1),Zt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=I,u=Zt();if(st){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),St===null)throw Error(o(349));(at&127)!==0||gf(l,e,n)}u.memoizedState=n;var s={value:n,getSnapshot:e};return u.queue=s,Df(yf.bind(null,l,s,t),[t]),l.flags|=2048,bl(9,{destroy:void 0},mf.bind(null,l,s,n,e),null),n},useId:function(){var t=Zt(),e=St.identifierPrefix;if(st){var n=De,l=je;n=(l&~(1<<32-ae(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=di++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(u,{is:l.is}):r.createElement(u)}}s[Vt]=e,s[$t]=l;t:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break t;for(;r.sibling===null;){if(r.return===null||r.return===e)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=s;t:switch(Qt(s,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&Ge(e)}}return kt(e),_s(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Ge(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(o(166));if(t=Ie.current,fl(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,u=Yt,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}t[Vt]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||dd(t.nodeValue,n)),t||an(e,!0)}else t=Ci(t).createTextNode(l),t[Vt]=e,e.stateNode=t}return kt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=fl(e),n!==null){if(t===null){if(!l)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Vt]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),t=!1}else n=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(ce(e),e):(ce(e),null);if((e.flags&128)!==0)throw Error(o(558))}return kt(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=fl(e),l!==null&&l.dehydrated!==null){if(t===null){if(!u)throw Error(o(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Vt]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),u=!1}else u=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(ce(e),e):(ce(e),null)}return ce(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),zi(e,e.updateQueue),kt(e),null);case 4:return Zn(),t===null&&tc(e.stateNode.containerInfo),kt(e),null;case 10:return Le(e.type),kt(e),null;case 19:if(ct(Ot),l=e.memoizedState,l===null)return kt(e),null;if(u=(e.flags&128)!==0,s=l.rendering,s===null)if(u)da(l,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=fi(t),s!==null){for(e.flags|=128,da(l,!1),t=s.updateQueue,e.updateQueue=t,zi(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Go(n,t),n=n.sibling;return ot(Ot,Ot.current&1|2),st&&qe(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&ne()>xi&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304)}else{if(!u)if(t=fi(s),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,zi(e,t),da(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!st)return kt(e),null}else 2*ne()-l.renderingStartTime>xi&&n!==536870912&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304);l.isBackwards?(s.sibling=e.child,e.child=s):(t=l.last,t!==null?t.sibling=s:e.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ne(),t.sibling=null,n=Ot.current,ot(Ot,u?n&1|2:n&1),st&&qe(e,l.treeForkCount),t):(kt(e),null);case 22:case 23:return ce(e),es(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(kt(e),e.subtreeFlags&6&&(e.flags|=8192)):kt(e),n=e.updateQueue,n!==null&&zi(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&ct(qn),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Le(Mt),kt(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function Dg(t,e){switch(Hu(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Le(Mt),Zn(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return wa(e),null;case 31:if(e.memoizedState!==null){if(ce(e),e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ce(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(Ot),null;case 4:return Zn(),null;case 10:return Le(e.type),null;case 22:case 23:return ce(e),es(),t!==null&&ct(qn),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Le(Mt),null;case 25:return null;default:return null}}function pr(t,e){switch(Hu(e),e.tag){case 3:Le(Mt),Zn();break;case 26:case 27:case 5:wa(e);break;case 4:Zn();break;case 31:e.memoizedState!==null&&ce(e);break;case 13:ce(e);break;case 19:ct(Ot);break;case 10:Le(e.type);break;case 22:case 23:ce(e),es(),t!==null&&ct(qn);break;case 24:Le(Mt)}}function ha(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var u=l.next;n=u;do{if((n.tag&t)===t){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==u)}}catch(h){mt(e,e.return,h)}}function dn(t,e,n){try{var l=e.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var s=u.next;l=s;do{if((l.tag&t)===t){var r=l.inst,h=r.destroy;if(h!==void 0){r.destroy=void 0,u=e;var b=n,N=h;try{N()}catch(x){mt(u,b,x)}}}l=l.next}while(l!==s)}}catch(x){mt(e,e.return,x)}}function vr(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{cf(e,n)}catch(l){mt(t,t.return,l)}}}function br(t,e,n){n.props=Yn(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){mt(t,e,l)}}function ga(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(u){mt(t,e,u)}}function Me(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(u){mt(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){mt(t,e,u)}else n.current=null}function Sr(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(u){mt(t,t.return,u)}}function Rs(t,e,n){try{var l=t.stateNode;Ig(l,t.type,n,e),l[$t]=e}catch(u){mt(t,t.return,u)}}function Tr(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bn(t.type)||t.tag===4}function ws(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Tr(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Us(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=we));else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Us(t,e,n),t=t.sibling;t!==null;)Us(t,e,n),t=t.sibling}function Ei(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ei(t,e,n),t=t.sibling;t!==null;)Ei(t,e,n),t=t.sibling}function kr(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);Qt(e,l,n),e[Vt]=t,e[$t]=n}catch(s){mt(t,t.return,s)}}var Xe=!1,wt=!1,Bs=!1,zr=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function Mg(t,e){if(t=t.containerInfo,lc=Qi,t=wo(t),ju(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var u=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var r=0,h=-1,b=-1,N=0,x=0,_=t,A=null;e:for(;;){for(var O;_!==n||u!==0&&_.nodeType!==3||(h=r+u),_!==s||l!==0&&_.nodeType!==3||(b=r+l),_.nodeType===3&&(r+=_.nodeValue.length),(O=_.firstChild)!==null;)A=_,_=O;for(;;){if(_===t)break e;if(A===n&&++N===u&&(h=r),A===s&&++x===l&&(b=r),(O=_.nextSibling)!==null)break;_=A,A=_.parentNode}_=O}n=h===-1||b===-1?null:{start:h,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(ac={focusedElem:t,selectionRange:n},Qi=!1,Lt=e;Lt!==null;)if(e=Lt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Lt=t;else for(;Lt!==null;){switch(e=Lt,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),Qt(s,l,n),s[Vt]=t,Ct(s),l=s;break t;case"link":var r=jd("link","href",u).get(l+(n.href||""));if(r){for(var h=0;hvt&&(r=vt,vt=X,X=r);var k=_o(h,X),T=_o(h,vt);if(k&&T&&(O.rangeCount!==1||O.anchorNode!==k.node||O.anchorOffset!==k.offset||O.focusNode!==T.node||O.focusOffset!==T.offset)){var E=_.createRange();E.setStart(k.node,k.offset),O.removeAllRanges(),X>vt?(O.addRange(E),O.extend(T.node,T.offset)):(E.setEnd(T.node,T.offset),O.addRange(E))}}}}for(_=[],O=h;O=O.parentNode;)O.nodeType===1&&_.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<_.length;h++){var D=_[h];D.element.scrollLeft=D.left,D.element.scrollTop=D.top}}Qi=!!lc,ac=lc=null}finally{dt=u,B.p=l,M.T=n}}t.current=e,Ut=2}}function Wr(){if(Ut===2){Ut=0;var t=yn,e=El,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=M.T,M.T=null;var l=B.p;B.p=2;var u=dt;dt|=4;try{Er(t,e.alternate,e)}finally{dt=u,B.p=l,M.T=n}}Ut=3}}function Fr(){if(Ut===4||Ut===3){Ut=0,ch();var t=yn,e=El,n=$e,l=qr;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?Ut=5:(Ut=0,El=yn=null,Ir(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(mn=null),fu(n),e=e.stateNode,le&&typeof le.onCommitFiberRoot=="function")try{le.onCommitFiberRoot(Cl,e,void 0,(e.current.flags&128)===128)}catch{}if(l!==null){e=M.T,u=B.p,B.p=2,M.T=null;try{for(var s=t.onRecoverableError,r=0;rn?32:n,M.T=null,n=Gs,Gs=null;var s=yn,r=$e;if(Ut=0,El=yn=null,$e=0,(dt&6)!==0)throw Error(o(331));var h=dt;if(dt|=4,wr(s.current),Mr(s,s.current,r,n),dt=h,Sa(0,!1),le&&typeof le.onPostCommitFiberRoot=="function")try{le.onPostCommitFiberRoot(Cl,s)}catch{}return!0}finally{B.p=u,M.T=l,Ir(t,e)}}function td(t,e,n){e=pe(n,e),e=ks(t.stateNode,e,2),t=on(t,e,2),t!==null&&(Hl(t,2),_e(t))}function mt(t,e,n){if(t.tag===3)td(t,t,n);else for(;e!==null;){if(e.tag===3){td(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(mn===null||!mn.has(l))){t=pe(n,t),n=er(2),l=on(e,n,2),l!==null&&(nr(n,l,e,t),Hl(l,2),_e(l));break}}e=e.return}}function Zs(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new wg;var u=new Set;l.set(e,u)}else u=l.get(e),u===void 0&&(u=new Set,l.set(e,u));u.has(n)||(Ls=!0,u.add(n),t=Lg.bind(null,t,e,n),e.then(t,t))}function Lg(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,St===t&&(at&n)===n&&(Nt===4||Nt===3&&(at&62914560)===at&&300>ne()-Oi?(dt&2)===0&&Nl(t,0):Hs|=n,zl===at&&(zl=0)),_e(t)}function ed(t,e){e===0&&(e=Zc()),t=_n(t,e),t!==null&&(Hl(t,e),_e(t))}function Hg(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),ed(t,n)}function Vg(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(e),ed(t,n)}function Yg(t,e){return uu(t,e)}var wi=null,Ol=null,Js=!1,Ui=!1,$s=!1,vn=0;function _e(t){t!==Ol&&t.next===null&&(Ol===null?wi=Ol=t:Ol=Ol.next=t),Ui=!0,Js||(Js=!0,Xg())}function Sa(t,e){if(!$s&&Ui){$s=!0;do for(var n=!1,l=wi;l!==null;){if(t!==0){var u=l.pendingLanes;if(u===0)var s=0;else{var r=l.suspendedLanes,h=l.pingedLanes;s=(1<<31-ae(42|t)+1)-1,s&=u&~(r&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,id(l,s))}else s=at,s=La(l,l===St?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Ll(l,s)||(n=!0,id(l,s));l=l.next}while(n);$s=!1}}function Gg(){nd()}function nd(){Ui=Js=!1;var t=0;vn!==0&&tm()&&(t=vn);for(var e=ne(),n=null,l=wi;l!==null;){var u=l.next,s=ld(l,e);s===0?(l.next=null,n===null?wi=u:n.next=u,u===null&&(Ol=n)):(n=l,(t!==0||(s&3)!==0)&&(Ui=!0)),l=u}Ut!==0&&Ut!==5||Sa(t),vn!==0&&(vn=0)}function ld(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,u=t.expirationTimes,s=t.pendingLanes&-62914561;0h)break;var x=b.transferSize,_=b.initiatorType;x&&hd(_)&&(b=b.responseEnd,r+=x*(b"u"?null:document;function Nd(t,e,n){var l=xl;if(l&&typeof e=="string"&&e){var u=me(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Ed.has(u)||(Ed.add(u),t={rel:t,crossOrigin:n,href:e},l.querySelector(u)===null&&(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function om(t){We.D(t),Nd("dns-prefetch",t,null)}function fm(t,e){We.C(t,e),Nd("preconnect",t,e)}function rm(t,e,n){We.L(t,e,n);var l=xl;if(l&&t&&e){var u='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+me(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+me(n.imageSizes)+'"]')):u+='[href="'+me(t)+'"]';var s=u;switch(e){case"style":s=jl(t);break;case"script":s=Dl(t)}ze.has(s)||(t=j({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),ze.set(s,t),l.querySelector(u)!==null||e==="style"&&l.querySelector(Ea(s))||e==="script"&&l.querySelector(Na(s))||(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function dm(t,e){We.m(t,e);var n=xl;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+me(l)+'"][href="'+me(t)+'"]',s=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Dl(t)}if(!ze.has(s)&&(t=j({rel:"modulepreload",href:t},e),ze.set(s,t),n.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Na(s)))return}l=n.createElement("link"),Qt(l,"link",t),Ct(l),n.head.appendChild(l)}}}function hm(t,e,n){We.S(t,e,n);var l=xl;if(l&&t){var u=Fn(l).hoistableStyles,s=jl(t);e=e||"default";var r=u.get(s);if(!r){var h={loading:0,preload:null};if(r=l.querySelector(Ea(s)))h.loading=5;else{t=j({rel:"stylesheet",href:t,"data-precedence":e},n),(n=ze.get(s))&&rc(t,n);var b=r=l.createElement("link");Ct(b),Qt(b,"link",t),b._p=new Promise(function(N,x){b.onload=N,b.onerror=x}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Hi(r,e,l)}r={type:"stylesheet",instance:r,count:1,state:h},u.set(s,r)}}}function gm(t,e){We.X(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function mm(t,e){We.M(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0,type:"module"},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function Ad(t,e,n,l){var u=(u=Ie.current)?Li(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=jl(n.href),n=Fn(u).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=jl(n.href);var s=Fn(u).hoistableStyles,r=s.get(t);if(r||(u=u.ownerDocument||u,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,r),(s=u.querySelector(Ea(t)))&&!s._p&&(r.instance=s,r.state.loading=5),ze.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ze.set(t,n),s||ym(u,t,n,r.state))),e&&l===null)throw Error(o(528,""));return r}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Dl(n),n=Fn(u).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function jl(t){return'href="'+me(t)+'"'}function Ea(t){return'link[rel="stylesheet"]['+t+"]"}function Od(t){return j({},t,{"data-precedence":t.precedence,precedence:null})}function ym(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),Qt(e,"link",n),Ct(e),t.head.appendChild(e))}function Dl(t){return'[src="'+me(t)+'"]'}function Na(t){return"script[async]"+t}function xd(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+me(n.href)+'"]');if(l)return e.instance=l,Ct(l),l;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ct(l),Qt(l,"style",u),Hi(l,n.precedence,t),e.instance=l;case"stylesheet":u=jl(n.href);var s=t.querySelector(Ea(u));if(s)return e.state.loading|=4,e.instance=s,Ct(s),s;l=Od(n),(u=ze.get(u))&&rc(l,u),s=(t.ownerDocument||t).createElement("link"),Ct(s);var r=s;return r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),e.state.loading|=4,Hi(s,n.precedence,t),e.instance=s;case"script":return s=Dl(n.src),(u=t.querySelector(Na(s)))?(e.instance=u,Ct(u),u):(l=n,(u=ze.get(s))&&(l=j({},n),dc(l,u)),t=t.ownerDocument||t,u=t.createElement("script"),Ct(u),Qt(u,"link",l),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,Hi(l,n.precedence,t));return e.instance}function Hi(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,s=u,r=0;r title"):null)}function pm(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Md(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function vm(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=jl(l.href),s=e.querySelector(Ea(u));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Yi.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,Ct(s);return}s=e.ownerDocument||e,l=Od(l),(u=ze.get(u))&&rc(l,u),s=s.createElement("link"),Ct(s);var r=s;r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Yi.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var hc=0;function bm(t,e){return t.stylesheets&&t.count===0&&Xi(t,t.stylesheets),0hc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Yi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xi(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Gi=null;function Xi(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gi=new Map,e.forEach(Sm,t),Gi=null,Yi.call(t))}function Sm(t,e){if(!(e.state.loading&4)){var n=Gi.get(t);if(n)var l=n.get(null);else{n=new Map,Gi.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y)}catch(a){console.error(a)}}return y(),Sc.exports=Gm(),Sc.exports}var Qm=Xm();class Km extends W{constructor(){super("avalanche.operator.Empty",[])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poszc},{no:6,name:"run_id",kind:"scalar",T:9},{no:7,name:"workflow_selector",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.flowName="",i.inputJson="",i.contextJson="",i.inputFiles=[],i.runId="",i.workflowSelector="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:3,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.agentMetadataJson={},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:5,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"cron",kind:"scalar",T:9},{no:8,name:"next_run_at",kind:"scalar",T:1},{no:9,name:"last_run_at",kind:"scalar",T:1},{no:10,name:"workflow_id",kind:"scalar",T:9},{no:11,name:"display_name",kind:"scalar",T:9},{no:12,name:"root_alias",kind:"scalar",T:9},{no:13,name:"relative_file",kind:"scalar",T:9},{no:14,name:"builder_symbol",kind:"scalar",T:9},{no:15,name:"agent_node_ids",kind:"scalar",repeat:2,T:9},{no:16,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:17,name:"webhook_path",kind:"scalar",T:9},{no:18,name:"webhook_url",kind:"scalar",T:9},{no:19,name:"webhook_active",kind:"scalar",T:8}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.name="",i.filePath="",i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.cron="",i.nextRunAt=0,i.lastRunAt=0,i.workflowId="",i.displayName="",i.rootAlias="",i.relativeFile="",i.builderSymbol="",i.agentNodeIds=[],i.agentMetadataJson={},i.webhookPath="",i.webhookUrl="",i.webhookActive=!1,a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posEc},{no:5,name:"scan_targets",kind:"message",repeat:2,T:()=>Ac},{no:6,name:"diagnostics",kind:"message",repeat:2,T:()=>Nc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.revision="0",i.workflows=[],i.scanTargets=[],i.diagnostics=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posOc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.valueJson="",i.files=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posxc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.status="",i.revision="0",i.available=!1,i.complete=!1,i.eventCount="0",i.sizeBytes="0",i.latestEventSequence="0",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl},{no:8,name:"revision",kind:"scalar",T:4},{no:9,name:"event_page_token",kind:"scalar",T:9},{no:10,name:"error",kind:"scalar",opt:!0,T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeId="",i.name="",i.nodeType="",i.status="",i.startedAt=0,i.endedAt=0,i.revision="0",i.eventPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:5,name:"latest_log_sequence",kind:"scalar",T:4},{no:6,name:"log_page_token",kind:"scalar",T:9},{no:7,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.nodes=[],i.latestLogSequence="0",i.logPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.logs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql},{no:6,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runId="",i.nodeId="",i.events=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:2,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:3,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodes=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posPi}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posjc},{no:3,name:"run_status_changed",kind:"message",oneof:"change",T:()=>Dc},{no:4,name:"node_status_changed",kind:"message",oneof:"change",T:()=>Mc},{no:5,name:"log_appended",kind:"message",oneof:"change",T:()=>_c},{no:6,name:"agent_event_appended",kind:"message",oneof:"change",T:()=>Rc},{no:7,name:"trace_finalized",kind:"message",oneof:"change",T:()=>wc},{no:8,name:"catalog_replaced",kind:"message",oneof:"change",T:()=>Uc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.sequence="0",i.change={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBc},{no:3,name:"reset_required",kind:"message",oneof:"payload",T:()=>qc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.payload={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posawait this.client.getRunSnapshot({runId:g.runId,operatorInstanceId:f,asOfSequence:c}).response)),d=await this.getCatalog();if(a.operatorInstanceId!==f||d.operatorInstanceId!==f||a.revision!==d.revision||BigInt(a.asOfSequence)>BigInt(c)||BigInt(d.asOfSequence)d.nodeId===i);if(!o?.eventPageToken)return[];const f=[];let c=o.eventPageToken,v="0";do{const d=await this.client.listAgentEvents({pageToken:c,afterEventSequence:v,pageSize:100}).response;f.push(...d.events),d.events.length&&(v=d.events.at(-1).eventSequence),c=d.nextPageToken}while(c);return f}async listLogs(a){if(!a.logPageToken)return[];const i=[];let o=a.logPageToken,f="0";do{const c=await this.client.listLogs({pageToken:o,afterSequence:f,pageSize:100}).response;i.push(...c.logs),c.logs.length&&(f=c.logs.at(-1).sequence),o=c.nextPageToken}while(o);return i}async readDetail(a){const i=[];for await(const v of this.client.readDetail({bodyToken:a}).responses)i.push(v.data);const o=i.reduce((v,d)=>v+d.length,0),f=new Uint8Array(o);let c=0;for(const v of i)f.set(v,c),c+=v.length;return JSON.parse(new TextDecoder().decode(f))}async startRun(a,i){return(await this.client.startRun({flowName:"",workflowSelector:a,runId:"",inputJson:i===void 0?"":JSON.stringify(i),contextJson:"",inputFiles:[]}).response).runId}async cancelRun(a){await this.client.cancelRun({runId:a}).response}}function np(y){return y==="success"?"✓":y==="failed"?"!":y==="running"?"●":"·"}function lp({workflow:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState(!0);return p.jsxs("div",{className:"workflow-branch",children:[p.jsxs("div",{className:"tree-row",children:[p.jsx("button",{type:"button",className:"tree-disclosure",onClick:()=>c(v=>!v),"aria-label":`${f?"Collapse":"Expand"} ${y.displayName}`,children:f?"⌄":"›"}),p.jsxs("button",{type:"button",className:i?.kind==="workflow"&&i.workflowId===y.workflowId?"tree-select active":"tree-select",onClick:()=>o({kind:"workflow",workflowId:y.workflowId}),children:[p.jsx("span",{className:"workflow-glyph",children:"◇"}),p.jsxs("span",{children:[p.jsx("strong",{children:y.displayName}),p.jsx("small",{children:y.relativeFile})]})]})]}),f&&p.jsxs("div",{className:"run-branches",children:[a.map(v=>{const d=v.summary;return p.jsxs("button",{type:"button",className:i?.kind==="run"&&i.runId===d.runId?"run-select active":"run-select",onClick:()=>o({kind:"run",workflowId:y.workflowId,runId:d.runId}),children:[p.jsx("span",{className:`run-dot status-${d.status}`,children:np(d.status)}),p.jsxs("span",{children:[p.jsx("strong",{children:d.runId}),p.jsx("small",{children:d.startedAt?`Created at sequence ${d.createdSequence}`:"Awaiting start"})]})]},d.runId)}),!a.length&&p.jsx("span",{className:"no-runs",children:"No runs yet"})]})]})}function ap(y,a){return y.workflows.filter(i=>i.rootAlias===a.alias)}function ip({catalog:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState({});if(!y)return p.jsxs("aside",{className:"explorer skeleton","aria-label":"Explorer",children:[p.jsx("div",{}),p.jsx("div",{}),p.jsx("div",{})]});const v=y.scanTargets.length?y.scanTargets:[{alias:"workflows",targetPath:"Configured workflows",kind:"directory"}];return p.jsxs("aside",{className:"explorer","aria-label":"Explorer",children:[p.jsxs("header",{children:[p.jsx("span",{className:"eyebrow",children:"Navigator"}),p.jsx("h2",{children:"Explorer"}),p.jsxs("span",{className:"catalog-revision",children:["catalog r",y.revision]})]}),y.diagnostics.length>0&&p.jsxs("details",{className:"diagnostics",open:!0,children:[p.jsxs("summary",{children:[y.diagnostics.length," reload issue",y.diagnostics.length===1?"":"s"]}),y.diagnostics.map(d=>p.jsxs("div",{children:[p.jsx("strong",{children:d.kind.replaceAll("_"," ")}),p.jsx("span",{children:d.path}),p.jsx("p",{children:d.message})]},`${d.path}-${d.kind}`))]}),p.jsx("div",{className:"target-list",children:v.map(d=>{const g=d.alias==="workflows"?y.workflows:ap(y,d),m=!!f[d.alias];return p.jsxs("section",{className:"target",children:[p.jsxs("button",{type:"button",className:"target-heading",onClick:()=>c(z=>{const j={...z};return j[d.alias]?delete j[d.alias]:j[d.alias]=!0,j}),children:[p.jsx("span",{children:m?"›":"⌄"}),p.jsx("span",{className:"target-kind",children:d.kind==="file"?"F":"D"}),p.jsxs("span",{children:[p.jsx("strong",{children:d.alias}),p.jsx("small",{title:d.targetPath,children:d.targetPath})]})]}),!m&&p.jsx("div",{className:"workflow-list",children:g.map(z=>p.jsx(lp,{workflow:z,runs:Object.values(a).filter(j=>j.summary?.workflowId===z.workflowId).sort((j,R)=>Number(R.summary.createdSequence)-Number(j.summary.createdSequence)),selection:i,onSelect:o},z.workflowId))})]},d.alias)})})]})}function Kn(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function Id(y){return Array.isArray(y)?y.flatMap(a=>!Kn(a)||typeof a.name!="string"?[]:[{name:a.name,type:typeof a.type=="string"?a.type:void 0,description:typeof a.description=="string"?a.description:void 0}]):[]}function eh(y){if(y)try{const a=JSON.parse(y);if(!Kn(a))return;const i=Kn(a.signature)?a.signature:{};return{instructions:typeof i.instructions=="string"?i.instructions:"",inputs:Id(i.inputs),outputs:Id(i.outputs),model:a.models,runtime:a.runtime,skills:a.skills,tools:a.tools}}catch{return}}const nh=J.memo(({data:y})=>p.jsxs("button",{type:"button",className:`node-card ${y.status?`status-${y.status}`:"blueprint"}`,onClick:y.onOpen,"aria-label":`Inspect ${y.label}`,children:[p.jsx(Qd,{type:"target",position:Kd.Left,isConnectable:!1}),p.jsx("span",{className:"node-kicker",children:y.nodeType}),p.jsx("strong",{children:y.label}),y.status&&p.jsx("span",{className:"node-status",children:y.status}),y.duration&&p.jsx("span",{className:"node-duration",children:y.duration}),y.error&&p.jsx("span",{className:"node-error",children:y.error}),y.declaration&&p.jsxs("span",{className:"field-grid",children:[p.jsxs("span",{children:[p.jsx("small",{children:"Inputs"}),y.declaration.inputs.map(a=>p.jsx("span",{className:"field",children:a.name},`input-${a.name}`))]}),p.jsxs("span",{children:[p.jsx("small",{children:"Outputs"}),y.declaration.outputs.map(a=>p.jsx("span",{className:"field",children:a.name},`output-${a.name}`))]})]}),p.jsx(Qd,{type:"source",position:Kd.Right,isConnectable:!1})]}));nh.displayName="WorkflowNodeCard";function up(y){const a=Object.fromEntries(y.nodeIds.map(c=>[c,0]));for(const c of Object.values(y.graph))for(const v of c.children)a[v]=(a[v]??0)+1;const i={},o=y.nodeIds.filter(c=>a[c]===0);for(const c of o)i[c]=0;for(let c=0;cv.map((d,g)=>[d,{x:Number(c)*330,y:g*220-(v.length-1)*110}])))}function sp(y){if(!y.startedAt)return;const a=y.endedAt||Date.now()/1e3,i=Math.max(0,a-y.startedAt);return i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m`}function cp({workflow:y,runTopology:a,runNodes:i=[],onOpenNode:o}){const f=J.useMemo(()=>{if(a)return a;if(y)return{nodeIds:y.nodeIds,graph:y.graph,nodeTypes:y.nodeTypes,displayNames:y.displayNames,agentMetadataJson:y.agentMetadataJson}},[a,y]),c=J.useMemo(()=>{if(!f)return{nodes:[],edges:[]};const v=up(f),d=Object.fromEntries(i.map(j=>[j.nodeId,j])),g=f.nodeIds.map(j=>{const R=d[j];return{id:j,type:"workflow",position:v[j],data:{label:f.displayNames[j]||R?.name||j,nodeType:f.nodeTypes[j]||R?.nodeType||"step",status:R?.status,error:R?.error,duration:R?sp(R):void 0,declaration:eh(a?a.agentMetadataJson[j]:y?.agentMetadataJson[j]),onOpen:()=>o(j)}}}),m=new Set,z=[];for(const[j,R]of Object.entries(f.graph))for(const C of R.children){const Y=`${j}->${C}`;m.has(Y)||(m.add(Y),z.push({id:Y,source:j,target:C,markerEnd:{type:Mm.ArrowClosed},className:"dag-edge"}))}return{nodes:g,edges:z}},[o,i,a,f,y]);return p.jsxs(_m,{nodes:c.nodes,edges:c.edges,nodeTypes:{workflow:nh},fitView:!0,fitViewOptions:{padding:.24},minZoom:.25,maxZoom:1.8,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[p.jsx(Rm,{color:"rgba(255,255,255,.06)",gap:24,size:1}),p.jsx(wm,{showInteractive:!1})]})}function op(y,a,i){const o=new Array(y);return new Proxy(o,{get(f,c,v){if(typeof c=="string"){const d=c.charCodeAt(0);if(d>=48&&d<=57){const g=+c;if(Number.isInteger(g)&&g>=0&&go[z]!==m))&&(o=d,f=a(...d),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(f),c=!1),f}return v.updateDeps=d=>{o=d},v}function Pd(y,a){if(y===void 0)throw new Error("Unexpected undefined");return y}const fp=(y,a)=>Math.abs(y-a)<1.01,rp=(y,a,i)=>{let o;return function(...f){y.clearTimeout(o),o=y.setTimeout(()=>a.apply(this,f),i)}};let Ma;const Lc=()=>{if(Ma!==void 0)return Ma;if(typeof navigator>"u")return Ma=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ma=!0;const y=navigator.maxTouchPoints;return Ma=navigator.platform==="MacIntel"&&y!==void 0&&y>0},th=y=>{const{offsetWidth:a,offsetHeight:i}=y;return{width:a,height:i}},dp=y=>y,hp=y=>{const a=Math.max(y.startIndex-y.overscan,0),o=Math.min(y.endIndex+y.overscan,y.count-1)-a+1,f=new Array(o);for(let c=0;c{const i=y.scrollElement;if(!i)return;const o=y.targetWindow;if(!o)return;const f=v=>{const{width:d,height:g}=v;a({width:Math.round(d),height:Math.round(g)})};if(f(th(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(v=>{const d=()=>{const g=v[0];if(g?.borderBoxSize){const m=g.borderBoxSize[0];if(m){f({width:m.inlineSize,height:m.blockSize});return}}f(th(i))};y.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},tu={passive:!0},mp=typeof window>"u"?!0:"onscrollend"in window,yp=(y,a,i)=>{const o=y.scrollElement;if(!o)return;const f=y.targetWindow;if(!f)return;const c=y.options.useScrollendEvent&∓let v=0;const d=c?null:rp(f,()=>a(v,!1),y.options.isScrollingResetDelay),g=j=>()=>{v=i(o),d?.(),a(v,j)},m=g(!0),z=g(!1);return o.addEventListener("scroll",m,tu),c&&o.addEventListener("scrollend",z,tu),()=>{o.removeEventListener("scroll",m),c&&o.removeEventListener("scrollend",z)}},pp=(y,a)=>yp(y,a,i=>{const{horizontal:o,isRtl:f}=y.options;return o?i.scrollLeft*(f&&-1||1):i.scrollTop}),vp=(y,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(y),f=i.options.getItemKey(o);return i.itemSizeCache.get(f)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(y),f=i.options.getItemKey(o),c=i.itemSizeCache.get(f);if(c!==void 0)return c}return y[i.options.horizontal?"offsetWidth":"offsetHeight"]},bp=(y,{adjustments:a=0,behavior:i},o)=>{var f,c;(c=(f=o.scrollElement)==null?void 0:f.scrollTo)==null||c.call(f,{[o.options.horizontal?"left":"top"]:y+a,behavior:i})},Sp=bp;class Tp{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,f;return((f=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:f.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(f=>{f.forEach(c=>{const v=()=>{const d=c.target,g=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,z]of this.elementsCache)if(z===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(d,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(v):v()})}));return{disconnect:()=>{var f;(f=o())==null||f.disconnect(),i=null},observe:f=>{var c;return(c=o())==null?void 0:c.observe(f,{box:"border-box"})},unobserve:f=>{var c;return(c=o())==null?void 0:c.unobserve(f)}}})(),this.range=null,this.setOptions=i=>{var o,f;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:dp,rangeExtractor:hp,onChange:()=>{},measureElement:vp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const R in i){const C=i[R];C!==void 0&&(c[R]=C)}const v=this.options;let d=null,g=null,m=!1;if(v!==void 0&&v.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const R=v.count,C=c.count,Y=this.getMeasurements(),G=R>0?((o=Y[0])==null?void 0:o.key)??v.getItemKey(0):null,ut=R>0?((f=Y[R-1])==null?void 0:f.key)??v.getItemKey(R-1):null;if(C!==R||R>0&&C>0&&(c.getItemKey(0)!==G||c.getItemKey(C-1)!==ut)){m=!0;const tt=R>0?this.getVirtualItemForOffset(this.getScrollOffset())??Y[0]:null;tt&&(d=[tt.key,this.getScrollOffset()-tt.start]);const ht=c.followOnAppend===!0?"auto":c.followOnAppend||null;ht&&C>R&&this.isAtEnd(v.scrollEndThreshold)&&(R===0||c.getItemKey(C-1)!==ut)&&(g=ht)}}this.options=c,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let z=!1,j=0;if(d&&this.scrollOffset!==null){const[R,C]=d,Y=this.getMeasurements(),{count:G,getItemKey:ut}=this.options;let K=0;for(;K{var o,f;(f=(o=this.options).onChange)==null||f.call(o,this,i)},this.maybeNotify=_l(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,v)=>{if(v&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=v?d===c?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Lc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",v,tu),c.addEventListener("touchend",d,tu),this.unsubs.push(()=>{c.removeEventListener("touchstart",v),c.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const f=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,f&&this.scrollElement&&this.options.enabled){const[c,v,d,g]=f;c!==null&&!d&&(Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?g!==0&&(this._iosDeferredAdjustment+=g):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const f=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=f,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=_l(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,f,c,v,d,g,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m}),{key:!1}),this.getMeasurements=_l(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m},z)=>{const j=this.itemSizeCache;if(!v)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const K of this.laneAssignments.keys())K>=i&&this.laneAssignments.delete(K);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(K=>{this.itemSizeCache.set(K.key,K.size)}));const R=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),d===1){const K=i*2;let Z=this._flatMeasurements;if(!Z||Z.length0&<.set(Z.subarray(0,R*2)),Z=lt,this._flatMeasurements=Z}let tt;if(R===0)tt=o+f;else{const lt=R-1;tt=Z[lt*2]+Z[lt*2+1]+m}for(let lt=R;lt1){ht=tt;const Kt=Y[ht],At=Kt!==void 0?C[Kt]:void 0;lt=At?At.end+m:o+f}else if(ut===d){let Kt=0,At=G[0],Ht=Y[0];for(let Jt=1;Jtthis.options.debug}),this.calculateRange=_l(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,f,c)=>i.length===0||o===0?(this.range=null,null):(this.range=zp(i,o,f,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=_l(()=>{let i=null,o=null;const f=this.calculateRange();return f&&(i=f.startIndex,o=f.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,f,c,v)=>c===null||v===null?[]:i({startIndex:c,endIndex:v,overscan:o,count:f}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,f=i.getAttribute(o);return f?parseInt(f,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const f=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(f!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),v=Math.max(0,f-c),d=Math.min(this.options.count-1,f+c);return i>=v&&i<=d}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((v,d)=>{v.isConnected||(this.observer.unobserve(v),this.elementsCache.delete(d))});return}const o=this.indexFromElement(i),f=this.options.getItemKey(o),c=this.elementsCache.get(f);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(f,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var f,c;if(i<0||i>=this.options.count)return;let v,d,g;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)g=this.options.getItemKey(i),d=m[i*2],v=m[i*2+1];else{const R=this.measurementsCache[i];if(!R)return;g=R.key,d=R.start,v=R.size}const z=this.itemSizeCache.get(g)??v,j=o-z;if(j!==0){const R=this.options.anchorTo==="end"&&((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,C=R?this.getTotalSize():0,Y=this.getScrollOffset()+this.scrollAdjustments,ut=!this.itemSizeCache.has(g)?d[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const f=[];for(let c=0,v=i.length;cthis.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const f=this._flatMeasurements,c=this.options.lanes===1&&f!=null,v=lh(0,o.length-1,c?d=>f[d*2]:d=>Pd(o[d]).start,i);return Pd(o[v])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,f=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),v=this.getScrollOffset();o==="auto"&&(o=i>=v+c?"end":"start"),o==="center"?i+=(f-c)/2:o==="end"&&(i-=c);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const f=this.getSize(),c=this.getScrollOffset(),v=this.measurementsCache[i];if(!v)return;if(o==="auto")if(v.end>=c+f-this.options.scrollPaddingEnd)o="end";else if(v.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?v.end+this.options.scrollPaddingEnd:v.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,v.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),v=this.now();this.scrollState={index:null,align:o,behavior:f,startedAt:v,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[v,d]=c,g=this.now();this.scrollState={index:i,align:d,behavior:f,startedAt:g,lastTargetOffset:v,stableFrames:0},this._scrollToOffset(v,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const f=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let f;if(o.length===0)f=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,v=this._flatMeasurements;v!=null?f=v[c*2]+v[c*2+1]:f=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let v=o.length-1;for(;v>=0&&c.some(d=>d===null);){const d=o[v];c[d.lane]===null&&(c[d.lane]=d.end),v--}f=Math.max(...c.filter(d=>d!==null))}return Math.max(f-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const f of o)f&&this.itemSizeCache.has(f.key)&&i.push({index:f.index,key:f.key,start:f.start,size:f.size,end:f.end,lane:f.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:f})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:f,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,f=o?o[0]:this.scrollState.lastTargetOffset,c=1,v=f!==this.scrollState.lastTargetOffset;if(!v&&fp(f,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==f&&this._scrollToOffset(f,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,v){const d=this.getSize()||600,g=Math.abs(f-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&g>d;this.scrollState.lastTargetOffset=f,m||(this.scrollState.behavior="auto"),this._scrollToOffset(f,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const lh=(y,a,i,o)=>{for(;y<=a;){const f=(y+a)/2|0,c=i(f);if(co)a=f-1;else return f}return y>0?y-1:0};function kp(y,a,i){let o=0;for(;o<=a;){const f=(o+a)/2|0,c=y[f*2];if(ci)a=f-1;else return f}return o>0?o-1:0}function zp(y,a,i,o,f){const c=y.length-1;if(y.length<=o)return{startIndex:0,endIndex:c};if(o===1&&f!==null){const m=kp(f,c,i);let z=m;const j=i+a;for(;zy[m].start,i),g=d;if(o===1)for(;g1){const m=Array(o).fill(0);for(;gj=0&&z.some(j=>j>=i);){const j=y[d];z[j.lane]=j.start,d--}d=Math.max(0,d-d%o),g=Math.min(c,g+(o-1-g%o))}return{startIndex:d,endIndex:g}}const Hc=typeof document<"u"?J.useLayoutEffect:J.useEffect;function Ep({useFlushSync:y=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const f=J.useReducer(z=>z+1,0)[1],c=J.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const v=z=>{const j=c.current;if(!j.enabled||!j.container)return;const R=z.getTotalSize();if(R!==j.lastSize){j.lastSize=R;const C=z.options.horizontal?"width":"height";j.container.style[C]=`${R}px`}},d=z=>{const j=c.current;if(!j.enabled||!j.container)return;v(z);const R=!!z.options.horizontal,C=j.mode==="transform",Y=R?"left":"top",G=z.options.scrollMargin,ut=z.getVirtualItems();for(const K of ut){const Z=K.start-G,tt=z.elementsCache.get(K.key);tt&&j.lastPositions.get(tt)!==Z&&(j.lastPositions.set(tt,Z),C?tt.style.transform=R?`translate3d(${Z}px, 0, 0)`:`translate3d(0, ${Z}px, 0)`:tt.style[Y]=`${Z}px`)}},g={...o,onChange:(z,j)=>{var R;const C=c.current;let Y=!0;if(C.enabled){d(z);const G=z.range,ut=C.prevRange;Y=!ut||ut.isScrolling!==z.isScrolling||ut.startIndex!==G?.startIndex||ut.endIndex!==G?.endIndex,Y&&(C.prevRange=G?{startIndex:G.startIndex,endIndex:G.endIndex,isScrolling:z.isScrolling}:null)}Y&&(y&&j?Um.flushSync(f):f()),(R=o.onChange)==null||R.call(o,z,j)}},[m]=J.useState(()=>{const z=new Tp(g);return Object.assign(z,{containerRef:j=>{const R=c.current;if(R.container=j,R.lastSize=null,j&&R.enabled){const C=z.getTotalSize();R.lastSize=C;const Y=z.options.horizontal?"width":"height";j.style[Y]=`${C}px`}}})});return m.setOptions(g),Hc(()=>m._didMount(),[]),Hc(()=>(v(m),m._willUpdate())),Hc(()=>{d(m)}),m}function Np(y){return Ep({observeElementRect:gp,observeElementOffset:pp,scrollToFn:Sp,...y})}function Qn({value:y,depth:a=0}){return y===null?p.jsx("span",{className:"value-null",children:"null"}):typeof y=="string"?p.jsx("span",{className:"value-string",children:y}):typeof y=="number"||typeof y=="boolean"?p.jsx("span",{className:"value-scalar",children:String(y)}):Array.isArray(y)?p.jsx("ol",{className:"value-list",children:y.map((i,o)=>p.jsx("li",{children:p.jsx(Qn,{value:i,depth:a+1})},`${a}-${o}`))}):Kn(y)?y.kind==="predict_rlm_file"&&typeof y.path=="string"?p.jsxs("span",{className:"file-value",title:"Reported host path; contents are not copied",children:[p.jsx("span",{"aria-hidden":"true",children:"↗"}),p.jsxs("span",{children:[p.jsx("small",{children:"PredictRLM file"}),p.jsx("code",{children:y.path})]})]}):y.kind==="unavailable"&&typeof y.reason=="string"?p.jsxs("span",{className:"value-unavailable",children:["Unavailable · ",y.reason]}):p.jsx("dl",{className:"value-object",children:Object.entries(y).map(([i,o])=>p.jsxs("div",{children:[p.jsx("dt",{children:i}),p.jsx("dd",{children:p.jsx(Qn,{value:o,depth:a+1})})]},i))}):p.jsx("span",{className:"value-unavailable",children:"Unavailable"})}const Ap=[],Op=[];function Vc({value:y}){return p.jsx("pre",{className:"json-block",children:JSON.stringify(y,null,2)})}function xp(y){if(Kn(y))return Kn(y.data)?y.data:y}function jp({api:y,workflow:a,run:i,nodeId:o,liveEvents:f=Ap,liveLogs:c=Op,onClose:v}){const[d,g]=J.useState("overview"),[m,z]=J.useState([]),[j,R]=J.useState([]),[C,Y]=J.useState(),[G,ut]=J.useState(),[K,Z]=J.useState(),[tt,ht]=J.useState(!0),lt=J.useRef(new Map),Bt=J.useRef(null),$=i?.nodes.find(w=>w.nodeId===o),jt=i?i.topology?.agentMetadataJson[o??""]:a?.agentMetadataJson[o??""],Dt=jt?eh(jt):void 0;J.useEffect(()=>{if(g("overview"),z([]),R([]),Y(void 0),ut(void 0),ht(!0),lt.current.clear(),!i||!o)return;let w=!0;return Promise.all([y.listAgentEvents(i,o),y.listLogs(i)]).then(([H,bt])=>{w&&(z(H),R(bt.filter(ct=>!ct.nodeId||ct.nodeId===o)))}).catch(H=>{w&&Z(H instanceof Error?H.message:"Details unavailable")}),()=>{w=!1}},[y,o,i]);const Kt=J.useMemo(()=>{const w=new Map;for(const H of[...m,...f])w.set(H.eventSequence,H);return[...w.values()].sort((H,bt)=>Number(H.eventSequence)-Number(bt.eventSequence))},[m,f]),At=Kt.filter(w=>w.eventKind==="iteration.recorded"),Ht=J.useMemo(()=>{const w=new Map;for(const H of[...j,...c])w.set(H.sequence,H);return[...w.values()].sort((H,bt)=>Number(H.sequence)-Number(bt.sequence))},[c,j]),Jt=J.useMemo(()=>{const w=$?.trace?.header?.usageJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.usageJson]),de=J.useMemo(()=>{const w=$?.trace?.header?.telemetryJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.telemetryJson]),he=d==="inputs"?Dt?.inputs:d==="output"?Dt?.outputs:void 0,M=Np({count:At.length,getScrollElement:()=>Bt.current,estimateSize:()=>64,overscan:6});if(J.useEffect(()=>{!tt||!At.length||Y(At.at(-1).eventSequence)},[tt,At]),J.useEffect(()=>{const w=Kt.find(ct=>ct.eventSequence===C);if(!w?.bodyToken){ut(void 0);return}const H=lt.current.get(w.bodyToken);if(H!==void 0){lt.current.delete(w.bodyToken),lt.current.set(w.bodyToken,H),ut(H);return}let bt=!0;return ut(void 0),Z(void 0),y.readDetail(w.bodyToken).then(ct=>{if(bt){for(lt.current.delete(w.bodyToken),lt.current.set(w.bodyToken,ct);lt.current.size>8;){const ot=lt.current.keys().next().value;if(ot===void 0)break;lt.current.delete(ot)}ut(ct)}}).catch(ct=>{bt&&Z(ct instanceof Error?ct.message:"Detail unavailable")}),()=>{bt=!1}},[y,Kt,C]),J.useEffect(()=>{const w=d==="inputs"?"run.started":d==="output"?"run.succeeded":void 0;if(!w)return;const H=[...Kt].reverse().find(bt=>bt.eventKind===w);H&&Y(H.eventSequence)},[Kt,d]),!i&&a&&o)return p.jsxs("aside",{className:"inspector","aria-label":"Node declaration",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Declaration"}),p.jsx("h2",{children:a.displayNames[o]||o})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),Dt?p.jsxs("div",{className:"inspector-body declaration",children:[p.jsxs("section",{children:[p.jsx("h3",{children:"Instructions"}),p.jsx("p",{className:"instructions",children:Dt.instructions||"No instructions"})]}),p.jsxs("section",{className:"signature-columns",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"Inputs"}),Dt.inputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]}),p.jsxs("div",{children:[p.jsx("h3",{children:"Outputs"}),Dt.outputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Runtime"}),p.jsx(Vc,{value:Dt.runtime})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Models"}),p.jsx(Vc,{value:Dt.model})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Skills & tools"}),p.jsx(Vc,{value:{skills:Dt.skills,tools:Dt.tools}})]})]}):p.jsx("p",{className:"empty-copy",children:"This node has no agent declaration metadata."})]});if(!i||!$)return null;const B=xp(G),Q=d==="inputs"?"inputs":"outputs";return p.jsxs("aside",{className:"inspector","aria-label":"Run inspector",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Historical execution"}),p.jsx("h2",{children:$.name}),p.jsx("span",{className:`status-pill status-${$.status}`,children:$.status})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),p.jsx("nav",{className:"inspector-tabs","aria-label":"Run detail views",children:["overview","inputs","output","trace","logs"].map(w=>p.jsx("button",{type:"button",className:d===w?"active":"",onClick:()=>g(w),children:w},w))}),p.jsxs("div",{className:"inspector-body",children:[K&&p.jsx("p",{className:"error-banner",children:K}),d==="overview"&&p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:"metric-grid",children:[p.jsxs("div",{children:[p.jsx("small",{children:"Status"}),p.jsx("strong",{children:$.status})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Revision"}),p.jsx("strong",{children:$.revision})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Started"}),p.jsx("strong",{children:$.startedAt?"yes":"—"})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Duration"}),p.jsx("strong",{children:$.startedAt&&$.endedAt?`${Math.max(0,$.endedAt-$.startedAt).toFixed(2)}s`:"—"})]})]}),$.error&&p.jsx("p",{className:"node-failure",children:$.error}),$.trace&&p.jsxs("section",{children:[p.jsx("h3",{children:"Trace header"}),p.jsxs("dl",{className:"trace-header",children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Status"}),p.jsx("dd",{children:$.trace.status})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Events"}),p.jsx("dd",{children:$.trace.eventCount})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Size"}),p.jsxs("dd",{children:[$.trace.sizeBytes," B"]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Complete"}),p.jsx("dd",{children:$.trace.complete?"yes":"no"})]}),$.trace.header&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Model"}),p.jsx("dd",{children:$.trace.header.model})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Iterations"}),p.jsxs("dd",{children:[$.trace.header.iterations,"/",$.trace.header.maxIterations]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Duration"}),p.jsxs("dd",{children:[$.trace.header.durationMs," ms"]})]})]})]}),Jt!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Usage"}),p.jsx(Qn,{value:Jt})]}),de!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Telemetry"}),p.jsx(Qn,{value:de})]})]})]}),(d==="inputs"||d==="output")&&p.jsxs("section",{children:[p.jsx("h3",{children:d==="inputs"?"Invocation inputs":"Terminal output"}),he?.length?p.jsxs("div",{className:"declared-fields",children:[p.jsx("small",{children:"Declared fields"}),he.map(w=>p.jsxs("span",{children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type})]},w.name))]}):null,B&&Q in B?p.jsx(Qn,{value:B[Q]}):p.jsxs("p",{className:"empty-copy",children:["No retained ",d," are available."]})]}),d==="trace"&&p.jsxs("section",{className:"trace-layout",children:[p.jsxs("div",{className:"trace-toolbar",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"RunTrace"}),p.jsxs("span",{children:[At.length," complete turns"]})]}),p.jsx("button",{type:"button",className:tt?"toggle active":"toggle",onClick:()=>ht(w=>!w),children:tt?"Following live":"Follow latest"})]}),p.jsx("div",{className:"turn-list",ref:Bt,children:p.jsx("div",{style:{height:M.getTotalSize(),position:"relative"},children:M.getVirtualItems().map(w=>{const H=At[w.index];return p.jsxs("button",{type:"button",className:`turn-row ${C===H.eventSequence?"active":""} ${H.error?"failed":""}`,style:{transform:`translateY(${w.start}px)`},onClick:()=>{ht(!1),Y(H.eventSequence)},children:[p.jsxs("strong",{children:["Turn ",H.iteration??w.index+1]}),p.jsx("span",{children:H.durationMs?`${H.durationMs} ms`:"—"}),p.jsxs("small",{children:[H.toolCount," tools · ",H.predictCount," predicts"]})]},H.eventSequence)})})}),p.jsx("div",{className:"turn-detail",children:G!==void 0?p.jsx(Qn,{value:G}):p.jsx("p",{className:"empty-copy",children:"Select a turn."})})]}),d==="logs"&&p.jsxs("section",{children:[p.jsx("h3",{children:"Node logs"}),p.jsx("div",{className:"log-list",children:Ht.map(w=>p.jsxs("button",{type:"button",onClick:()=>{y.readDetail(w.bodyToken).then(ut).catch(H=>{Z(H instanceof Error?H.message:"Log unavailable")})},children:[p.jsx("span",{className:`log-level level-${w.level}`,children:w.level}),p.jsx("time",{children:new Date(w.timestamp*1e3).toLocaleTimeString()}),p.jsxs("span",{children:["#",w.sequence]})]},w.sequence))}),G!==void 0&&p.jsx(Qn,{value:G})]})]})]})}function Dp({value:y,onChange:a}){const i=J.useRef(null);return J.useEffect(()=>{if(!i.current)return;const o=new Ii({parent:i.current,state:Cm.create({doc:y,extensions:[Lm(),Hm.of([]),Ii.lineWrapping,Ii.theme({"&":{backgroundColor:"#0e1112",color:"#dce4df"},".cm-content":{caretColor:"#eeff8c",minHeight:"110px"},".cm-gutters":{backgroundColor:"#0e1112",color:"#626b67",border:"0"},"&.cm-focused":{outline:"1px solid #778357"}}),Ii.updateListener.of(f=>{f.docChanged&&a(f.state.doc.toString())})]})});return()=>o.destroy()},[]),p.jsx("div",{className:"json-editor",ref:i})}function Mp(y){const a=JSON.parse(y);if(!Kn(a))throw new Error("Run input must be a JSON object");return a}function _p({workflow:y,run:a,pending:i,onStart:o,onCancel:f}){const[c,v]=J.useState(!1),[d,g]=J.useState("{}"),[m,z]=J.useState(),j=a?.summary?.status==="pending"||a?.summary?.status==="running",R=async()=>{if(!y)return;z(void 0);let C;if(c)try{C=Mp(d)}catch(Y){z(Y instanceof Error?Y.message:"Run input is invalid JSON");return}try{await o(y.workflowId,C)}catch(Y){z(Y instanceof Error?Y.message:"Operator rejected the run")}};return p.jsxs("div",{className:"run-controls",children:[y&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"run-button",disabled:i?.kind==="start",onClick:()=>{R()},children:i?.kind==="start"?"Requesting…":"Run"}),p.jsx("button",{type:"button",className:`input-toggle ${c?"active":""}`,onClick:()=>v(C=>!C),children:c?"Hide JSON input":"Add JSON input"})]}),j&&a?.summary&&p.jsx("button",{type:"button",className:"cancel-button",disabled:i?.kind==="cancel",onClick:()=>{z(void 0),f(a.summary.runId).catch(C=>{z(C instanceof Error?C.message:"Cancellation failed")})},children:i?.kind==="cancel"?"Cancelling…":"Cancel run"}),c&&y&&p.jsxs("div",{className:"input-popover",children:[p.jsxs("div",{children:[p.jsx("strong",{children:"Workflow input"}),p.jsx("span",{children:"Schema-blind JSON object"})]}),p.jsx(Dp,{value:d,onChange:g})]}),m&&p.jsx("div",{className:"action-error",children:m})]})}const ah={runs:{},liveEvents:{},liveLogs:{},operatorInstanceId:"",sequence:"0",connection:"connecting"};function Rp(y,a){if(a.type==="baseline"){const g=Object.fromEntries(a.baseline.runs.filter(m=>m.summary).map(m=>[m.summary.runId,m]));return{...ah,catalog:a.baseline.catalog,runs:g,operatorInstanceId:a.baseline.catalog.operatorInstanceId,sequence:a.baseline.asOfSequence,connection:"live"}}if(a.type==="connection")return{...y,connection:a.connection,error:a.error};if(a.type==="action")return{...y,action:a.action};const{envelope:i}=a;if(i.operatorInstanceId!==y.operatorInstanceId)throw new Error("Operator epoch changed");if(i.payload.oneofKind!=="update")throw new Error("Operator requested a structural reset");const o=i.payload.update;if(BigInt(o.sequence)!==BigInt(y.sequence)+1n)throw new Error(`Operator update gap after sequence ${y.sequence}`);const f={...y,sequence:o.sequence,error:void 0},c=o.change;if(c.oneofKind==="catalogReplaced")return c.catalogReplaced.catalog&&(f.catalog=c.catalogReplaced.catalog),f;if(c.oneofKind==="runCreated"&&c.runCreated.summary){const g=c.runCreated.summary;return f.runs={...y.runs,[g.runId]:{operatorInstanceId:y.operatorInstanceId,asOfSequence:o.sequence,summary:g,nodes:c.runCreated.nodes,latestLogSequence:"0",logPageToken:"",topology:c.runCreated.topology}},f}const v=c.oneofKind==="runStatusChanged"?c.runStatusChanged.runId:c.oneofKind==="nodeStatusChanged"?c.nodeStatusChanged.runId:c.oneofKind==="logAppended"?c.logAppended.runId:c.oneofKind==="agentEventAppended"?c.agentEventAppended.runId:c.oneofKind==="traceFinalized"?c.traceFinalized.runId:"",d=y.runs[v];if(!d)throw new Error(`Operator update referenced unknown run ${v}`);if(c.oneofKind==="runStatusChanged"&&d.summary)f.runs={...y.runs,[v]:{...d,summary:{...d.summary,status:c.runStatusChanged.status,startedAt:c.runStatusChanged.startedAt,endedAt:c.runStatusChanged.endedAt,revision:c.runStatusChanged.revision}}};else if(c.oneofKind==="nodeStatusChanged"){const g=c.nodeStatusChanged;f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(m=>m.nodeId===g.nodeId?{...m,status:g.status,startedAt:g.startedAt,endedAt:g.endedAt,revision:g.revision,error:g.error}:m)}}}else if(c.oneofKind==="logAppended"&&c.logAppended.log)f.liveLogs={...y.liveLogs,[v]:[...y.liveLogs[v]??[],c.logAppended.log]};else if(c.oneofKind==="agentEventAppended"&&c.agentEventAppended.event){const g=`${v}:${c.agentEventAppended.nodeId}`;f.liveEvents={...y.liveEvents,[g]:[...y.liveEvents[g]??[],c.agentEventAppended.event]}}else c.oneofKind==="traceFinalized"&&c.traceFinalized.trace&&(f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(g=>g.nodeId===c.traceFinalized.nodeId?{...g,trace:c.traceFinalized.trace}:g)}});return f}function wp(y){const[a,i]=J.useReducer(Rp,ah),o=J.useRef(0),f=J.useCallback(async()=>{const d=await y.loadBaseline();return i({type:"baseline",baseline:d}),d},[y]);J.useEffect(()=>{const d=++o.current;let g=!1;return(async()=>{let z=250;for(;!g&&o.current===d;)try{i({type:"connection",connection:"connecting"});const j=await y.loadBaseline();if(g)return;i({type:"baseline",baseline:j}),z=250;let R=j.asOfSequence;for await(const C of y.streamUpdates(j.catalog.operatorInstanceId,R)){if(g)return;if(C.payload.oneofKind!=="update"||BigInt(C.payload.update.sequence)!==BigInt(R)+1n)break;i({type:"envelope",envelope:C}),R=C.payload.update.sequence}i({type:"connection",connection:"reconnecting"})}catch(j){if(g)return;i({type:"connection",connection:"reconnecting",error:j instanceof Error?j.message:"Operator connection failed"});const{promise:R,resolve:C}=Promise.withResolvers();window.setTimeout(C,z),await R,z=Math.min(z*2,4e3)}})(),()=>{g=!0,o.current+=1}},[y]);const c=J.useCallback(async(d,g)=>{i({type:"action",action:{kind:"start",target:d}});try{return await y.startRun(d,g)}finally{i({type:"action",action:void 0})}},[y]),v=J.useCallback(async d=>{i({type:"action",action:{kind:"cancel",target:d}});try{await y.cancelRun(d)}finally{i({type:"action",action:void 0})}},[y]);return{state:a,reconcile:f,startRun:c,cancelRun:v}}function Up({api:y}){const{state:a,startRun:i,cancelRun:o}=wp(y),[f,c]=J.useState(),[v,d]=J.useState();J.useEffect(()=>{const G=a.catalog?.workflows??[];if(!G.length){c(void 0);return}if(!f){c({kind:"workflow",workflowId:G[0].workflowId});return}G.some(ut=>ut.workflowId===f.workflowId)||c({kind:"workflow",workflowId:G[0].workflowId})},[f,a.catalog]);const g=a.catalog?.workflows.find(G=>G.workflowId===f?.workflowId),m=f?.kind==="run"?a.runs[f.runId]:void 0,z=J.useMemo(()=>Object.values(a.runs).filter(G=>G.summary?.workflowId===g?.workflowId).sort((G,ut)=>Number(ut.summary.createdSequence)-Number(G.summary.createdSequence))[0],[a.runs,g?.workflowId]),j=J.useCallback(G=>d(G),[]),R=J.useCallback(G=>{c(G),d(void 0)},[]),C=m??(f?.kind==="workflow"?z:void 0),Y=m&&v?`${m.summary?.runId}:${v}`:"";return p.jsxs("div",{className:"app-shell",children:[p.jsxs("header",{className:"topbar",children:[p.jsxs("div",{className:"brand",children:[p.jsx("span",{className:"brand-mark","aria-hidden":"true",children:"A"}),p.jsxs("div",{children:[p.jsx("strong",{children:"Avalanche"}),p.jsx("span",{children:"Operator"})]})]}),p.jsxs("div",{className:"breadcrumb",children:[p.jsx("span",{children:g?.rootAlias||"Local operator"}),g&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:g.displayName})]}),m?.summary&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:m.summary.runId})]})]}),p.jsxs("div",{className:`connection connection-${a.connection}`,children:[p.jsx("span",{}),a.connection==="live"?"Live":a.connection,p.jsxs("small",{children:["seq ",a.sequence]})]})]}),a.error&&p.jsx("div",{className:"connection-error",children:a.error}),p.jsxs("main",{className:`workspace ${v?"with-inspector":""}`,children:[p.jsx(ip,{catalog:a.catalog,runs:a.runs,selection:f,onSelect:R}),p.jsxs("section",{className:"canvas-shell",children:[p.jsxs("header",{className:"view-header",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:m?"Historical run":"Current definition"}),p.jsx("h1",{children:m?.summary?.runId||g?.displayName||"Operator"}),p.jsx("p",{children:m?`Recorded topology · ${m.summary?.status??"unknown"}`:g?`${g.nodeIds.length} nodes · ${g.relativeFile}`:"Waiting for a workflow catalog"})]}),p.jsx(_p,{workflow:m?void 0:g,run:m??C,pending:a.action,onStart:i,onCancel:o})]}),p.jsxs("div",{className:m?"canvas run-canvas":"canvas blueprint-canvas",children:[g||m?.topology?p.jsx(cp,{workflow:m?void 0:g,runTopology:m?.topology,runNodes:m?.nodes,onOpenNode:j}):p.jsxs("div",{className:"empty-state",children:[p.jsx("span",{children:"◇"}),p.jsx("h2",{children:"No workflows discovered"}),p.jsx("p",{children:"Catalog changes will appear here as the operator scans configured targets."})]}),m&&p.jsxs("div",{className:"historical-badge",children:[p.jsx("span",{children:"Immutable run snapshot"}),"Current workflow changes do not alter this canvas"]})]})]}),v&&p.jsx(jp,{api:y,workflow:g,run:m,nodeId:v,liveEvents:a.liveEvents[Y],liveLogs:m?.summary?a.liveLogs[m.summary.runId]:void 0,onClose:()=>d(void 0)})]})]})}const ih=document.getElementById("root");if(!ih)throw new Error("Operator UI root element is missing");Qm.createRoot(ih).render(p.jsx(J.StrictMode,{children:p.jsx(Up,{api:new ep})})); diff --git a/src/runtime/operator/web_assets/index.html b/src/runtime/operator/web_assets/index.html index 3815b93..ccc31d3 100644 --- a/src/runtime/operator/web_assets/index.html +++ b/src/runtime/operator/web_assets/index.html @@ -5,7 +5,7 @@ Avalanche Operator - + diff --git a/web/operator/src/Explorer.test.tsx b/web/operator/src/Explorer.test.tsx new file mode 100644 index 0000000..0e9a621 --- /dev/null +++ b/web/operator/src/Explorer.test.tsx @@ -0,0 +1,72 @@ +import { fireEvent, render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; + +import { Explorer } from "./Explorer"; +import { + CatalogSnapshotMsg, + FlowInfoMsg, + RunSnapshotMsg, + RunSummaryMsg, + ScanTargetMsg, +} from "./generated/operator"; + +const workflow = FlowInfoMsg.create({ + workflowId: "flows.py::orders", + displayName: "Orders", + rootAlias: "examples", + relativeFile: "flows.py", + nodeIds: ["fetch"], + graph: { fetch: { children: [] } }, + nodeTypes: { fetch: "source" }, + displayNames: { fetch: "Fetch" }, +}); +const run = RunSnapshotMsg.create({ + summary: RunSummaryMsg.create({ + runId: "run-1", + workflowId: workflow.workflowId, + workflowDisplayName: workflow.displayName, + status: "success", + startedAt: 1, + createdSequence: "4", + }), +}); +const target = ScanTargetMsg.create({ + alias: "examples", + targetPath: "/workspace/examples", + kind: "directory", +}); + + +describe("Explorer", () => { + it("navigates the scan-target workflow and historical run hierarchy", () => { + const onSelect = vi.fn(); + render( + , + ); + + expect(screen.getByText("/workspace/examples")).toBeInTheDocument(); + expect(screen.getByText("catalog r3")).toBeInTheDocument(); + + fireEvent.click(screen.getByRole("button", { name: /Ordersflows.py/ })); + expect(onSelect).toHaveBeenLastCalledWith({ + kind: "workflow", + workflowId: workflow.workflowId, + }); + + fireEvent.click(screen.getByRole("button", { name: /run-1Created at sequence 4/ })); + expect(onSelect).toHaveBeenLastCalledWith({ + kind: "run", + workflowId: workflow.workflowId, + runId: "run-1", + }); + }); +}); diff --git a/web/operator/src/GraphCanvas.test.tsx b/web/operator/src/GraphCanvas.test.tsx new file mode 100644 index 0000000..ef9fcd7 --- /dev/null +++ b/web/operator/src/GraphCanvas.test.tsx @@ -0,0 +1,105 @@ +import type { ComponentType } from "react"; + +import { render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; + +vi.mock("@xyflow/react", () => { + return { + Background: () => null, + Controls: () => null, + Handle: () => null, + MarkerType: { ArrowClosed: "arrow-closed" }, + Position: { Left: "left", Right: "right" }, + ReactFlow: ({ + nodes, + edges, + nodeTypes, + }: { + nodes: Array<{ id: string; data: unknown }>; + edges: Array<{ id: string }>; + nodeTypes: Record>; + }) => { + const NodeComponent = nodeTypes.workflow; + return ( +
+ {edges.length} + {nodes.map((node) => ( + + ))} +
+ ); + }, + }; +}); + +import { GraphCanvas } from "./GraphCanvas"; +import { + FlowInfoMsg, + NodeSnapshotMsg, + WorkflowTopologyMsg, +} from "./generated/operator"; + +function metadata(field: string) { + return JSON.stringify({ + signature: { + inputs: [{ name: field, type: "str" }], + outputs: [], + }, + }); +} + +const workflow = FlowInfoMsg.create({ + workflowId: "flow.py::demo", + displayName: "Current", + nodeIds: ["agent", "store"], + graph: { + agent: { children: ["store", "store"] }, + store: { children: [] }, + }, + nodeTypes: { agent: "step", store: "dest" }, + displayNames: { agent: "Current agent", store: "Store" }, + agentMetadataJson: { agent: metadata("current_input") }, +}); + +describe("GraphCanvas", () => { + it("renders the current definition and keeps a historical run on recorded metadata", () => { + const view = render( + undefined} />, + ); + + expect(screen.getByText("Current agent")).toBeInTheDocument(); + expect(screen.getByText("Store")).toBeInTheDocument(); + expect(screen.getByText("current_input")).toBeInTheDocument(); + expect(screen.getByTestId("edge-count")).toHaveTextContent("1"); + + view.rerender( + undefined} + />, + ); + + expect(screen.getByText("Recorded agent")).toBeInTheDocument(); + expect(screen.getByText("recorded_input")).toBeInTheDocument(); + expect(screen.getByText("recorded failure")).toBeInTheDocument(); + expect(screen.queryByText("Store")).not.toBeInTheDocument(); + expect(screen.queryByText("current_input")).not.toBeInTheDocument(); + }); +}); diff --git a/web/operator/src/GraphCanvas.tsx b/web/operator/src/GraphCanvas.tsx index ea75852..2663bbb 100644 --- a/web/operator/src/GraphCanvas.tsx +++ b/web/operator/src/GraphCanvas.tsx @@ -197,9 +197,11 @@ export function GraphCanvas({ status: runtimeNode?.status, error: runtimeNode?.error, duration: runtimeNode ? elapsed(runtimeNode) : undefined, - declaration: workflow - ? parseAgentDeclaration(workflow.agentMetadataJson[nodeId]) - : undefined, + declaration: parseAgentDeclaration( + runTopology + ? runTopology.agentMetadataJson[nodeId] + : workflow?.agentMetadataJson[nodeId], + ), onOpen: () => onOpenNode(nodeId), }, }; @@ -221,7 +223,7 @@ export function GraphCanvas({ } } return { nodes, edges }; - }, [onOpenNode, runNodes, topology, workflow]); + }, [onOpenNode, runNodes, runTopology, topology, workflow]); return ( ({ + useVirtualizer: ({ count }: { count: number }) => ({ + getTotalSize: () => count * 64, + getVirtualItems: () => + Array.from({ length: count }, (_, index) => ({ + index, + start: index * 64, + })), + }), +})); import type { OperatorApi } from "./api"; import type { @@ -109,6 +120,16 @@ function api(): OperatorApi { predictCount: 0, error: false, }, + { + eventSequence: "2", + sizeBytes: "64", + bodyToken: "output-body", + invocationId: "invocation-1", + eventKind: "run.succeeded", + toolCount: 0, + predictCount: 0, + error: false, + }, ]; return { getCatalog: async (): Promise => { @@ -122,7 +143,17 @@ function api(): OperatorApi { }, listAgentEvents: async () => events, listLogs: async () => [], - readDetail: async () => ({ inputs: { question: "Why?" } }), + readDetail: async (bodyToken) => + bodyToken === "input-body" + ? { inputs: { question: "Why?" } } + : { + outputs: { + answer: { + kind: "predict_rlm_file", + path: "/workspace/result.txt", + }, + }, + }, startRun: async () => "unused", cancelRun: async () => undefined, }; @@ -149,5 +180,79 @@ describe("Inspector", () => { expect(screen.getByText("Declared fields")).toBeInTheDocument(); expect(screen.getByText("question")).toBeInTheDocument(); await waitFor(() => expect(screen.getByText("Why?")).toBeInTheDocument()); + + fireEvent.click(screen.getByRole("button", { name: "output" })); + expect(screen.getByText("answer")).toBeInTheDocument(); + await waitFor(() => + expect(screen.getByText("/workspace/result.txt")).toBeInTheDocument(), + ); + }); + + it("hydrates complete turns on demand and evicts the least recently used body", async () => { + const events: AgentEventDescriptorMsg[] = Array.from({ length: 10 }, (_, index) => ({ + eventSequence: String(index + 1), + sizeBytes: "64", + bodyToken: `turn-${index + 1}`, + invocationId: "invocation-1", + eventKind: "iteration.recorded", + iteration: index + 1, + durationMs: "10", + toolCount: 1, + predictCount: 1, + error: false, + })); + const readDetail = vi.fn(async (token: string) => ({ + reasoning: `reasoning-${token}`, + code: `code-${token}`, + output: `output-${token}`, + finish: { reason: "stop" }, + usage: { input_tokens: 4 }, + tool_calls: [{ name: "lookup" }], + predict_calls: [{ signature: "Answer" }], + })); + const operatorApi = { + ...api(), + listAgentEvents: async () => events, + readDetail, + }; + render( + undefined} + />, + ); + + fireEvent.click(screen.getByRole("button", { name: "trace" })); + await waitFor(() => expect(screen.getByText("reasoning-turn-10")).toBeInTheDocument()); + fireEvent.click(screen.getByRole("button", { name: "Following live" })); + + const turnButtons = screen + .getAllByRole("button") + .filter((button) => button.classList.contains("turn-row")); + for (let turn = 1; turn <= 7; turn += 1) { + fireEvent.click(turnButtons[turn - 1]); + await waitFor(() => + expect(screen.getByText(`reasoning-turn-${turn}`)).toBeInTheDocument(), + ); + } + fireEvent.click(turnButtons[9]); + await waitFor(() => expect(screen.getByText("reasoning-turn-10")).toBeInTheDocument()); + for (let turn = 8; turn <= 9; turn += 1) { + fireEvent.click(turnButtons[turn - 1]); + await waitFor(() => + expect(screen.getByText(`reasoning-turn-${turn}`)).toBeInTheDocument(), + ); + } + + fireEvent.click(turnButtons[9]); + await waitFor(() => expect(screen.getByText("reasoning-turn-10")).toBeInTheDocument()); + fireEvent.click(turnButtons[0]); + await waitFor(() => expect(screen.getByText("reasoning-turn-1")).toBeInTheDocument()); + + expect(readDetail.mock.calls.filter(([token]) => token === "turn-10")).toHaveLength(1); + expect(readDetail.mock.calls.filter(([token]) => token === "turn-1")).toHaveLength(2); }); }); diff --git a/web/operator/src/Inspector.tsx b/web/operator/src/Inspector.tsx index 3e2eb8f..e6af505 100644 --- a/web/operator/src/Inspector.tsx +++ b/web/operator/src/Inspector.tsx @@ -24,6 +24,9 @@ interface InspectorProps { } type RunTab = "overview" | "inputs" | "output" | "trace" | "logs"; +const EMPTY_EVENTS: AgentEventDescriptorMsg[] = []; +const EMPTY_LOGS: LogRecordDescriptorMsg[] = []; + function JsonBlock({ value }: { value: unknown }) { return
{JSON.stringify(value, null, 2)}
; @@ -39,8 +42,8 @@ export function Inspector({ workflow, run, nodeId, - liveEvents = [], - liveLogs = [], + liveEvents = EMPTY_EVENTS, + liveLogs = EMPTY_LOGS, onClose, }: InspectorProps) { const [tab, setTab] = useState("overview"); @@ -129,6 +132,8 @@ export function Inspector({ } const cached = detailCache.current.get(descriptor.bodyToken); if (cached !== undefined) { + detailCache.current.delete(descriptor.bodyToken); + detailCache.current.set(descriptor.bodyToken, cached); setDetail(cached); return; } diff --git a/web/operator/src/RunControls.test.tsx b/web/operator/src/RunControls.test.tsx new file mode 100644 index 0000000..c86f727 --- /dev/null +++ b/web/operator/src/RunControls.test.tsx @@ -0,0 +1,62 @@ +import { fireEvent, render, screen, waitFor } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; + +import type { FlowInfoMsg, RunSnapshotMsg } from "./generated/operator"; +import { parseRunInput, RunControls } from "./RunControls"; + +const workflow = { + workflowId: "flows.py::orders", + displayName: "Orders", +} as FlowInfoMsg; +const running = { + summary: { runId: "run-1", status: "running" }, +} as RunSnapshotMsg; + +describe("RunControls", () => { + it("starts without implicit input and cancels the authoritative active run", async () => { + const onStart = vi.fn(async () => "run-2"); + const onCancel = vi.fn(async () => undefined); + render( + , + ); + + fireEvent.click(screen.getByRole("button", { name: "Run" })); + await waitFor(() => + expect(onStart).toHaveBeenCalledWith("flows.py::orders", undefined), + ); + + fireEvent.click(screen.getByRole("button", { name: "Cancel run" })); + await waitFor(() => expect(onCancel).toHaveBeenCalledWith("run-1")); + }); + + it("keeps the JSON editor closed by default and surfaces operator validation", async () => { + const onStart = vi.fn(async () => { + throw new Error("input.value is required"); + }); + render( + undefined} + />, + ); + + expect(screen.queryByText("Schema-blind JSON object")).not.toBeInTheDocument(); + fireEvent.click(screen.getByRole("button", { name: "Run" })); + + expect(await screen.findByText("input.value is required")).toBeInTheDocument(); + expect(screen.queryByText("Schema-blind JSON object")).not.toBeInTheDocument(); + fireEvent.click(screen.getByRole("button", { name: "Add JSON input" })); + expect(screen.getByText("Schema-blind JSON object")).toBeInTheDocument(); + }); + + it("accepts an explicit JSON object and rejects non-object run input", () => { + expect(parseRunInput('{"value":7}')).toEqual({ value: 7 }); + expect(() => parseRunInput("[1,2,3]")).toThrow("Run input must be a JSON object"); + }); +}); diff --git a/web/operator/src/RunControls.tsx b/web/operator/src/RunControls.tsx index af6f19d..8767834 100644 --- a/web/operator/src/RunControls.tsx +++ b/web/operator/src/RunControls.tsx @@ -48,6 +48,13 @@ interface RunControlsProps { onCancel: (runId: string) => Promise; } +export function parseRunInput(draft: string): Record { + const parsed: unknown = JSON.parse(draft); + if (!isUnknownRecord(parsed)) throw new Error("Run input must be a JSON object"); + return parsed; +} + + export function RunControls({ workflow, run, @@ -66,9 +73,7 @@ export function RunControls({ let input: Record | undefined; if (showInput) { try { - const parsed: unknown = JSON.parse(draft); - if (!isUnknownRecord(parsed)) throw new Error("Run input must be a JSON object"); - input = parsed; + input = parseRunInput(draft); } catch (reason) { setError(reason instanceof Error ? reason.message : "Run input is invalid JSON"); return; diff --git a/web/operator/src/state.test.ts b/web/operator/src/state.test.ts index afc1cb5..be483c5 100644 --- a/web/operator/src/state.test.ts +++ b/web/operator/src/state.test.ts @@ -1,6 +1,8 @@ -import { describe, expect, it } from "vitest"; +import { renderHook, waitFor } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; import type { StructuralBaseline } from "./api"; +import type { OperatorApi } from "./api"; import { CatalogSnapshotMsg, FlowInfoMsg, @@ -10,7 +12,7 @@ import { RunSummaryMsg, WorkflowTopologyMsg, } from "./generated/operator"; -import { emptyProjection, projectionReducer } from "./state"; +import { emptyProjection, projectionReducer, useOperatorProjection } from "./state"; const workflow = FlowInfoMsg.create({ name: "orders", @@ -167,4 +169,52 @@ describe("projectionReducer", () => { "structural reset", ); }); + + it("reloads an authoritative baseline after a stream reset notice", async () => { + const replacement: StructuralBaseline = { + ...baseline, + asOfSequence: "8", + catalog: CatalogSnapshotMsg.create({ + ...baseline.catalog, + asOfSequence: "8", + revision: "2", + }), + }; + const loadBaseline = vi + .fn<() => Promise>() + .mockResolvedValueOnce(baseline) + .mockResolvedValue(replacement); + let streamCount = 0; + const operatorApi: OperatorApi = { + getCatalog: async () => replacement.catalog, + loadBaseline, + streamUpdates: () => { + streamCount += 1; + return (async function* () { + if (streamCount === 1) { + yield OperatorUpdateEnvelope.create({ + operatorInstanceId: "operator-1", + payload: { + oneofKind: "resetRequired", + resetRequired: { historyFloor: "2", latestSequence: "8" }, + }, + }); + } else { + await new Promise(() => undefined); + } + })(); + }, + listAgentEvents: async () => [], + listLogs: async () => [], + readDetail: async () => undefined, + startRun: async () => "run-2", + cancelRun: async () => undefined, + }; + + const { result } = renderHook(() => useOperatorProjection(operatorApi)); + + await waitFor(() => expect(result.current.state.catalog?.revision).toBe("2")); + expect(loadBaseline).toHaveBeenCalledTimes(2); + expect(result.current.state.sequence).toBe("8"); + }); }); diff --git a/web/operator/src/test/setup.ts b/web/operator/src/test/setup.ts index f149f27..051f4e6 100644 --- a/web/operator/src/test/setup.ts +++ b/web/operator/src/test/setup.ts @@ -1 +1,6 @@ +import { cleanup } from "@testing-library/react"; +import { afterEach } from "vitest"; + import "@testing-library/jest-dom/vitest"; + +afterEach(cleanup); From 50743eadcc09b1cc31dd470bf4bab7bfc53fac28 Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:12:01 +0000 Subject: [PATCH 09/25] Document the local operator web UI --- CHANGELOG.md | 12 ++++ README.md | 17 ++++++ docs/getting-started.md | 15 +++++ .../design.md | 4 +- .../specs/versioned-run-topology/spec.md | 2 +- .../tasks.md | 56 +++++++++---------- 6 files changed, 75 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e89c9ae..47eb564 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ ## Unreleased +### Operator web interface + +- Added an opt-in local React operator interface (`ava operator --web`) with + workflow discovery, live DAG replacement, immutable historical run canvases, + launch/cancel controls, logs, and demand-loaded agent evidence. +- Added a same-process binary gRPC-Web listener and packaged browser assets. + Loopback remains the default; non-loopback binding requires the explicit + `--web-trusted-proxy` acknowledgement. +- Run topology now retains versioned agent declaration metadata, and bounded + trace descriptors expose stable PredictRLM header, usage, and telemetry + metadata without embedding complete trace bodies in structural snapshots. + ### Operator transport - Operator streams now replay bounded, typed run updates under an instance epoch diff --git a/README.md b/README.md index 45d973b..2453e97 100644 --- a/README.md +++ b/README.md @@ -378,6 +378,23 @@ ava operator --flows path/to/flows --port 7433 ava tui --connect localhost:7433 ``` +For a browser interface backed by the same operator, enable the loopback web +listener: + +```bash +ava operator --flows path/to/flows --web +# Open http://127.0.0.1:7435 +``` + +The browser shows the live workflow catalog, current definitions, immutable +per-run topology, run controls, logs, and retained agent trace evidence. Source +changes replace only the current-definition canvas; earlier runs keep the +topology and agent declaration metadata captured when they started. The browser +listener is loopback-only by default. `--web-trusted-proxy` permits a +non-loopback bind only when a trusted, authenticated proxy supplies the missing +security boundary. + + The TUI is a client of the operator; it does not import or execute workflow files itself. To explore the interface without an operator, start mock mode: diff --git a/docs/getting-started.md b/docs/getting-started.md index 2367bb9..57b80c9 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -136,6 +136,21 @@ Alternatively, connect the TUI and start runs interactively: uv run ava tui --connect localhost:7433 ``` +Or enable the operator's browser interface: + +```bash +uv run ava operator --flows examples --web +``` + +Open `http://127.0.0.1:7435`. The browser receives the same ordered operator +updates as the TUI, including live catalog replacement when watched workflow +sources change. Current definitions update in place; historical run canvases +retain the topology and agent declarations captured for that run. The browser +listener defaults to loopback and has no built-in authentication. Use +`--web-trusted-proxy` with a non-loopback `--web-host` only behind a trusted, +authenticated proxy. + + The TUI gets flows from the operator over gRPC. It does not import files from the examples directory directly. diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/design.md b/openspec/changes/add-operator-web-ui-and-hot-reload/design.md index 1b96c3b..a4a9a32 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/design.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/design.md @@ -22,7 +22,7 @@ The gRPC protocol currently separates catalog listing from a stream of run-only ### Retain a topology snapshot with each run -Introduce a frozen workflow-topology value containing only node ID order, adjacency graph, node types, and display names. Construct it from the worker's `prepared` event, not the current catalog descriptor: the worker event represents what that run actually loaded and executed. Store it on the in-memory run record and include it in the structural run snapshot and transport representation. +Introduce a frozen workflow-topology value containing node ID order, adjacency graph, node types, display names, and serialized agent declaration metadata needed to interpret recorded invocation values. Construct it from the worker's `prepared` event, not the current catalog descriptor: the worker event represents what that run actually loaded and executed. Store it on the in-memory run record and include it in the structural run snapshot and transport representation. `RunState.nodes` remains execution state keyed by node ID. The topology snapshot is the rendering and identity layer. A run view joins the two; it never reads the current `WorkflowInfo` to supply missing nodes or edges. @@ -105,7 +105,7 @@ Run cards retain the same structural edges but prioritize execution status, dura ### Retain bounded agent invocation inputs and outputs -PredictRLM `run.started` evidence contains actual invocation inputs, but Avalanche currently projects only their field names. Preserve supported input values in that existing event, matching the terminal outputs already projected from `run.succeeded`. The run inspector reads both through existing agent-event and hydrated-trace detail paths and presents separate Inputs and Output views using current declaration metadata only as labels. +PredictRLM `run.started` evidence contains actual invocation inputs, but Avalanche currently projects only their field names. Preserve supported input values in that existing event, matching the terminal outputs already projected from `run.succeeded`. The run inspector reads both through existing agent-event and hydrated-trace detail paths and presents separate Inputs and Output views using declaration metadata retained with that run's topology only as labels. This is agent-invocation evidence, not generic DAG-node value capture. Recursively project JSON-shaped values and declared model values into the ordinary `inputs` and `outputs` structures. At this projection boundary, encode an actual `predict_rlm.File` as a tagged JSON value containing its non-empty host path; lists and nested structures retain those tagged values in place. The browser's generic value renderer recognizes the tag and gives that value path-specific presentation. There is no parallel file-reference event or index. diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md index 2d7fd47..7e6d0f4 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md @@ -6,7 +6,7 @@ Retain the exact workflow definition used by each run so operator clients can re ### Requirement: Capture an immutable executed topology -When the operator creates a run, it SHALL retain an immutable workflow topology snapshot derived from the workflow that was prepared for that run. The snapshot SHALL include node identity and ordering, graph edges, node types, and display metadata required to render the run's workflow graph. +When the operator creates a run, it SHALL retain an immutable workflow topology snapshot derived from the workflow that was prepared for that run. The snapshot SHALL include node identity and ordering, graph edges, node types, display metadata required to render the run's workflow graph, and serialized agent declaration metadata required to interpret retained invocation values without consulting the current catalog. #### Scenario: Run begins from the current workflow - **WHEN** a run is created for a workflow diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md b/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md index 9d141b7..811f13a 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md @@ -1,42 +1,42 @@ ## 1. Versioned run topology -- [ ] 1.1 Add an immutable executed-topology model and retain it from the run worker's prepared workflow metadata when creating a run. -- [ ] 1.2 Include the retained topology in in-memory structural snapshots and the operator protocol without materializing workflow objects across process boundaries. -- [ ] 1.3 Update transport conversion and clients to hydrate a run from its topology snapshot plus execution state. -- [ ] 1.4 Add regression coverage proving a completed and active run remain renderable after nodes or edges change and after the workflow is removed. -- [ ] 1.5 Preserve bounded structured agent invocation inputs and terminal outputs in existing evidence, encode nested PredictRLM `File` values as tagged paths, and verify input, output, list, unsupported, over-limit, and worker-to-operator behavior. -- [ ] 1.6 Retain bounded worker-provided node failure messages in node state, snapshots, live updates, protocol conversion, and run inspection with focused regression coverage. -- [ ] 1.7 Decompose exportable `RunTrace` into a lightweight header, paginated rich event/turn descriptors, and complete on-demand `IterationStep` bodies; migrate TUI hydration away from monolithic `ReadTrace` and verify semantic coverage and bounded reads. +- [x] 1.1 Add an immutable executed-topology model and retain it from the run worker's prepared workflow metadata when creating a run. +- [x] 1.2 Include the retained topology in in-memory structural snapshots and the operator protocol without materializing workflow objects across process boundaries. +- [x] 1.3 Update transport conversion and clients to hydrate a run from its topology snapshot plus execution state. +- [x] 1.4 Add regression coverage proving a completed and active run remain renderable after nodes or edges change and after the workflow is removed. +- [x] 1.5 Preserve bounded structured agent invocation inputs and terminal outputs in existing evidence, encode nested PredictRLM `File` values as tagged paths, and verify input, output, list, unsupported, over-limit, and worker-to-operator behavior. +- [x] 1.6 Retain bounded worker-provided node failure messages in node state, snapshots, live updates, protocol conversion, and run inspection with focused regression coverage. +- [x] 1.7 Decompose exportable `RunTrace` into a lightweight header, paginated rich event/turn descriptors, and complete on-demand `IterationStep` bodies; migrate TUI hydration away from monolithic `ReadTrace` and verify semantic coverage and bounded reads. ## 2. Atomic catalog reload and live updates -- [ ] 2.1 Change discovery refresh to validate a candidate catalog, retain the last valid catalog on failure, and expose reload diagnostics. -- [ ] 2.2 Add typed scan-target catalog metadata with alias, normalized target path, and file/directory kind to initial reads, live replacements, reset baselines, protocol conversion, and clients. -- [ ] 2.3 Add a monotonic catalog revision and a full catalog-update event emitted after each successful replacement. -- [ ] 2.4 Replace the run-only update stream/envelope with an operator-update stream that carries run updates, catalog revisions, and reset notices; regenerate protobuf bindings. -- [ ] 2.5 Migrate the Python operator client and TUI provider to the new stream and authoritative reset baseline behavior. -- [ ] 2.6 Add focused operator and client tests for scan-target grouping and created, changed, removed, failed, replayed, and reset catalog states. +- [x] 2.1 Change discovery refresh to validate a candidate catalog, retain the last valid catalog on failure, and expose reload diagnostics. +- [x] 2.2 Add typed scan-target catalog metadata with alias, normalized target path, and file/directory kind to initial reads, live replacements, reset baselines, protocol conversion, and clients. +- [x] 2.3 Add a monotonic catalog revision and a full catalog-update event emitted after each successful replacement. +- [x] 2.4 Replace the run-only update stream/envelope with an operator-update stream that carries run updates, catalog revisions, and reset notices; regenerate protobuf bindings. +- [x] 2.5 Migrate the Python operator client and TUI provider to the new stream and authoritative reset baseline behavior. +- [x] 2.6 Add focused operator and client tests for scan-target grouping and created, changed, removed, failed, replayed, and reset catalog states. ## 3. gRPC-Web delivery -- [ ] 3.1 Add an optional loopback-default browser listener within the operator process that serves compiled web assets and adapts gRPC-Web unary and server-streaming calls to the shared authoritative `Operator` instance without a required sidecar. -- [ ] 3.2 Add the React, TypeScript, and Vite frontend build; generated TypeScript stubs from `operator.proto`; `@xyflow/react`, CodeMirror 6, and `@tanstack/react-virtual`; package data; and development/production asset-loading paths. -- [ ] 3.3 Add `ava` command and operator configuration support for launching and reporting the local web UI endpoint without weakening non-loopback safeguards. -- [ ] 3.4 Add integration coverage for browser-compatible unary calls, live stream delivery, loopback binding, and static asset serving. +- [x] 3.1 Add an optional loopback-default browser listener within the operator process that serves compiled web assets and adapts gRPC-Web unary and server-streaming calls to the shared authoritative `Operator` instance without a required sidecar. +- [x] 3.2 Add the React, TypeScript, and Vite frontend build; generated TypeScript stubs from `operator.proto`; `@xyflow/react`, CodeMirror 6, and `@tanstack/react-virtual`; package data; and development/production asset-loading paths. +- [x] 3.3 Add `ava` command and operator configuration support for launching and reporting the local web UI endpoint without weakening non-loopback safeguards. +- [x] 3.4 Add integration coverage for browser-compatible unary calls, live stream delivery, loopback binding, and static asset serving. ## 4. Web UI -- [ ] 4.1 Implement ephemeral catalog and run projections from authoritative operator updates, with stream reconnection, reset reconciliation, and non-authoritative start/cancel request state. -- [ ] 4.2 Implement the scan-target Explorer with workflow/run hierarchy and workflow-versus-run navigation. -- [ ] 4.3 Implement the current-workflow blueprint canvas with pan/zoom, one dependency arrow per source-target pair, agent field lists inside cards, and declaration inspection. -- [ ] 4.4 Implement the historical-run canvas with its topology snapshot, execution-focused node cards, status, duration, failure, logs, and a visible distinction from current workflow state. -- [ ] 4.5 Implement virtualized, paginated `RunTrace` inspection with header metadata, chronological turn summaries, selected complete turn details, live following, errors, and a bounded LRU detail cache. -- [ ] 4.6 Implement separate agent Inputs and Output views using retained invocation evidence and declaration field metadata. -- [ ] 4.7 Render tagged PredictRLM file values within ordinary agent Inputs and Output views using path-specific presentation without copying, storing, or validating files. -- [ ] 4.8 Implement run start with a closed-by-default schema-blind JSON-object editor, authoritative validation errors, and active-run cancellation using generated gRPC-Web clients. -- [ ] 4.9 Add browser-level tests covering Explorer navigation, current workflow rendering, a live reload, a historical topology mismatch, complete demand-loaded trace inspection, bounded hydration/cache behavior, agent inputs and outputs, file path values, stream reset recovery, default no-input run start, optional JSON input, validation errors, and cancellation. +- [x] 4.1 Implement ephemeral catalog and run projections from authoritative operator updates, with stream reconnection, reset reconciliation, and non-authoritative start/cancel request state. +- [x] 4.2 Implement the scan-target Explorer with workflow/run hierarchy and workflow-versus-run navigation. +- [x] 4.3 Implement the current-workflow blueprint canvas with pan/zoom, one dependency arrow per source-target pair, agent field lists inside cards, and declaration inspection. +- [x] 4.4 Implement the historical-run canvas with its topology snapshot, execution-focused node cards, status, duration, failure, logs, and a visible distinction from current workflow state. +- [x] 4.5 Implement virtualized, paginated `RunTrace` inspection with header metadata, chronological turn summaries, selected complete turn details, live following, errors, and a bounded LRU detail cache. +- [x] 4.6 Implement separate agent Inputs and Output views using retained invocation evidence and declaration field metadata. +- [x] 4.7 Render tagged PredictRLM file values within ordinary agent Inputs and Output views using path-specific presentation without copying, storing, or validating files. +- [x] 4.8 Implement run start with a closed-by-default schema-blind JSON-object editor, authoritative validation errors, and active-run cancellation using generated gRPC-Web clients. +- [x] 4.9 Add browser-level tests covering Explorer navigation, current workflow rendering, a live reload, a historical topology mismatch, complete demand-loaded trace inspection, bounded hydration/cache behavior, agent inputs and outputs, file path values, stream reset recovery, default no-input run start, optional JSON input, validation errors, and cancellation. ## 5. Verification and documentation -- [ ] 5.1 Run focused operator, protocol, TUI-client, adapter, and browser test suites; add an end-to-end local operator reload scenario. -- [ ] 5.2 Update local development and operator documentation with web UI launch, loopback exposure, reload semantics, and the distinction between workflow and run views. +- [x] 5.1 Run focused operator, protocol, TUI-client, adapter, and browser test suites; add an end-to-end local operator reload scenario. +- [x] 5.2 Update local development and operator documentation with web UI launch, loopback exposure, reload semantics, and the distinction between workflow and run views. From dbd1e5fff72d8183461b6e0eb3ac3db848b76614 Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:49:47 +0000 Subject: [PATCH 10/25] Restyle operator web UI with light neutrals --- ...{index-BqN1_lQb.css => index-BNQSyDYz.css} | 2 +- .../{index-B3SIpuZV.js => index-K_C1Akn9.js} | 2 +- src/runtime/operator/web_assets/index.html | 4 +- web/operator/src/RunControls.tsx | 8 +- web/operator/src/styles.css | 225 +++++++++--------- 5 files changed, 121 insertions(+), 120 deletions(-) rename src/runtime/operator/web_assets/assets/{index-BqN1_lQb.css => index-BNQSyDYz.css} (50%) rename src/runtime/operator/web_assets/assets/{index-B3SIpuZV.js => index-K_C1Akn9.js} (99%) diff --git a/src/runtime/operator/web_assets/assets/index-BqN1_lQb.css b/src/runtime/operator/web_assets/assets/index-BNQSyDYz.css similarity index 50% rename from src/runtime/operator/web_assets/assets/index-BqN1_lQb.css rename to src/runtime/operator/web_assets/assets/index-BNQSyDYz.css index 570e584..212bf12 100644 --- a/src/runtime/operator/web_assets/assets/index-BqN1_lQb.css +++ b/src/runtime/operator/web_assets/assets/index-BNQSyDYz.css @@ -1 +1 @@ -.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}:root{color:#dce4df;background:#0d1011;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;font-synthesis:none;--panel: #131718;--panel-raised: #181d1e;--line: rgba(217, 232, 224, .1);--muted: #87918d;--acid: #d9ed72;--mint: #79dab7;--amber: #f0bd68;--red: #f18378}*{box-sizing:border-box}html,body,#root{width:100%;height:100%;margin:0;overflow:hidden}button,input{font:inherit}button{color:inherit}code,pre,.eyebrow,small{font-family:DM Mono,monospace}.app-shell{height:100%;display:grid;grid-template-rows:58px auto 1fr}.topbar{display:grid;grid-template-columns:260px 1fr auto;align-items:center;padding:0 20px;border-bottom:1px solid var(--line);background:#101314;z-index:10}.brand{display:flex;align-items:center;gap:11px}.brand-mark{width:30px;height:30px;display:grid;place-items:center;color:#101314;background:var(--acid);font-weight:800;clip-path:polygon(50% 0,100% 100%,0 100%);padding-top:8px}.brand div{display:flex;align-items:baseline;gap:7px}.brand strong{font-size:15px;letter-spacing:-.02em}.brand span:last-child{color:var(--muted);font:11px DM Mono;text-transform:uppercase}.breadcrumb{display:flex;justify-content:center;gap:9px;color:var(--muted);font-size:12px}.breadcrumb i{opacity:.4}.breadcrumb strong{color:#cfd8d3;font-weight:500}.connection{display:flex;align-items:center;gap:8px;font:11px DM Mono;text-transform:capitalize}.connection>span{width:7px;height:7px;border-radius:50%;background:var(--amber);box-shadow:0 0 10px var(--amber)}.connection-live>span{background:var(--mint);box-shadow:0 0 10px var(--mint)}.connection small{color:#59615e;margin-left:5px}.connection-error,.action-error,.error-banner{background:#4c2525;color:#ffd4cf;padding:8px 18px;font-size:12px;border-bottom:1px solid #813c37}.workspace{min-height:0;display:grid;grid-template-columns:280px minmax(0,1fr)}.workspace.with-inspector{grid-template-columns:280px minmax(0,1fr) 410px}.explorer{background:var(--panel);border-right:1px solid var(--line);overflow:auto;min-width:0}.explorer>header{padding:22px 18px 14px;position:relative}.eyebrow{display:block;color:var(--acid);font-size:9px;letter-spacing:.16em;text-transform:uppercase}h1,h2,h3,p{margin-top:0}.explorer h2{margin:5px 0 0;font-size:17px}.catalog-revision{position:absolute;right:18px;bottom:17px;color:#67706c;font:9px DM Mono}.target-list{padding:4px 10px 30px}.target{border-top:1px solid var(--line);padding-top:7px;margin-top:4px}.target-heading,.tree-row,.tree-select,.run-select{width:100%;min-width:0}.target-heading,.tree-select,.run-select,.tree-disclosure{background:none;border:0;cursor:pointer;text-align:left}.target-heading{display:grid;grid-template-columns:12px 22px minmax(0,1fr);gap:5px;align-items:center;padding:8px 5px}.target-heading>span:first-child{color:#5e6763}.target-kind{width:20px;height:20px;border:1px solid #49524e;border-radius:3px;display:grid;place-items:center;font:9px DM Mono;color:#a8b1ad}.target-heading strong,.target-heading small,.tree-select strong,.tree-select small,.run-select strong,.run-select small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.target-heading strong{font-size:11px;font-weight:600}.target-heading small{color:#5f6965;font-size:8px;margin-top:2px}.workflow-list{border-left:1px solid #303637;margin-left:16px;padding-left:7px}.tree-row{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:stretch}.tree-disclosure{color:#5f6865;text-align:center;padding:0}.tree-select{display:grid;grid-template-columns:23px minmax(0,1fr);gap:4px;padding:8px;border-radius:4px}.tree-select:hover,.run-select:hover,.tree-select.active,.run-select.active{background:#202627}.tree-select.active{box-shadow:inset 2px 0 var(--acid)}.workflow-glyph{color:var(--acid);font-size:16px}.tree-select strong{font-size:11px;font-weight:600}.tree-select small,.run-select small{color:#68716e;font-size:8px;margin-top:3px}.run-branches{margin-left:28px;border-left:1px dashed #303637;padding:3px 0 6px 8px}.run-select{display:grid;grid-template-columns:20px minmax(0,1fr);gap:5px;align-items:center;padding:7px;border-radius:4px}.run-select strong{font:9px DM Mono}.run-dot{width:16px;height:16px;border-radius:50%;display:grid;place-items:center;font:9px DM Mono;background:#252c2a;color:var(--muted)}.run-dot.status-success{color:var(--mint)}.run-dot.status-failed{color:var(--red)}.run-dot.status-running{color:var(--acid)}.no-runs{display:block;color:#525a57;padding:7px;font:8px DM Mono}.diagnostics{margin:0 12px 12px;padding:9px;background:#34291c;border:1px solid #5d472b;border-radius:4px;font-size:10px}.diagnostics summary{color:var(--amber);cursor:pointer}.diagnostics div{margin-top:9px;border-top:1px solid #5d472b;padding-top:8px}.diagnostics strong,.diagnostics span{display:block}.diagnostics span{color:#ac9473;font:8px DM Mono;overflow:hidden;text-overflow:ellipsis}.diagnostics p{color:#d4bd9b;margin:4px 0 0}.skeleton{padding:20px}.skeleton div{height:38px;background:#1b2021;margin-bottom:9px;animation:pulse 1.2s infinite alternate}@keyframes pulse{to{opacity:.45}}.canvas-shell{min-width:0;min-height:0;display:grid;grid-template-rows:auto 1fr;background:#0f1213}.view-header{min-height:92px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 24px;border-bottom:1px solid var(--line)}.view-header h1{margin:4px 0 2px;font-size:22px;letter-spacing:-.035em}.view-header p{margin:0;color:var(--muted);font-size:11px}.canvas{position:relative;min-height:0}.blueprint-canvas{background:radial-gradient(circle at 55% 35%,rgba(72,97,86,.14),transparent 45%),#0f1213}.run-canvas{background:radial-gradient(circle at 55% 35%,rgba(89,76,62,.13),transparent 45%),#111313}.react-flow__controls{background:#1b2021;border:1px solid var(--line);box-shadow:none}.react-flow__controls-button{background:#1b2021;border-bottom-color:var(--line);fill:#aeb8b3}.react-flow__controls-button:hover{background:#272e2f}.react-flow__edge-path{stroke:#66736d;stroke-width:1.4}.react-flow__arrowhead polyline{stroke:#66736d;fill:#66736d}.node-card{width:248px;min-height:102px;position:relative;display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:15px;text-align:left;background:#171c1d;border:1px solid #47514d;border-radius:6px;box-shadow:0 14px 30px #00000040;cursor:pointer}.node-card:hover{border-color:var(--acid);transform:translateY(-1px)}.node-card.blueprint{background:linear-gradient(145deg,#18201f,#15191a)}.node-card strong{font-size:13px}.node-kicker{color:#78827e;font:8px DM Mono;letter-spacing:.12em;text-transform:uppercase}.node-status{position:absolute;right:12px;top:12px;font:8px DM Mono;text-transform:uppercase;color:var(--muted)}.node-duration{color:var(--muted);font:9px DM Mono}.node-error{color:#ffaaa2;background:#762c2840;padding:5px;border-radius:3px;font-size:9px;max-height:42px;overflow:hidden}.node-card.status-success{border-color:#426b5c}.node-card.status-failed{border-color:#984d47}.node-card.status-running{border-color:#9aa64f;box-shadow:0 0 0 1px #d9ed721f,0 14px 30px #00000040}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:4px;border-top:1px solid var(--line);padding-top:8px}.field-grid>span{min-width:0}.field-grid small{display:block;color:#68726e;font-size:7px;text-transform:uppercase;margin-bottom:3px}.field{display:block;color:#b2bdb7;font:8px DM Mono;overflow:hidden;text-overflow:ellipsis}.react-flow__handle{width:7px;height:7px;background:var(--acid);border:1px solid #101314}.historical-badge{position:absolute;right:18px;bottom:18px;z-index:5;padding:9px 12px;background:#1a1815eb;border:1px solid #665642;color:#9d8f7c;font-size:9px;border-radius:4px}.historical-badge span{display:block;color:var(--amber);font:8px DM Mono;text-transform:uppercase;margin-bottom:3px}.empty-state{height:100%;display:grid;place-content:center;text-align:center;color:#66706c}.empty-state>span{color:var(--acid);font-size:40px}.empty-state h2{color:#c6cfca;margin:8px 0}.empty-state p{max-width:390px;font-size:12px}.inspector{min-width:0;background:var(--panel-raised);border-left:1px solid var(--line);overflow:hidden;display:grid;grid-template-rows:auto auto 1fr}.inspector>header{display:flex;justify-content:space-between;align-items:start;padding:19px 20px 14px;border-bottom:1px solid var(--line)}.inspector h2{margin:4px 0 5px;font-size:18px}.icon-button{width:30px;height:30px;background:none;border:1px solid var(--line);border-radius:4px;cursor:pointer;font-size:19px}.icon-button:hover{border-color:#69736f}.status-pill{display:inline-flex;padding:3px 7px;border:1px solid #48514e;border-radius:20px;color:var(--muted);font:8px DM Mono;text-transform:uppercase}.status-pill.status-failed{color:var(--red);border-color:#75413d}.status-pill.status-success{color:var(--mint);border-color:#355e50}.inspector-tabs{display:flex;overflow-x:auto;padding:0 10px;border-bottom:1px solid var(--line)}.inspector-tabs button{padding:11px 9px 9px;background:none;border:0;border-bottom:2px solid transparent;color:#727c77;font:8px DM Mono;text-transform:uppercase;cursor:pointer}.inspector-tabs button.active{color:var(--acid);border-bottom-color:var(--acid)}.inspector-body{overflow:auto;padding:18px 20px 30px}.inspector-body section{margin-bottom:23px}.inspector-body h3{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#a3ada8}.instructions{color:#c4cdc8;white-space:pre-wrap;font-size:12px;line-height:1.65}.signature-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px}.field-detail{border-top:1px solid var(--line);padding:8px 0}.field-detail strong,.field-detail code{display:block;font-size:10px}.field-detail code{color:#79837f;font-size:8px;margin-top:2px}.field-detail p{color:#78817d;font-size:9px;margin:4px 0 0}.declared-fields{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:10px}.declared-fields>small{width:100%;color:#69736e;font-size:8px;text-transform:uppercase}.declared-fields>span{display:inline-flex;gap:5px;padding:4px 6px;border:1px solid var(--line);background:#111516;font-size:9px}.declared-fields code{color:#77837d}.json-block{padding:11px;background:#101415;border:1px solid var(--line);border-radius:4px;overflow:auto;color:#aab5af;font-size:9px;white-space:pre-wrap}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.metric-grid>div{background:#111516;border:1px solid var(--line);padding:10px}.metric-grid small,.metric-grid strong{display:block}.metric-grid small{color:#68716e;font-size:7px;text-transform:uppercase}.metric-grid strong{margin-top:5px;font-size:11px}.node-failure{padding:10px;background:#3a2020;border:1px solid #713d39;color:#ffc1ba;font-size:10px}.trace-header,.value-object{margin:0}.trace-header>div,.value-object>div{display:grid;grid-template-columns:105px minmax(0,1fr);gap:10px;border-top:1px solid var(--line);padding:7px 0}.trace-header dt,.value-object dt{color:#727c77;font:8px DM Mono}.trace-header dd,.value-object dd{margin:0;font-size:10px;min-width:0}.empty-copy{color:#69736e;font-size:11px}.trace-layout{display:grid;grid-template-rows:auto 220px auto;gap:12px}.trace-toolbar{display:flex;justify-content:space-between;align-items:center}.trace-toolbar h3{margin:0 0 3px}.trace-toolbar span{color:#69736e;font:8px DM Mono}.toggle{background:none;border:1px solid #48514d;color:#818b86;border-radius:20px;padding:5px 8px;font:8px DM Mono;cursor:pointer}.toggle.active{color:var(--acid);border-color:#77834a}.turn-list{height:220px;overflow:auto;border:1px solid var(--line);background:#111516}.turn-row{position:absolute;left:0;top:0;width:100%;height:60px;display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px;background:transparent;border:0;border-bottom:1px solid var(--line);text-align:left;cursor:pointer}.turn-row:hover,.turn-row.active{background:#202627}.turn-row.active{box-shadow:inset 2px 0 var(--acid)}.turn-row.failed{box-shadow:inset 2px 0 var(--red)}.turn-row strong{font-size:10px}.turn-row span,.turn-row small{color:#78817d;font:8px DM Mono}.turn-row small{grid-column:1 / -1}.turn-detail{border-top:1px solid var(--line);padding-top:12px}.value-object .value-object{border-left:1px solid #313837;padding-left:8px}.value-string{color:#c4d99d;white-space:pre-wrap;overflow-wrap:anywhere}.value-scalar{color:#82c8cc}.value-null{color:#68716e}.value-unavailable{color:var(--amber);font-size:9px}.value-list{margin:0;padding-left:20px}.value-list li{margin:5px 0}.file-value{display:flex;gap:9px;padding:9px;border:1px solid #5f6441;background:#22251a;border-radius:4px;color:var(--acid)}.file-value small,.file-value code{display:block}.file-value small{color:#919976;font-size:7px;text-transform:uppercase}.file-value code{margin-top:3px;font-size:9px;overflow-wrap:anywhere}.log-list{margin-bottom:12px}.log-list button{width:100%;display:grid;grid-template-columns:48px 1fr auto;gap:7px;padding:7px 4px;border:0;border-bottom:1px solid var(--line);background:none;color:#929c97;text-align:left;font:8px DM Mono;cursor:pointer}.log-list button:hover{background:#202627}.log-level{text-transform:uppercase}.level-error{color:var(--red)}.level-warning{color:var(--amber)}.run-controls{display:flex;align-items:center;gap:7px;position:relative}.run-button,.cancel-button,.input-toggle{border-radius:4px;padding:8px 13px;cursor:pointer;font-size:10px}.run-button{background:var(--acid);border:1px solid var(--acid);color:#111412;font-weight:700}.cancel-button{background:#3a2221;border:1px solid #71403c;color:#f2a39b}.input-toggle{background:transparent;border:1px solid #3c4541;color:#89938e}.input-toggle.active{color:var(--acid);border-color:#6e7848}.run-controls button:disabled{opacity:.5;cursor:wait}.input-popover{position:absolute;z-index:20;right:0;top:43px;width:390px;padding:13px;background:#15191a;border:1px solid #4a5450;box-shadow:0 18px 50px #00000080}.input-popover>div:first-child{display:flex;justify-content:space-between;margin-bottom:9px}.input-popover strong{font-size:11px}.input-popover span{color:#6d7672;font:8px DM Mono}.json-editor{border:1px solid var(--line);font-size:10px}.action-error{position:absolute;z-index:21;right:0;top:44px;width:390px;border:1px solid #813c37}.input-popover+.action-error{top:205px}@media(max-width:1000px){.workspace,.workspace.with-inspector{grid-template-columns:230px minmax(0,1fr)}.inspector{position:fixed;z-index:30;right:0;top:58px;bottom:0;width:min(420px,calc(100vw - 230px));box-shadow:-20px 0 50px #00000073}.topbar{grid-template-columns:210px 1fr auto}}@media(max-width:700px){.workspace,.workspace.with-inspector{grid-template-columns:1fr}.explorer,.breadcrumb{display:none}.topbar{grid-template-columns:1fr auto}.view-header{align-items:flex-start;padding:13px 16px}.inspector{width:100vw;top:58px}.input-popover,.action-error{width:calc(100vw - 32px)}} +.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}:root{color:#17211c;background:#f6f8f7;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-synthesis:none;--panel: #ffffff;--panel-raised: #ffffff;--line: #dfe4e1;--muted: #68746e;--acid: #2563eb;--mint: #16805d;--amber: #a15c00;--red: #c43d36}*{box-sizing:border-box}html,body,#root{width:100%;height:100%;margin:0;overflow:hidden}button,input{font:inherit}button{color:inherit}code,pre,.eyebrow,small{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.app-shell{height:100%;display:grid;grid-template-rows:58px auto 1fr}.topbar{display:grid;grid-template-columns:260px 1fr auto;align-items:center;padding:0 20px;border-bottom:1px solid var(--line);background:#fff;z-index:10;box-shadow:0 1px 2px #141f1a0a}.brand{display:flex;align-items:center;gap:11px}.brand-mark{width:30px;height:30px;display:grid;place-items:center;color:#fff;background:var(--acid);font-weight:750;border-radius:8px}.brand div{display:flex;align-items:baseline;gap:7px}.brand strong{font-size:15px;letter-spacing:-.02em}.brand span:last-child{color:var(--muted);font:11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase}.breadcrumb{display:flex;justify-content:center;gap:9px;color:var(--muted);font-size:12px}.breadcrumb i{opacity:.4}.breadcrumb strong{color:#26322c;font-weight:600}.connection{display:flex;align-items:center;gap:8px;font:11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:capitalize}.connection>span{width:7px;height:7px;border-radius:50%;background:var(--amber)}.connection-live>span{background:var(--mint)}.connection small{color:#87918c;margin-left:5px}.connection-error,.action-error,.error-banner{background:#fff1f0;color:#9d2923;padding:8px 18px;font-size:12px;border-bottom:1px solid #efb9b5}.workspace{min-height:0;display:grid;grid-template-columns:280px minmax(0,1fr)}.workspace.with-inspector{grid-template-columns:280px minmax(0,1fr) 410px}.explorer{background:var(--panel);border-right:1px solid var(--line);overflow:auto;min-width:0}.explorer>header{padding:22px 18px 14px;position:relative}.eyebrow{display:block;color:var(--acid);font-size:9px;letter-spacing:.16em;text-transform:uppercase}h1,h2,h3,p{margin-top:0}.explorer h2{margin:5px 0 0;font-size:17px}.catalog-revision{position:absolute;right:18px;bottom:17px;color:#7b8680;font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.target-list{padding:4px 10px 30px}.target{border-top:1px solid var(--line);padding-top:7px;margin-top:4px}.target-heading,.tree-row,.tree-select,.run-select{width:100%;min-width:0}.target-heading,.tree-select,.run-select,.tree-disclosure{background:none;border:0;cursor:pointer;text-align:left}.target-heading{display:grid;grid-template-columns:12px 22px minmax(0,1fr);gap:5px;align-items:center;padding:8px 5px}.target-heading>span:first-child{color:#7a8580}.target-kind{width:20px;height:20px;border:1px solid #cbd2ce;border-radius:5px;display:grid;place-items:center;font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#55615b;background:#f7f9f8}.target-heading strong,.target-heading small,.tree-select strong,.tree-select small,.run-select strong,.run-select small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.target-heading strong{font-size:11px;font-weight:600}.target-heading small{color:#7b8680;font-size:8px;margin-top:2px}.workflow-list{border-left:1px solid #e2e7e4;margin-left:16px;padding-left:7px}.tree-row{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:stretch}.tree-disclosure{color:#75807b;text-align:center;padding:0}.tree-select{display:grid;grid-template-columns:23px minmax(0,1fr);gap:4px;padding:8px;border-radius:7px}.tree-select:hover,.run-select:hover,.tree-select.active,.run-select.active{background:#f1f4f2}.tree-select.active{box-shadow:inset 2px 0 var(--acid)}.workflow-glyph{color:var(--acid);font-size:16px}.tree-select strong{font-size:11px;font-weight:600}.tree-select small,.run-select small{color:#7b8680;font-size:8px;margin-top:3px}.run-branches{margin-left:28px;border-left:1px dashed #d9dfdc;padding:3px 0 6px 8px}.run-select{display:grid;grid-template-columns:20px minmax(0,1fr);gap:5px;align-items:center;padding:7px;border-radius:7px}.run-select strong{font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.run-dot{width:16px;height:16px;border-radius:50%;display:grid;place-items:center;font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#eef2f0;color:var(--muted)}.run-dot.status-success{color:var(--mint)}.run-dot.status-failed{color:var(--red)}.run-dot.status-running{color:var(--acid)}.no-runs{display:block;color:#8a948f;padding:7px;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.diagnostics{margin:0 12px 12px;padding:9px;background:#fff8eb;border:1px solid #ead1a2;border-radius:8px;font-size:10px}.diagnostics summary{color:var(--amber);cursor:pointer}.diagnostics div{margin-top:9px;border-top:1px solid #ead1a2;padding-top:8px}.diagnostics strong,.diagnostics span{display:block}.diagnostics span{color:#8b7655;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow:hidden;text-overflow:ellipsis}.diagnostics p{color:#735b37;margin:4px 0 0}.skeleton{padding:20px}.skeleton div{height:38px;background:#edf1ef;margin-bottom:9px;border-radius:7px;animation:pulse 1.2s infinite alternate}@keyframes pulse{to{opacity:.45}}.canvas-shell{min-width:0;min-height:0;display:grid;grid-template-rows:auto 1fr;background:#f7f9f8}.view-header{min-height:92px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 24px;border-bottom:1px solid var(--line)}.view-header h1{margin:4px 0 2px;font-size:22px;letter-spacing:-.035em}.view-header p{margin:0;color:var(--muted);font-size:11px}.canvas{position:relative;min-height:0}.blueprint-canvas{background:radial-gradient(circle,#dce3df 1px,transparent 1px),#f7f9f8;background-size:24px 24px}.run-canvas{background:radial-gradient(circle,#e1e4df 1px,transparent 1px),#fafaf8;background-size:24px 24px}.react-flow__controls{background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 14px #141f1a14;overflow:hidden}.react-flow__controls-button{background:#fff;border-bottom-color:var(--line);fill:#55615b}.react-flow__controls-button:hover{background:#f1f4f2}.react-flow__edge-path{stroke:#87938d;stroke-width:1.4}.react-flow__arrowhead polyline{stroke:#87938d;fill:#87938d}.node-card{width:248px;min-height:102px;position:relative;display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:15px;text-align:left;background:#fff;border:1px solid #d3dad6;border-radius:10px;box-shadow:0 8px 24px #19272014;cursor:pointer}.node-card:hover{border-color:var(--acid);transform:translateY(-1px);box-shadow:0 10px 28px #1927201f}.node-card.blueprint{background:#fff}.node-card strong{font-size:13px}.node-kicker{color:#77827c;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.12em;text-transform:uppercase}.node-status{position:absolute;right:12px;top:12px;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;color:var(--muted)}.node-duration{color:var(--muted);font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.node-error{color:#9d2923;background:#fff1f0;padding:5px;border-radius:5px;font-size:9px;max-height:42px;overflow:hidden}.node-card.status-success{border-color:#7ebda4}.node-card.status-failed{border-color:#df8d87}.node-card.status-running{border-color:#7ca2f6;box-shadow:0 0 0 2px #2563eb14,0 8px 24px #19272014}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:4px;border-top:1px solid var(--line);padding-top:8px}.field-grid>span{min-width:0}.field-grid small{display:block;color:#78837d;font-size:7px;text-transform:uppercase;margin-bottom:3px}.field{display:block;color:#36423c;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow:hidden;text-overflow:ellipsis}.react-flow__handle{width:7px;height:7px;background:var(--acid);border:1px solid #ffffff}.historical-badge{position:absolute;right:18px;bottom:18px;z-index:5;padding:9px 12px;background:#fffcf5f5;border:1px solid #dfc99e;color:#766548;font-size:9px;border-radius:8px;box-shadow:0 4px 14px #362c1914}.historical-badge span{display:block;color:var(--amber);font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;margin-bottom:3px}.empty-state{height:100%;display:grid;place-content:center;text-align:center;color:#6d7872}.empty-state>span{color:var(--acid);font-size:40px}.empty-state h2{color:#27332d;margin:8px 0}.empty-state p{max-width:390px;font-size:12px}.inspector{min-width:0;background:var(--panel-raised);border-left:1px solid var(--line);overflow:hidden;display:grid;grid-template-rows:auto auto 1fr}.inspector>header{display:flex;justify-content:space-between;align-items:start;padding:19px 20px 14px;border-bottom:1px solid var(--line)}.inspector h2{margin:4px 0 5px;font-size:18px}.icon-button{width:30px;height:30px;background:#fff;border:1px solid var(--line);border-radius:7px;cursor:pointer;font-size:19px}.icon-button:hover{border-color:#9da7a2;background:#f7f9f8}.status-pill{display:inline-flex;padding:3px 7px;border:1px solid #cbd2ce;border-radius:20px;color:var(--muted);font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;background:#f7f9f8}.status-pill.status-failed{color:var(--red);border-color:#e5aaa5;background:#fff5f4}.status-pill.status-success{color:var(--mint);border-color:#a6d1c0;background:#f2fbf7}.inspector-tabs{display:flex;overflow-x:auto;padding:0 10px;border-bottom:1px solid var(--line)}.inspector-tabs button{padding:11px 9px 9px;background:none;border:0;border-bottom:2px solid transparent;color:#6e7973;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;cursor:pointer}.inspector-tabs button.active{color:var(--acid);border-bottom-color:var(--acid)}.inspector-body{overflow:auto;padding:18px 20px 30px}.inspector-body section{margin-bottom:23px}.inspector-body h3{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#56615b}.instructions{color:#36423c;white-space:pre-wrap;font-size:12px;line-height:1.65}.signature-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px}.field-detail{border-top:1px solid var(--line);padding:8px 0}.field-detail strong,.field-detail code{display:block;font-size:10px}.field-detail code{color:#68746e;font-size:8px;margin-top:2px}.field-detail p{color:#737e78;font-size:9px;margin:4px 0 0}.declared-fields{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:10px}.declared-fields>small{width:100%;color:#717c76;font-size:8px;text-transform:uppercase}.declared-fields>span{display:inline-flex;gap:5px;padding:4px 6px;border:1px solid var(--line);background:#f7f9f8;border-radius:5px;font-size:9px}.declared-fields code{color:#5d6963}.json-block{padding:11px;background:#f6f8f7;border:1px solid var(--line);border-radius:7px;overflow:auto;color:#35413b;font-size:9px;white-space:pre-wrap}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.metric-grid>div{background:#f7f9f8;border:1px solid var(--line);border-radius:7px;padding:10px}.metric-grid small,.metric-grid strong{display:block}.metric-grid small{color:#717c76;font-size:7px;text-transform:uppercase}.metric-grid strong{margin-top:5px;font-size:11px}.node-failure{padding:10px;background:#fff1f0;border:1px solid #efb9b5;border-radius:7px;color:#9d2923;font-size:10px}.trace-header,.value-object{margin:0}.trace-header>div,.value-object>div{display:grid;grid-template-columns:105px minmax(0,1fr);gap:10px;border-top:1px solid var(--line);padding:7px 0}.trace-header dt,.value-object dt{color:#6f7a74;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.trace-header dd,.value-object dd{margin:0;font-size:10px;min-width:0}.empty-copy{color:#76817b;font-size:11px}.trace-layout{display:grid;grid-template-rows:auto 220px auto;gap:12px}.trace-toolbar{display:flex;justify-content:space-between;align-items:center}.trace-toolbar h3{margin:0 0 3px}.trace-toolbar span{color:#717c76;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.toggle{background:#fff;border:1px solid #cbd2ce;color:#647069;border-radius:20px;padding:5px 8px;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}.toggle.active{color:var(--acid);border-color:#9bb6f5;background:#f4f7ff}.turn-list{height:220px;overflow:auto;border:1px solid var(--line);background:#fff;border-radius:7px}.turn-row{position:absolute;left:0;top:0;width:100%;height:60px;display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px;background:transparent;border:0;border-bottom:1px solid var(--line);text-align:left;cursor:pointer}.turn-row:hover,.turn-row.active{background:#f1f4f2}.turn-row.active{box-shadow:inset 2px 0 var(--acid)}.turn-row.failed{box-shadow:inset 2px 0 var(--red)}.turn-row strong{font-size:10px}.turn-row span,.turn-row small{color:#748079;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.turn-row small{grid-column:1 / -1}.turn-detail{border-top:1px solid var(--line);padding-top:12px}.value-object .value-object{border-left:1px solid #dfe4e1;padding-left:8px}.value-string{color:#42722d;white-space:pre-wrap;overflow-wrap:anywhere}.value-scalar{color:#16697a}.value-null{color:#76817b}.value-unavailable{color:var(--amber);font-size:9px}.value-list{margin:0;padding-left:20px}.value-list li{margin:5px 0}.file-value{display:flex;gap:9px;padding:9px;border:1px solid #c3d2f5;background:#f5f8ff;border-radius:7px;color:#1d4ed8}.file-value small,.file-value code{display:block}.file-value small{color:#687aa2;font-size:7px;text-transform:uppercase}.file-value code{margin-top:3px;font-size:9px;overflow-wrap:anywhere}.log-list{margin-bottom:12px}.log-list button{width:100%;display:grid;grid-template-columns:48px 1fr auto;gap:7px;padding:7px 4px;border:0;border-bottom:1px solid var(--line);background:none;color:#59655f;text-align:left;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}.log-list button:hover{background:#f1f4f2}.log-level{text-transform:uppercase}.level-error{color:var(--red)}.level-warning{color:var(--amber)}.run-controls{display:flex;align-items:center;gap:7px;position:relative}.run-button,.cancel-button,.input-toggle{border-radius:7px;padding:8px 13px;cursor:pointer;font-size:10px}.run-button{background:var(--acid);border:1px solid var(--acid);color:#fff;font-weight:700}.run-button:hover{background:#1d4ed8;border-color:#1d4ed8}.cancel-button{background:#fff;border:1px solid #e0a6a1;color:#a92f29}.cancel-button:hover{background:#fff3f2}.input-toggle{background:#fff;border:1px solid #cbd2ce;color:#5e6a64}.input-toggle.active{color:var(--acid);border-color:#9bb6f5;background:#f4f7ff}.run-controls button:disabled{opacity:.5;cursor:wait}.input-popover{position:absolute;z-index:20;right:0;top:43px;width:390px;padding:13px;background:#fff;border:1px solid #cbd2ce;border-radius:9px;box-shadow:0 18px 50px #141f1a29}.input-popover>div:first-child{display:flex;justify-content:space-between;margin-bottom:9px}.input-popover strong{font-size:11px}.input-popover span{color:#6d7872;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.json-editor{border:1px solid var(--line);border-radius:7px;overflow:hidden;font-size:10px}.action-error{position:absolute;z-index:21;right:0;top:44px;width:390px;border:1px solid #efb9b5;border-radius:7px}.input-popover+.action-error{top:205px}@media(max-width:1000px){.workspace,.workspace.with-inspector{grid-template-columns:230px minmax(0,1fr)}.inspector{position:fixed;z-index:30;right:0;top:58px;bottom:0;width:min(420px,calc(100vw - 230px));box-shadow:-20px 0 50px #141f1a24}.topbar{grid-template-columns:210px 1fr auto}}@media(max-width:700px){.workspace,.workspace.with-inspector{grid-template-columns:1fr}.explorer,.breadcrumb{display:none}.topbar{grid-template-columns:1fr auto}.view-header{align-items:flex-start;padding:13px 16px}.inspector{width:100vw;top:58px}.input-popover,.action-error{width:calc(100vw - 32px)}} diff --git a/src/runtime/operator/web_assets/assets/index-B3SIpuZV.js b/src/runtime/operator/web_assets/assets/index-K_C1Akn9.js similarity index 99% rename from src/runtime/operator/web_assets/assets/index-B3SIpuZV.js rename to src/runtime/operator/web_assets/assets/index-K_C1Akn9.js index 1ce75a0..fe26687 100644 --- a/src/runtime/operator/web_assets/assets/index-B3SIpuZV.js +++ b/src/runtime/operator/web_assets/assets/index-K_C1Akn9.js @@ -6,4 +6,4 @@ import{r as jm,a as Dm,b as J,j as p,H as Qd,P as Kd,M as Mm,i as _m,B as Rm,C a `+b[l].replace(" at new "," at ");return t.displayName&&x.includes("")&&(x=x.replace("",t.displayName)),x}while(1<=l&&0<=u);break}}}finally{lu=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?An(n):""}function uh(t,e){switch(t.tag){case 26:case 27:case 5:return An(t.type);case 16:return An("Lazy");case 13:return t.child!==e&&e!==null?An("Suspense Fallback"):An("Suspense");case 19:return An("SuspenseList");case 0:case 15:return au(t.type,!1);case 11:return au(t.type.render,!1);case 1:return au(t.type,!0);case 31:return An("Activity");default:return""}}function Gc(t){try{var e="",n=null;do e+=uh(t,n),n=t,t=t.return;while(t);return e}catch(l){return` Error generating stack: `+l.message+` `+l.stack}}var iu=Object.prototype.hasOwnProperty,uu=y.unstable_scheduleCallback,su=y.unstable_cancelCallback,sh=y.unstable_shouldYield,ch=y.unstable_requestPaint,ne=y.unstable_now,oh=y.unstable_getCurrentPriorityLevel,Xc=y.unstable_ImmediatePriority,Qc=y.unstable_UserBlockingPriority,Ua=y.unstable_NormalPriority,fh=y.unstable_LowPriority,Kc=y.unstable_IdlePriority,rh=y.log,dh=y.unstable_setDisableYieldValue,Cl=null,le=null;function Pe(t){if(typeof rh=="function"&&dh(t),le&&typeof le.setStrictMode=="function")try{le.setStrictMode(Cl,t)}catch{}}var ae=Math.clz32?Math.clz32:mh,hh=Math.log,gh=Math.LN2;function mh(t){return t>>>=0,t===0?32:31-(hh(t)/gh|0)|0}var Ba=256,qa=262144,Ca=4194304;function On(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function La(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var u=0,s=t.suspendedLanes,r=t.pingedLanes;t=t.warmLanes;var h=l&134217727;return h!==0?(l=h&~s,l!==0?u=On(l):(r&=h,r!==0?u=On(r):n||(n=h&~t,n!==0&&(u=On(n))))):(h=l&~s,h!==0?u=On(h):r!==0?u=On(r):n||(n=l&~t,n!==0&&(u=On(n)))),u===0?0:e!==0&&e!==u&&(e&s)===0&&(s=u&-u,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:u}function Ll(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function yh(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zc(){var t=Ca;return Ca<<=1,(Ca&62914560)===0&&(Ca=4194304),t}function cu(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Hl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ph(t,e,n,l,u,s){var r=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,b=t.expirationTimes,N=t.hiddenUpdates;for(n=r&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var zh=/[\n"\\]/g;function me(t){return t.replace(zh,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function gu(t,e,n,l,u,s,r,h){t.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.type=r:t.removeAttribute("type"),e!=null?r==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ge(e)):t.value!==""+ge(e)&&(t.value=""+ge(e)):r!=="submit"&&r!=="reset"||t.removeAttribute("value"),e!=null?mu(t,r,ge(e)):n!=null?mu(t,r,ge(n)):l!=null&&t.removeAttribute("value"),u==null&&s!=null&&(t.defaultChecked=!!s),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+ge(h):t.removeAttribute("name")}function uo(t,e,n,l,u,s,r,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){hu(t);return}n=n!=null?""+ge(n):"",e=e!=null?""+ge(e):n,h||e===t.value||(t.value=e),t.defaultValue=e}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=h?t.checked:!!l,t.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.name=r),hu(t)}function mu(t,e,n){e==="number"&&Ya(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Pn(t,e,n,l){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=!1;if(Ue)try{var Xl={};Object.defineProperty(Xl,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{Su=!1}var en=null,Tu=null,Xa=null;function go(){if(Xa)return Xa;var t,e=Tu,n=e.length,l,u="value"in en?en.value:en.textContent,s=u.length;for(t=0;t=Zl),So=" ",To=!1;function ko(t,e){switch(t){case"keyup":return Fh.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ll=!1;function Ph(t,e){switch(t){case"compositionend":return zo(e);case"keypress":return e.which!==32?null:(To=!0,So);case"textInput":return t=e.data,t===So&&To?null:t;default:return null}}function tg(t,e){if(ll)return t==="compositionend"||!Au&&ko(t,e)?(t=go(),Xa=Tu=en=null,ll=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Mo(n)}}function Ro(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ro(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function wo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ya(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ya(t.document)}return e}function ju(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var cg=Ue&&"documentMode"in document&&11>=document.documentMode,al=null,Du=null,Fl=null,Mu=!1;function Uo(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mu||al==null||al!==Ya(l)||(l=al,"selectionStart"in l&&ju(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Fl&&Wl(Fl,l)||(Fl=l,l=qi(Du,"onSelect"),0>=r,u-=r,je=1<<32-ae(e)+u|n<P?(it=L,L=null):it=L.sibling;var rt=A(k,L,E[P],D);if(rt===null){L===null&&(L=it);break}t&&L&&rt.alternate===null&&e(k,L),T=s(rt,T,P),ft===null?V=rt:ft.sibling=rt,ft=rt,L=it}if(P===E.length)return n(k,L),st&&qe(k,P),V;if(L===null){for(;PP?(it=L,L=null):it=L.sibling;var En=A(k,L,rt.value,D);if(En===null){L===null&&(L=it);break}t&&L&&En.alternate===null&&e(k,L),T=s(En,T,P),ft===null?V=En:ft.sibling=En,ft=En,L=it}if(rt.done)return n(k,L),st&&qe(k,P),V;if(L===null){for(;!rt.done;P++,rt=E.next())rt=_(k,rt.value,D),rt!==null&&(T=s(rt,T,P),ft===null?V=rt:ft.sibling=rt,ft=rt);return st&&qe(k,P),V}for(L=l(L);!rt.done;P++,rt=E.next())rt=O(L,k,P,rt.value,D),rt!==null&&(t&&rt.alternate!==null&&L.delete(rt.key===null?P:rt.key),T=s(rt,T,P),ft===null?V=rt:ft.sibling=rt,ft=rt);return t&&L.forEach(function(xm){return e(k,xm)}),st&&qe(k,P),V}function vt(k,T,E,D){if(typeof E=="object"&&E!==null&&E.type===G&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case C:t:{for(var V=E.key;T!==null;){if(T.key===V){if(V=E.type,V===G){if(T.tag===7){n(k,T.sibling),D=u(T,E.props.children),D.return=k,k=D;break t}}else if(T.elementType===V||typeof V=="object"&&V!==null&&V.$$typeof===jt&&Cn(V)===T.type){n(k,T.sibling),D=u(T,E.props),la(D,E),D.return=k,k=D;break t}n(k,T);break}else e(k,T);T=T.sibling}E.type===G?(D=Rn(E.props.children,k.mode,D,E.key),D.return=k,k=D):(D=ti(E.type,E.key,E.props,null,k.mode,D),la(D,E),D.return=k,k=D)}return r(k);case Y:t:{for(V=E.key;T!==null;){if(T.key===V)if(T.tag===4&&T.stateNode.containerInfo===E.containerInfo&&T.stateNode.implementation===E.implementation){n(k,T.sibling),D=u(T,E.children||[]),D.return=k,k=D;break t}else{n(k,T);break}else e(k,T);T=T.sibling}D=Cu(E,k.mode,D),D.return=k,k=D}return r(k);case jt:return E=Cn(E),vt(k,T,E,D)}if(he(E))return q(k,T,E,D);if(Ht(E)){if(V=Ht(E),typeof V!="function")throw Error(o(150));return E=V.call(E),X(k,T,E,D)}if(typeof E.then=="function")return vt(k,T,si(E),D);if(E.$$typeof===tt)return vt(k,T,li(k,E),D);ci(k,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,T!==null&&T.tag===6?(n(k,T.sibling),D=u(T,E),D.return=k,k=D):(n(k,T),D=qu(E,k.mode,D),D.return=k,k=D),r(k)):n(k,T)}return function(k,T,E,D){try{na=0;var V=vt(k,T,E,D);return ml=null,V}catch(L){if(L===gl||L===ii)throw L;var ft=ue(29,L,null,k.mode);return ft.lanes=D,ft.return=k,ft}}}var Hn=af(!0),uf=af(!1),sn=!1;function Wu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fu(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function on(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(dt&2)!==0){var u=l.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),l.pending=e,e=Pa(t),Yo(t,null,n),e}return Ia(t,l,e,n),Pa(t)}function aa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,$c(t,n)}}function Iu(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var u=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?u=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?u=s=e:s=s.next=e}else u=s=e;n={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Pu=!1;function ia(){if(Pu){var t=hl;if(t!==null)throw t}}function ua(t,e,n,l){Pu=!1;var u=t.updateQueue;sn=!1;var s=u.firstBaseUpdate,r=u.lastBaseUpdate,h=u.shared.pending;if(h!==null){u.shared.pending=null;var b=h,N=b.next;b.next=null,r===null?s=N:r.next=N,r=b;var x=t.alternate;x!==null&&(x=x.updateQueue,h=x.lastBaseUpdate,h!==r&&(h===null?x.firstBaseUpdate=N:h.next=N,x.lastBaseUpdate=b))}if(s!==null){var _=u.baseState;r=0,x=N=b=null,h=s;do{var A=h.lane&-536870913,O=A!==h.lane;if(O?(at&A)===A:(l&A)===A){A!==0&&A===dl&&(Pu=!0),x!==null&&(x=x.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var q=t,X=h;A=e;var vt=n;switch(X.tag){case 1:if(q=X.payload,typeof q=="function"){_=q.call(vt,_,A);break t}_=q;break t;case 3:q.flags=q.flags&-65537|128;case 0:if(q=X.payload,A=typeof q=="function"?q.call(vt,_,A):q,A==null)break t;_=j({},_,A);break t;case 2:sn=!0}}A=h.callback,A!==null&&(t.flags|=64,O&&(t.flags|=8192),O=u.callbacks,O===null?u.callbacks=[A]:O.push(A))}else O={lane:A,tag:h.tag,payload:h.payload,callback:h.callback,next:null},x===null?(N=x=O,b=_):x=x.next=O,r|=A;if(h=h.next,h===null){if(h=u.shared.pending,h===null)break;O=h,h=O.next,O.next=null,u.lastBaseUpdate=O,u.shared.pending=null}}while(!0);x===null&&(b=_),u.baseState=b,u.firstBaseUpdate=N,u.lastBaseUpdate=x,s===null&&(u.shared.lanes=0),gn|=r,t.lanes=r,t.memoizedState=_}}function sf(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function cf(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ts?s:8;var r=M.T,h={};M.T=h,vs(t,!1,e,n);try{var b=u(),N=M.S;if(N!==null&&N(h,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var x=pg(b,l);oa(t,e,x,re(t))}else oa(t,e,l,re(t))}catch(_){oa(t,e,{then:function(){},status:"rejected",reason:_},re())}finally{B.p=s,r!==null&&h.types!==null&&(r.types=h.types),M.T=r}}function zg(){}function ys(t,e,n,l){if(t.tag!==5)throw Error(o(476));var u=Hf(t).queue;Lf(t,u,e,Q,n===null?zg:function(){return Vf(t),n(l)})}function Hf(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:Q},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Vf(t){var e=Hf(t);e.next===null&&(e=t.alternate.memoizedState),oa(t,e.next.queue,{},re())}function ps(){return Gt(Aa)}function Yf(){return xt().memoizedState}function Gf(){return xt().memoizedState}function Eg(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=re();t=cn(n);var l=on(e,t,n);l!==null&&(ee(l,e,n),aa(l,e,n)),e={cache:Ku()},t.payload=e;return}e=e.return}}function Ng(t,e,n){var l=re();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},vi(t)?Qf(e,n):(n=Uu(t,e,n,l),n!==null&&(ee(n,t,l),Kf(n,e,l)))}function Xf(t,e,n){var l=re();oa(t,e,n,l)}function oa(t,e,n,l){var u={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(vi(t))Qf(e,u);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var r=e.lastRenderedState,h=s(r,n);if(u.hasEagerState=!0,u.eagerState=h,ie(h,r))return Ia(t,e,u,0),St===null&&Fa(),!1}catch{}if(n=Uu(t,e,u,l),n!==null)return ee(n,t,l),Kf(n,e,l),!0}return!1}function vs(t,e,n,l){if(l={lane:2,revertLane:Ws(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},vi(t)){if(e)throw Error(o(479))}else e=Uu(t,n,l,2),e!==null&&ee(e,t,2)}function vi(t){var e=t.alternate;return t===I||e!==null&&e===I}function Qf(t,e){pl=ri=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Kf(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,$c(t,n)}}var fa={readContext:Gt,use:gi,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};fa.useEffectEvent=Et;var Zf={readContext:Gt,use:gi,useCallback:function(t,e){return Zt().memoizedState=[t,e===void 0?null:e],t},useContext:Gt,useEffect:Df,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,yi(4194308,4,wf.bind(null,e,t),n)},useLayoutEffect:function(t,e){return yi(4194308,4,t,e)},useInsertionEffect:function(t,e){yi(4,2,t,e)},useMemo:function(t,e){var n=Zt();e=e===void 0?null:e;var l=t();if(Vn){Pe(!0);try{t()}finally{Pe(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=Zt();if(n!==void 0){var u=n(e);if(Vn){Pe(!0);try{n(e)}finally{Pe(!1)}}}else u=e;return l.memoizedState=l.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},l.queue=t,t=t.dispatch=Ng.bind(null,I,t),[l.memoizedState,t]},useRef:function(t){var e=Zt();return t={current:t},e.memoizedState=t},useState:function(t){t=rs(t);var e=t.queue,n=Xf.bind(null,I,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(t,e){var n=Zt();return ms(n,t,e)},useTransition:function(){var t=rs(!1);return t=Lf.bind(null,I,t.queue,!0,!1),Zt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=I,u=Zt();if(st){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),St===null)throw Error(o(349));(at&127)!==0||gf(l,e,n)}u.memoizedState=n;var s={value:n,getSnapshot:e};return u.queue=s,Df(yf.bind(null,l,s,t),[t]),l.flags|=2048,bl(9,{destroy:void 0},mf.bind(null,l,s,n,e),null),n},useId:function(){var t=Zt(),e=St.identifierPrefix;if(st){var n=De,l=je;n=(l&~(1<<32-ae(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=di++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(u,{is:l.is}):r.createElement(u)}}s[Vt]=e,s[$t]=l;t:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break t;for(;r.sibling===null;){if(r.return===null||r.return===e)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=s;t:switch(Qt(s,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&Ge(e)}}return kt(e),_s(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Ge(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(o(166));if(t=Ie.current,fl(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,u=Yt,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}t[Vt]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||dd(t.nodeValue,n)),t||an(e,!0)}else t=Ci(t).createTextNode(l),t[Vt]=e,e.stateNode=t}return kt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=fl(e),n!==null){if(t===null){if(!l)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Vt]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),t=!1}else n=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(ce(e),e):(ce(e),null);if((e.flags&128)!==0)throw Error(o(558))}return kt(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=fl(e),l!==null&&l.dehydrated!==null){if(t===null){if(!u)throw Error(o(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Vt]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),u=!1}else u=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(ce(e),e):(ce(e),null)}return ce(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),zi(e,e.updateQueue),kt(e),null);case 4:return Zn(),t===null&&tc(e.stateNode.containerInfo),kt(e),null;case 10:return Le(e.type),kt(e),null;case 19:if(ct(Ot),l=e.memoizedState,l===null)return kt(e),null;if(u=(e.flags&128)!==0,s=l.rendering,s===null)if(u)da(l,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=fi(t),s!==null){for(e.flags|=128,da(l,!1),t=s.updateQueue,e.updateQueue=t,zi(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Go(n,t),n=n.sibling;return ot(Ot,Ot.current&1|2),st&&qe(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&ne()>xi&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304)}else{if(!u)if(t=fi(s),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,zi(e,t),da(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!st)return kt(e),null}else 2*ne()-l.renderingStartTime>xi&&n!==536870912&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304);l.isBackwards?(s.sibling=e.child,e.child=s):(t=l.last,t!==null?t.sibling=s:e.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ne(),t.sibling=null,n=Ot.current,ot(Ot,u?n&1|2:n&1),st&&qe(e,l.treeForkCount),t):(kt(e),null);case 22:case 23:return ce(e),es(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(kt(e),e.subtreeFlags&6&&(e.flags|=8192)):kt(e),n=e.updateQueue,n!==null&&zi(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&ct(qn),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Le(Mt),kt(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function Dg(t,e){switch(Hu(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Le(Mt),Zn(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return wa(e),null;case 31:if(e.memoizedState!==null){if(ce(e),e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ce(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(Ot),null;case 4:return Zn(),null;case 10:return Le(e.type),null;case 22:case 23:return ce(e),es(),t!==null&&ct(qn),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Le(Mt),null;case 25:return null;default:return null}}function pr(t,e){switch(Hu(e),e.tag){case 3:Le(Mt),Zn();break;case 26:case 27:case 5:wa(e);break;case 4:Zn();break;case 31:e.memoizedState!==null&&ce(e);break;case 13:ce(e);break;case 19:ct(Ot);break;case 10:Le(e.type);break;case 22:case 23:ce(e),es(),t!==null&&ct(qn);break;case 24:Le(Mt)}}function ha(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var u=l.next;n=u;do{if((n.tag&t)===t){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==u)}}catch(h){mt(e,e.return,h)}}function dn(t,e,n){try{var l=e.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var s=u.next;l=s;do{if((l.tag&t)===t){var r=l.inst,h=r.destroy;if(h!==void 0){r.destroy=void 0,u=e;var b=n,N=h;try{N()}catch(x){mt(u,b,x)}}}l=l.next}while(l!==s)}}catch(x){mt(e,e.return,x)}}function vr(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{cf(e,n)}catch(l){mt(t,t.return,l)}}}function br(t,e,n){n.props=Yn(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){mt(t,e,l)}}function ga(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(u){mt(t,e,u)}}function Me(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(u){mt(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){mt(t,e,u)}else n.current=null}function Sr(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(u){mt(t,t.return,u)}}function Rs(t,e,n){try{var l=t.stateNode;Ig(l,t.type,n,e),l[$t]=e}catch(u){mt(t,t.return,u)}}function Tr(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bn(t.type)||t.tag===4}function ws(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Tr(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Us(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=we));else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Us(t,e,n),t=t.sibling;t!==null;)Us(t,e,n),t=t.sibling}function Ei(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ei(t,e,n),t=t.sibling;t!==null;)Ei(t,e,n),t=t.sibling}function kr(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);Qt(e,l,n),e[Vt]=t,e[$t]=n}catch(s){mt(t,t.return,s)}}var Xe=!1,wt=!1,Bs=!1,zr=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function Mg(t,e){if(t=t.containerInfo,lc=Qi,t=wo(t),ju(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var u=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var r=0,h=-1,b=-1,N=0,x=0,_=t,A=null;e:for(;;){for(var O;_!==n||u!==0&&_.nodeType!==3||(h=r+u),_!==s||l!==0&&_.nodeType!==3||(b=r+l),_.nodeType===3&&(r+=_.nodeValue.length),(O=_.firstChild)!==null;)A=_,_=O;for(;;){if(_===t)break e;if(A===n&&++N===u&&(h=r),A===s&&++x===l&&(b=r),(O=_.nextSibling)!==null)break;_=A,A=_.parentNode}_=O}n=h===-1||b===-1?null:{start:h,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(ac={focusedElem:t,selectionRange:n},Qi=!1,Lt=e;Lt!==null;)if(e=Lt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Lt=t;else for(;Lt!==null;){switch(e=Lt,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),Qt(s,l,n),s[Vt]=t,Ct(s),l=s;break t;case"link":var r=jd("link","href",u).get(l+(n.href||""));if(r){for(var h=0;hvt&&(r=vt,vt=X,X=r);var k=_o(h,X),T=_o(h,vt);if(k&&T&&(O.rangeCount!==1||O.anchorNode!==k.node||O.anchorOffset!==k.offset||O.focusNode!==T.node||O.focusOffset!==T.offset)){var E=_.createRange();E.setStart(k.node,k.offset),O.removeAllRanges(),X>vt?(O.addRange(E),O.extend(T.node,T.offset)):(E.setEnd(T.node,T.offset),O.addRange(E))}}}}for(_=[],O=h;O=O.parentNode;)O.nodeType===1&&_.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<_.length;h++){var D=_[h];D.element.scrollLeft=D.left,D.element.scrollTop=D.top}}Qi=!!lc,ac=lc=null}finally{dt=u,B.p=l,M.T=n}}t.current=e,Ut=2}}function Wr(){if(Ut===2){Ut=0;var t=yn,e=El,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=M.T,M.T=null;var l=B.p;B.p=2;var u=dt;dt|=4;try{Er(t,e.alternate,e)}finally{dt=u,B.p=l,M.T=n}}Ut=3}}function Fr(){if(Ut===4||Ut===3){Ut=0,ch();var t=yn,e=El,n=$e,l=qr;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?Ut=5:(Ut=0,El=yn=null,Ir(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(mn=null),fu(n),e=e.stateNode,le&&typeof le.onCommitFiberRoot=="function")try{le.onCommitFiberRoot(Cl,e,void 0,(e.current.flags&128)===128)}catch{}if(l!==null){e=M.T,u=B.p,B.p=2,M.T=null;try{for(var s=t.onRecoverableError,r=0;rn?32:n,M.T=null,n=Gs,Gs=null;var s=yn,r=$e;if(Ut=0,El=yn=null,$e=0,(dt&6)!==0)throw Error(o(331));var h=dt;if(dt|=4,wr(s.current),Mr(s,s.current,r,n),dt=h,Sa(0,!1),le&&typeof le.onPostCommitFiberRoot=="function")try{le.onPostCommitFiberRoot(Cl,s)}catch{}return!0}finally{B.p=u,M.T=l,Ir(t,e)}}function td(t,e,n){e=pe(n,e),e=ks(t.stateNode,e,2),t=on(t,e,2),t!==null&&(Hl(t,2),_e(t))}function mt(t,e,n){if(t.tag===3)td(t,t,n);else for(;e!==null;){if(e.tag===3){td(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(mn===null||!mn.has(l))){t=pe(n,t),n=er(2),l=on(e,n,2),l!==null&&(nr(n,l,e,t),Hl(l,2),_e(l));break}}e=e.return}}function Zs(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new wg;var u=new Set;l.set(e,u)}else u=l.get(e),u===void 0&&(u=new Set,l.set(e,u));u.has(n)||(Ls=!0,u.add(n),t=Lg.bind(null,t,e,n),e.then(t,t))}function Lg(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,St===t&&(at&n)===n&&(Nt===4||Nt===3&&(at&62914560)===at&&300>ne()-Oi?(dt&2)===0&&Nl(t,0):Hs|=n,zl===at&&(zl=0)),_e(t)}function ed(t,e){e===0&&(e=Zc()),t=_n(t,e),t!==null&&(Hl(t,e),_e(t))}function Hg(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),ed(t,n)}function Vg(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(e),ed(t,n)}function Yg(t,e){return uu(t,e)}var wi=null,Ol=null,Js=!1,Ui=!1,$s=!1,vn=0;function _e(t){t!==Ol&&t.next===null&&(Ol===null?wi=Ol=t:Ol=Ol.next=t),Ui=!0,Js||(Js=!0,Xg())}function Sa(t,e){if(!$s&&Ui){$s=!0;do for(var n=!1,l=wi;l!==null;){if(t!==0){var u=l.pendingLanes;if(u===0)var s=0;else{var r=l.suspendedLanes,h=l.pingedLanes;s=(1<<31-ae(42|t)+1)-1,s&=u&~(r&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,id(l,s))}else s=at,s=La(l,l===St?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Ll(l,s)||(n=!0,id(l,s));l=l.next}while(n);$s=!1}}function Gg(){nd()}function nd(){Ui=Js=!1;var t=0;vn!==0&&tm()&&(t=vn);for(var e=ne(),n=null,l=wi;l!==null;){var u=l.next,s=ld(l,e);s===0?(l.next=null,n===null?wi=u:n.next=u,u===null&&(Ol=n)):(n=l,(t!==0||(s&3)!==0)&&(Ui=!0)),l=u}Ut!==0&&Ut!==5||Sa(t),vn!==0&&(vn=0)}function ld(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,u=t.expirationTimes,s=t.pendingLanes&-62914561;0h)break;var x=b.transferSize,_=b.initiatorType;x&&hd(_)&&(b=b.responseEnd,r+=x*(b"u"?null:document;function Nd(t,e,n){var l=xl;if(l&&typeof e=="string"&&e){var u=me(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Ed.has(u)||(Ed.add(u),t={rel:t,crossOrigin:n,href:e},l.querySelector(u)===null&&(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function om(t){We.D(t),Nd("dns-prefetch",t,null)}function fm(t,e){We.C(t,e),Nd("preconnect",t,e)}function rm(t,e,n){We.L(t,e,n);var l=xl;if(l&&t&&e){var u='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+me(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+me(n.imageSizes)+'"]')):u+='[href="'+me(t)+'"]';var s=u;switch(e){case"style":s=jl(t);break;case"script":s=Dl(t)}ze.has(s)||(t=j({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),ze.set(s,t),l.querySelector(u)!==null||e==="style"&&l.querySelector(Ea(s))||e==="script"&&l.querySelector(Na(s))||(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function dm(t,e){We.m(t,e);var n=xl;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+me(l)+'"][href="'+me(t)+'"]',s=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Dl(t)}if(!ze.has(s)&&(t=j({rel:"modulepreload",href:t},e),ze.set(s,t),n.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Na(s)))return}l=n.createElement("link"),Qt(l,"link",t),Ct(l),n.head.appendChild(l)}}}function hm(t,e,n){We.S(t,e,n);var l=xl;if(l&&t){var u=Fn(l).hoistableStyles,s=jl(t);e=e||"default";var r=u.get(s);if(!r){var h={loading:0,preload:null};if(r=l.querySelector(Ea(s)))h.loading=5;else{t=j({rel:"stylesheet",href:t,"data-precedence":e},n),(n=ze.get(s))&&rc(t,n);var b=r=l.createElement("link");Ct(b),Qt(b,"link",t),b._p=new Promise(function(N,x){b.onload=N,b.onerror=x}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Hi(r,e,l)}r={type:"stylesheet",instance:r,count:1,state:h},u.set(s,r)}}}function gm(t,e){We.X(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function mm(t,e){We.M(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0,type:"module"},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function Ad(t,e,n,l){var u=(u=Ie.current)?Li(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=jl(n.href),n=Fn(u).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=jl(n.href);var s=Fn(u).hoistableStyles,r=s.get(t);if(r||(u=u.ownerDocument||u,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,r),(s=u.querySelector(Ea(t)))&&!s._p&&(r.instance=s,r.state.loading=5),ze.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ze.set(t,n),s||ym(u,t,n,r.state))),e&&l===null)throw Error(o(528,""));return r}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Dl(n),n=Fn(u).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function jl(t){return'href="'+me(t)+'"'}function Ea(t){return'link[rel="stylesheet"]['+t+"]"}function Od(t){return j({},t,{"data-precedence":t.precedence,precedence:null})}function ym(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),Qt(e,"link",n),Ct(e),t.head.appendChild(e))}function Dl(t){return'[src="'+me(t)+'"]'}function Na(t){return"script[async]"+t}function xd(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+me(n.href)+'"]');if(l)return e.instance=l,Ct(l),l;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ct(l),Qt(l,"style",u),Hi(l,n.precedence,t),e.instance=l;case"stylesheet":u=jl(n.href);var s=t.querySelector(Ea(u));if(s)return e.state.loading|=4,e.instance=s,Ct(s),s;l=Od(n),(u=ze.get(u))&&rc(l,u),s=(t.ownerDocument||t).createElement("link"),Ct(s);var r=s;return r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),e.state.loading|=4,Hi(s,n.precedence,t),e.instance=s;case"script":return s=Dl(n.src),(u=t.querySelector(Na(s)))?(e.instance=u,Ct(u),u):(l=n,(u=ze.get(s))&&(l=j({},n),dc(l,u)),t=t.ownerDocument||t,u=t.createElement("script"),Ct(u),Qt(u,"link",l),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,Hi(l,n.precedence,t));return e.instance}function Hi(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,s=u,r=0;r title"):null)}function pm(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Md(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function vm(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=jl(l.href),s=e.querySelector(Ea(u));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Yi.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,Ct(s);return}s=e.ownerDocument||e,l=Od(l),(u=ze.get(u))&&rc(l,u),s=s.createElement("link"),Ct(s);var r=s;r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Yi.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var hc=0;function bm(t,e){return t.stylesheets&&t.count===0&&Xi(t,t.stylesheets),0hc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Yi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xi(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Gi=null;function Xi(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gi=new Map,e.forEach(Sm,t),Gi=null,Yi.call(t))}function Sm(t,e){if(!(e.state.loading&4)){var n=Gi.get(t);if(n)var l=n.get(null);else{n=new Map,Gi.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y)}catch(a){console.error(a)}}return y(),Sc.exports=Gm(),Sc.exports}var Qm=Xm();class Km extends W{constructor(){super("avalanche.operator.Empty",[])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poszc},{no:6,name:"run_id",kind:"scalar",T:9},{no:7,name:"workflow_selector",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.flowName="",i.inputJson="",i.contextJson="",i.inputFiles=[],i.runId="",i.workflowSelector="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:3,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.agentMetadataJson={},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:5,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"cron",kind:"scalar",T:9},{no:8,name:"next_run_at",kind:"scalar",T:1},{no:9,name:"last_run_at",kind:"scalar",T:1},{no:10,name:"workflow_id",kind:"scalar",T:9},{no:11,name:"display_name",kind:"scalar",T:9},{no:12,name:"root_alias",kind:"scalar",T:9},{no:13,name:"relative_file",kind:"scalar",T:9},{no:14,name:"builder_symbol",kind:"scalar",T:9},{no:15,name:"agent_node_ids",kind:"scalar",repeat:2,T:9},{no:16,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:17,name:"webhook_path",kind:"scalar",T:9},{no:18,name:"webhook_url",kind:"scalar",T:9},{no:19,name:"webhook_active",kind:"scalar",T:8}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.name="",i.filePath="",i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.cron="",i.nextRunAt=0,i.lastRunAt=0,i.workflowId="",i.displayName="",i.rootAlias="",i.relativeFile="",i.builderSymbol="",i.agentNodeIds=[],i.agentMetadataJson={},i.webhookPath="",i.webhookUrl="",i.webhookActive=!1,a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posEc},{no:5,name:"scan_targets",kind:"message",repeat:2,T:()=>Ac},{no:6,name:"diagnostics",kind:"message",repeat:2,T:()=>Nc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.revision="0",i.workflows=[],i.scanTargets=[],i.diagnostics=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posOc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.valueJson="",i.files=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posxc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.status="",i.revision="0",i.available=!1,i.complete=!1,i.eventCount="0",i.sizeBytes="0",i.latestEventSequence="0",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl},{no:8,name:"revision",kind:"scalar",T:4},{no:9,name:"event_page_token",kind:"scalar",T:9},{no:10,name:"error",kind:"scalar",opt:!0,T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeId="",i.name="",i.nodeType="",i.status="",i.startedAt=0,i.endedAt=0,i.revision="0",i.eventPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:5,name:"latest_log_sequence",kind:"scalar",T:4},{no:6,name:"log_page_token",kind:"scalar",T:9},{no:7,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.nodes=[],i.latestLogSequence="0",i.logPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.logs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql},{no:6,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runId="",i.nodeId="",i.events=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:2,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:3,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodes=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posPi}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posjc},{no:3,name:"run_status_changed",kind:"message",oneof:"change",T:()=>Dc},{no:4,name:"node_status_changed",kind:"message",oneof:"change",T:()=>Mc},{no:5,name:"log_appended",kind:"message",oneof:"change",T:()=>_c},{no:6,name:"agent_event_appended",kind:"message",oneof:"change",T:()=>Rc},{no:7,name:"trace_finalized",kind:"message",oneof:"change",T:()=>wc},{no:8,name:"catalog_replaced",kind:"message",oneof:"change",T:()=>Uc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.sequence="0",i.change={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBc},{no:3,name:"reset_required",kind:"message",oneof:"payload",T:()=>qc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.payload={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posawait this.client.getRunSnapshot({runId:g.runId,operatorInstanceId:f,asOfSequence:c}).response)),d=await this.getCatalog();if(a.operatorInstanceId!==f||d.operatorInstanceId!==f||a.revision!==d.revision||BigInt(a.asOfSequence)>BigInt(c)||BigInt(d.asOfSequence)d.nodeId===i);if(!o?.eventPageToken)return[];const f=[];let c=o.eventPageToken,v="0";do{const d=await this.client.listAgentEvents({pageToken:c,afterEventSequence:v,pageSize:100}).response;f.push(...d.events),d.events.length&&(v=d.events.at(-1).eventSequence),c=d.nextPageToken}while(c);return f}async listLogs(a){if(!a.logPageToken)return[];const i=[];let o=a.logPageToken,f="0";do{const c=await this.client.listLogs({pageToken:o,afterSequence:f,pageSize:100}).response;i.push(...c.logs),c.logs.length&&(f=c.logs.at(-1).sequence),o=c.nextPageToken}while(o);return i}async readDetail(a){const i=[];for await(const v of this.client.readDetail({bodyToken:a}).responses)i.push(v.data);const o=i.reduce((v,d)=>v+d.length,0),f=new Uint8Array(o);let c=0;for(const v of i)f.set(v,c),c+=v.length;return JSON.parse(new TextDecoder().decode(f))}async startRun(a,i){return(await this.client.startRun({flowName:"",workflowSelector:a,runId:"",inputJson:i===void 0?"":JSON.stringify(i),contextJson:"",inputFiles:[]}).response).runId}async cancelRun(a){await this.client.cancelRun({runId:a}).response}}function np(y){return y==="success"?"✓":y==="failed"?"!":y==="running"?"●":"·"}function lp({workflow:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState(!0);return p.jsxs("div",{className:"workflow-branch",children:[p.jsxs("div",{className:"tree-row",children:[p.jsx("button",{type:"button",className:"tree-disclosure",onClick:()=>c(v=>!v),"aria-label":`${f?"Collapse":"Expand"} ${y.displayName}`,children:f?"⌄":"›"}),p.jsxs("button",{type:"button",className:i?.kind==="workflow"&&i.workflowId===y.workflowId?"tree-select active":"tree-select",onClick:()=>o({kind:"workflow",workflowId:y.workflowId}),children:[p.jsx("span",{className:"workflow-glyph",children:"◇"}),p.jsxs("span",{children:[p.jsx("strong",{children:y.displayName}),p.jsx("small",{children:y.relativeFile})]})]})]}),f&&p.jsxs("div",{className:"run-branches",children:[a.map(v=>{const d=v.summary;return p.jsxs("button",{type:"button",className:i?.kind==="run"&&i.runId===d.runId?"run-select active":"run-select",onClick:()=>o({kind:"run",workflowId:y.workflowId,runId:d.runId}),children:[p.jsx("span",{className:`run-dot status-${d.status}`,children:np(d.status)}),p.jsxs("span",{children:[p.jsx("strong",{children:d.runId}),p.jsx("small",{children:d.startedAt?`Created at sequence ${d.createdSequence}`:"Awaiting start"})]})]},d.runId)}),!a.length&&p.jsx("span",{className:"no-runs",children:"No runs yet"})]})]})}function ap(y,a){return y.workflows.filter(i=>i.rootAlias===a.alias)}function ip({catalog:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState({});if(!y)return p.jsxs("aside",{className:"explorer skeleton","aria-label":"Explorer",children:[p.jsx("div",{}),p.jsx("div",{}),p.jsx("div",{})]});const v=y.scanTargets.length?y.scanTargets:[{alias:"workflows",targetPath:"Configured workflows",kind:"directory"}];return p.jsxs("aside",{className:"explorer","aria-label":"Explorer",children:[p.jsxs("header",{children:[p.jsx("span",{className:"eyebrow",children:"Navigator"}),p.jsx("h2",{children:"Explorer"}),p.jsxs("span",{className:"catalog-revision",children:["catalog r",y.revision]})]}),y.diagnostics.length>0&&p.jsxs("details",{className:"diagnostics",open:!0,children:[p.jsxs("summary",{children:[y.diagnostics.length," reload issue",y.diagnostics.length===1?"":"s"]}),y.diagnostics.map(d=>p.jsxs("div",{children:[p.jsx("strong",{children:d.kind.replaceAll("_"," ")}),p.jsx("span",{children:d.path}),p.jsx("p",{children:d.message})]},`${d.path}-${d.kind}`))]}),p.jsx("div",{className:"target-list",children:v.map(d=>{const g=d.alias==="workflows"?y.workflows:ap(y,d),m=!!f[d.alias];return p.jsxs("section",{className:"target",children:[p.jsxs("button",{type:"button",className:"target-heading",onClick:()=>c(z=>{const j={...z};return j[d.alias]?delete j[d.alias]:j[d.alias]=!0,j}),children:[p.jsx("span",{children:m?"›":"⌄"}),p.jsx("span",{className:"target-kind",children:d.kind==="file"?"F":"D"}),p.jsxs("span",{children:[p.jsx("strong",{children:d.alias}),p.jsx("small",{title:d.targetPath,children:d.targetPath})]})]}),!m&&p.jsx("div",{className:"workflow-list",children:g.map(z=>p.jsx(lp,{workflow:z,runs:Object.values(a).filter(j=>j.summary?.workflowId===z.workflowId).sort((j,R)=>Number(R.summary.createdSequence)-Number(j.summary.createdSequence)),selection:i,onSelect:o},z.workflowId))})]},d.alias)})})]})}function Kn(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function Id(y){return Array.isArray(y)?y.flatMap(a=>!Kn(a)||typeof a.name!="string"?[]:[{name:a.name,type:typeof a.type=="string"?a.type:void 0,description:typeof a.description=="string"?a.description:void 0}]):[]}function eh(y){if(y)try{const a=JSON.parse(y);if(!Kn(a))return;const i=Kn(a.signature)?a.signature:{};return{instructions:typeof i.instructions=="string"?i.instructions:"",inputs:Id(i.inputs),outputs:Id(i.outputs),model:a.models,runtime:a.runtime,skills:a.skills,tools:a.tools}}catch{return}}const nh=J.memo(({data:y})=>p.jsxs("button",{type:"button",className:`node-card ${y.status?`status-${y.status}`:"blueprint"}`,onClick:y.onOpen,"aria-label":`Inspect ${y.label}`,children:[p.jsx(Qd,{type:"target",position:Kd.Left,isConnectable:!1}),p.jsx("span",{className:"node-kicker",children:y.nodeType}),p.jsx("strong",{children:y.label}),y.status&&p.jsx("span",{className:"node-status",children:y.status}),y.duration&&p.jsx("span",{className:"node-duration",children:y.duration}),y.error&&p.jsx("span",{className:"node-error",children:y.error}),y.declaration&&p.jsxs("span",{className:"field-grid",children:[p.jsxs("span",{children:[p.jsx("small",{children:"Inputs"}),y.declaration.inputs.map(a=>p.jsx("span",{className:"field",children:a.name},`input-${a.name}`))]}),p.jsxs("span",{children:[p.jsx("small",{children:"Outputs"}),y.declaration.outputs.map(a=>p.jsx("span",{className:"field",children:a.name},`output-${a.name}`))]})]}),p.jsx(Qd,{type:"source",position:Kd.Right,isConnectable:!1})]}));nh.displayName="WorkflowNodeCard";function up(y){const a=Object.fromEntries(y.nodeIds.map(c=>[c,0]));for(const c of Object.values(y.graph))for(const v of c.children)a[v]=(a[v]??0)+1;const i={},o=y.nodeIds.filter(c=>a[c]===0);for(const c of o)i[c]=0;for(let c=0;cv.map((d,g)=>[d,{x:Number(c)*330,y:g*220-(v.length-1)*110}])))}function sp(y){if(!y.startedAt)return;const a=y.endedAt||Date.now()/1e3,i=Math.max(0,a-y.startedAt);return i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m`}function cp({workflow:y,runTopology:a,runNodes:i=[],onOpenNode:o}){const f=J.useMemo(()=>{if(a)return a;if(y)return{nodeIds:y.nodeIds,graph:y.graph,nodeTypes:y.nodeTypes,displayNames:y.displayNames,agentMetadataJson:y.agentMetadataJson}},[a,y]),c=J.useMemo(()=>{if(!f)return{nodes:[],edges:[]};const v=up(f),d=Object.fromEntries(i.map(j=>[j.nodeId,j])),g=f.nodeIds.map(j=>{const R=d[j];return{id:j,type:"workflow",position:v[j],data:{label:f.displayNames[j]||R?.name||j,nodeType:f.nodeTypes[j]||R?.nodeType||"step",status:R?.status,error:R?.error,duration:R?sp(R):void 0,declaration:eh(a?a.agentMetadataJson[j]:y?.agentMetadataJson[j]),onOpen:()=>o(j)}}}),m=new Set,z=[];for(const[j,R]of Object.entries(f.graph))for(const C of R.children){const Y=`${j}->${C}`;m.has(Y)||(m.add(Y),z.push({id:Y,source:j,target:C,markerEnd:{type:Mm.ArrowClosed},className:"dag-edge"}))}return{nodes:g,edges:z}},[o,i,a,f,y]);return p.jsxs(_m,{nodes:c.nodes,edges:c.edges,nodeTypes:{workflow:nh},fitView:!0,fitViewOptions:{padding:.24},minZoom:.25,maxZoom:1.8,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[p.jsx(Rm,{color:"rgba(255,255,255,.06)",gap:24,size:1}),p.jsx(wm,{showInteractive:!1})]})}function op(y,a,i){const o=new Array(y);return new Proxy(o,{get(f,c,v){if(typeof c=="string"){const d=c.charCodeAt(0);if(d>=48&&d<=57){const g=+c;if(Number.isInteger(g)&&g>=0&&go[z]!==m))&&(o=d,f=a(...d),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(f),c=!1),f}return v.updateDeps=d=>{o=d},v}function Pd(y,a){if(y===void 0)throw new Error("Unexpected undefined");return y}const fp=(y,a)=>Math.abs(y-a)<1.01,rp=(y,a,i)=>{let o;return function(...f){y.clearTimeout(o),o=y.setTimeout(()=>a.apply(this,f),i)}};let Ma;const Lc=()=>{if(Ma!==void 0)return Ma;if(typeof navigator>"u")return Ma=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ma=!0;const y=navigator.maxTouchPoints;return Ma=navigator.platform==="MacIntel"&&y!==void 0&&y>0},th=y=>{const{offsetWidth:a,offsetHeight:i}=y;return{width:a,height:i}},dp=y=>y,hp=y=>{const a=Math.max(y.startIndex-y.overscan,0),o=Math.min(y.endIndex+y.overscan,y.count-1)-a+1,f=new Array(o);for(let c=0;c{const i=y.scrollElement;if(!i)return;const o=y.targetWindow;if(!o)return;const f=v=>{const{width:d,height:g}=v;a({width:Math.round(d),height:Math.round(g)})};if(f(th(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(v=>{const d=()=>{const g=v[0];if(g?.borderBoxSize){const m=g.borderBoxSize[0];if(m){f({width:m.inlineSize,height:m.blockSize});return}}f(th(i))};y.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},tu={passive:!0},mp=typeof window>"u"?!0:"onscrollend"in window,yp=(y,a,i)=>{const o=y.scrollElement;if(!o)return;const f=y.targetWindow;if(!f)return;const c=y.options.useScrollendEvent&∓let v=0;const d=c?null:rp(f,()=>a(v,!1),y.options.isScrollingResetDelay),g=j=>()=>{v=i(o),d?.(),a(v,j)},m=g(!0),z=g(!1);return o.addEventListener("scroll",m,tu),c&&o.addEventListener("scrollend",z,tu),()=>{o.removeEventListener("scroll",m),c&&o.removeEventListener("scrollend",z)}},pp=(y,a)=>yp(y,a,i=>{const{horizontal:o,isRtl:f}=y.options;return o?i.scrollLeft*(f&&-1||1):i.scrollTop}),vp=(y,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(y),f=i.options.getItemKey(o);return i.itemSizeCache.get(f)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(y),f=i.options.getItemKey(o),c=i.itemSizeCache.get(f);if(c!==void 0)return c}return y[i.options.horizontal?"offsetWidth":"offsetHeight"]},bp=(y,{adjustments:a=0,behavior:i},o)=>{var f,c;(c=(f=o.scrollElement)==null?void 0:f.scrollTo)==null||c.call(f,{[o.options.horizontal?"left":"top"]:y+a,behavior:i})},Sp=bp;class Tp{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,f;return((f=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:f.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(f=>{f.forEach(c=>{const v=()=>{const d=c.target,g=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,z]of this.elementsCache)if(z===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(d,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(v):v()})}));return{disconnect:()=>{var f;(f=o())==null||f.disconnect(),i=null},observe:f=>{var c;return(c=o())==null?void 0:c.observe(f,{box:"border-box"})},unobserve:f=>{var c;return(c=o())==null?void 0:c.unobserve(f)}}})(),this.range=null,this.setOptions=i=>{var o,f;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:dp,rangeExtractor:hp,onChange:()=>{},measureElement:vp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const R in i){const C=i[R];C!==void 0&&(c[R]=C)}const v=this.options;let d=null,g=null,m=!1;if(v!==void 0&&v.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const R=v.count,C=c.count,Y=this.getMeasurements(),G=R>0?((o=Y[0])==null?void 0:o.key)??v.getItemKey(0):null,ut=R>0?((f=Y[R-1])==null?void 0:f.key)??v.getItemKey(R-1):null;if(C!==R||R>0&&C>0&&(c.getItemKey(0)!==G||c.getItemKey(C-1)!==ut)){m=!0;const tt=R>0?this.getVirtualItemForOffset(this.getScrollOffset())??Y[0]:null;tt&&(d=[tt.key,this.getScrollOffset()-tt.start]);const ht=c.followOnAppend===!0?"auto":c.followOnAppend||null;ht&&C>R&&this.isAtEnd(v.scrollEndThreshold)&&(R===0||c.getItemKey(C-1)!==ut)&&(g=ht)}}this.options=c,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let z=!1,j=0;if(d&&this.scrollOffset!==null){const[R,C]=d,Y=this.getMeasurements(),{count:G,getItemKey:ut}=this.options;let K=0;for(;K{var o,f;(f=(o=this.options).onChange)==null||f.call(o,this,i)},this.maybeNotify=_l(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,v)=>{if(v&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=v?d===c?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Lc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",v,tu),c.addEventListener("touchend",d,tu),this.unsubs.push(()=>{c.removeEventListener("touchstart",v),c.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const f=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,f&&this.scrollElement&&this.options.enabled){const[c,v,d,g]=f;c!==null&&!d&&(Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?g!==0&&(this._iosDeferredAdjustment+=g):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const f=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=f,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=_l(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,f,c,v,d,g,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m}),{key:!1}),this.getMeasurements=_l(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m},z)=>{const j=this.itemSizeCache;if(!v)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const K of this.laneAssignments.keys())K>=i&&this.laneAssignments.delete(K);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(K=>{this.itemSizeCache.set(K.key,K.size)}));const R=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),d===1){const K=i*2;let Z=this._flatMeasurements;if(!Z||Z.length0&<.set(Z.subarray(0,R*2)),Z=lt,this._flatMeasurements=Z}let tt;if(R===0)tt=o+f;else{const lt=R-1;tt=Z[lt*2]+Z[lt*2+1]+m}for(let lt=R;lt1){ht=tt;const Kt=Y[ht],At=Kt!==void 0?C[Kt]:void 0;lt=At?At.end+m:o+f}else if(ut===d){let Kt=0,At=G[0],Ht=Y[0];for(let Jt=1;Jtthis.options.debug}),this.calculateRange=_l(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,f,c)=>i.length===0||o===0?(this.range=null,null):(this.range=zp(i,o,f,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=_l(()=>{let i=null,o=null;const f=this.calculateRange();return f&&(i=f.startIndex,o=f.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,f,c,v)=>c===null||v===null?[]:i({startIndex:c,endIndex:v,overscan:o,count:f}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,f=i.getAttribute(o);return f?parseInt(f,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const f=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(f!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),v=Math.max(0,f-c),d=Math.min(this.options.count-1,f+c);return i>=v&&i<=d}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((v,d)=>{v.isConnected||(this.observer.unobserve(v),this.elementsCache.delete(d))});return}const o=this.indexFromElement(i),f=this.options.getItemKey(o),c=this.elementsCache.get(f);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(f,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var f,c;if(i<0||i>=this.options.count)return;let v,d,g;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)g=this.options.getItemKey(i),d=m[i*2],v=m[i*2+1];else{const R=this.measurementsCache[i];if(!R)return;g=R.key,d=R.start,v=R.size}const z=this.itemSizeCache.get(g)??v,j=o-z;if(j!==0){const R=this.options.anchorTo==="end"&&((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,C=R?this.getTotalSize():0,Y=this.getScrollOffset()+this.scrollAdjustments,ut=!this.itemSizeCache.has(g)?d[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const f=[];for(let c=0,v=i.length;cthis.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const f=this._flatMeasurements,c=this.options.lanes===1&&f!=null,v=lh(0,o.length-1,c?d=>f[d*2]:d=>Pd(o[d]).start,i);return Pd(o[v])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,f=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),v=this.getScrollOffset();o==="auto"&&(o=i>=v+c?"end":"start"),o==="center"?i+=(f-c)/2:o==="end"&&(i-=c);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const f=this.getSize(),c=this.getScrollOffset(),v=this.measurementsCache[i];if(!v)return;if(o==="auto")if(v.end>=c+f-this.options.scrollPaddingEnd)o="end";else if(v.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?v.end+this.options.scrollPaddingEnd:v.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,v.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),v=this.now();this.scrollState={index:null,align:o,behavior:f,startedAt:v,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[v,d]=c,g=this.now();this.scrollState={index:i,align:d,behavior:f,startedAt:g,lastTargetOffset:v,stableFrames:0},this._scrollToOffset(v,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const f=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let f;if(o.length===0)f=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,v=this._flatMeasurements;v!=null?f=v[c*2]+v[c*2+1]:f=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let v=o.length-1;for(;v>=0&&c.some(d=>d===null);){const d=o[v];c[d.lane]===null&&(c[d.lane]=d.end),v--}f=Math.max(...c.filter(d=>d!==null))}return Math.max(f-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const f of o)f&&this.itemSizeCache.has(f.key)&&i.push({index:f.index,key:f.key,start:f.start,size:f.size,end:f.end,lane:f.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:f})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:f,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,f=o?o[0]:this.scrollState.lastTargetOffset,c=1,v=f!==this.scrollState.lastTargetOffset;if(!v&&fp(f,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==f&&this._scrollToOffset(f,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,v){const d=this.getSize()||600,g=Math.abs(f-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&g>d;this.scrollState.lastTargetOffset=f,m||(this.scrollState.behavior="auto"),this._scrollToOffset(f,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const lh=(y,a,i,o)=>{for(;y<=a;){const f=(y+a)/2|0,c=i(f);if(co)a=f-1;else return f}return y>0?y-1:0};function kp(y,a,i){let o=0;for(;o<=a;){const f=(o+a)/2|0,c=y[f*2];if(ci)a=f-1;else return f}return o>0?o-1:0}function zp(y,a,i,o,f){const c=y.length-1;if(y.length<=o)return{startIndex:0,endIndex:c};if(o===1&&f!==null){const m=kp(f,c,i);let z=m;const j=i+a;for(;zy[m].start,i),g=d;if(o===1)for(;g1){const m=Array(o).fill(0);for(;gj=0&&z.some(j=>j>=i);){const j=y[d];z[j.lane]=j.start,d--}d=Math.max(0,d-d%o),g=Math.min(c,g+(o-1-g%o))}return{startIndex:d,endIndex:g}}const Hc=typeof document<"u"?J.useLayoutEffect:J.useEffect;function Ep({useFlushSync:y=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const f=J.useReducer(z=>z+1,0)[1],c=J.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const v=z=>{const j=c.current;if(!j.enabled||!j.container)return;const R=z.getTotalSize();if(R!==j.lastSize){j.lastSize=R;const C=z.options.horizontal?"width":"height";j.container.style[C]=`${R}px`}},d=z=>{const j=c.current;if(!j.enabled||!j.container)return;v(z);const R=!!z.options.horizontal,C=j.mode==="transform",Y=R?"left":"top",G=z.options.scrollMargin,ut=z.getVirtualItems();for(const K of ut){const Z=K.start-G,tt=z.elementsCache.get(K.key);tt&&j.lastPositions.get(tt)!==Z&&(j.lastPositions.set(tt,Z),C?tt.style.transform=R?`translate3d(${Z}px, 0, 0)`:`translate3d(0, ${Z}px, 0)`:tt.style[Y]=`${Z}px`)}},g={...o,onChange:(z,j)=>{var R;const C=c.current;let Y=!0;if(C.enabled){d(z);const G=z.range,ut=C.prevRange;Y=!ut||ut.isScrolling!==z.isScrolling||ut.startIndex!==G?.startIndex||ut.endIndex!==G?.endIndex,Y&&(C.prevRange=G?{startIndex:G.startIndex,endIndex:G.endIndex,isScrolling:z.isScrolling}:null)}Y&&(y&&j?Um.flushSync(f):f()),(R=o.onChange)==null||R.call(o,z,j)}},[m]=J.useState(()=>{const z=new Tp(g);return Object.assign(z,{containerRef:j=>{const R=c.current;if(R.container=j,R.lastSize=null,j&&R.enabled){const C=z.getTotalSize();R.lastSize=C;const Y=z.options.horizontal?"width":"height";j.style[Y]=`${C}px`}}})});return m.setOptions(g),Hc(()=>m._didMount(),[]),Hc(()=>(v(m),m._willUpdate())),Hc(()=>{d(m)}),m}function Np(y){return Ep({observeElementRect:gp,observeElementOffset:pp,scrollToFn:Sp,...y})}function Qn({value:y,depth:a=0}){return y===null?p.jsx("span",{className:"value-null",children:"null"}):typeof y=="string"?p.jsx("span",{className:"value-string",children:y}):typeof y=="number"||typeof y=="boolean"?p.jsx("span",{className:"value-scalar",children:String(y)}):Array.isArray(y)?p.jsx("ol",{className:"value-list",children:y.map((i,o)=>p.jsx("li",{children:p.jsx(Qn,{value:i,depth:a+1})},`${a}-${o}`))}):Kn(y)?y.kind==="predict_rlm_file"&&typeof y.path=="string"?p.jsxs("span",{className:"file-value",title:"Reported host path; contents are not copied",children:[p.jsx("span",{"aria-hidden":"true",children:"↗"}),p.jsxs("span",{children:[p.jsx("small",{children:"PredictRLM file"}),p.jsx("code",{children:y.path})]})]}):y.kind==="unavailable"&&typeof y.reason=="string"?p.jsxs("span",{className:"value-unavailable",children:["Unavailable · ",y.reason]}):p.jsx("dl",{className:"value-object",children:Object.entries(y).map(([i,o])=>p.jsxs("div",{children:[p.jsx("dt",{children:i}),p.jsx("dd",{children:p.jsx(Qn,{value:o,depth:a+1})})]},i))}):p.jsx("span",{className:"value-unavailable",children:"Unavailable"})}const Ap=[],Op=[];function Vc({value:y}){return p.jsx("pre",{className:"json-block",children:JSON.stringify(y,null,2)})}function xp(y){if(Kn(y))return Kn(y.data)?y.data:y}function jp({api:y,workflow:a,run:i,nodeId:o,liveEvents:f=Ap,liveLogs:c=Op,onClose:v}){const[d,g]=J.useState("overview"),[m,z]=J.useState([]),[j,R]=J.useState([]),[C,Y]=J.useState(),[G,ut]=J.useState(),[K,Z]=J.useState(),[tt,ht]=J.useState(!0),lt=J.useRef(new Map),Bt=J.useRef(null),$=i?.nodes.find(w=>w.nodeId===o),jt=i?i.topology?.agentMetadataJson[o??""]:a?.agentMetadataJson[o??""],Dt=jt?eh(jt):void 0;J.useEffect(()=>{if(g("overview"),z([]),R([]),Y(void 0),ut(void 0),ht(!0),lt.current.clear(),!i||!o)return;let w=!0;return Promise.all([y.listAgentEvents(i,o),y.listLogs(i)]).then(([H,bt])=>{w&&(z(H),R(bt.filter(ct=>!ct.nodeId||ct.nodeId===o)))}).catch(H=>{w&&Z(H instanceof Error?H.message:"Details unavailable")}),()=>{w=!1}},[y,o,i]);const Kt=J.useMemo(()=>{const w=new Map;for(const H of[...m,...f])w.set(H.eventSequence,H);return[...w.values()].sort((H,bt)=>Number(H.eventSequence)-Number(bt.eventSequence))},[m,f]),At=Kt.filter(w=>w.eventKind==="iteration.recorded"),Ht=J.useMemo(()=>{const w=new Map;for(const H of[...j,...c])w.set(H.sequence,H);return[...w.values()].sort((H,bt)=>Number(H.sequence)-Number(bt.sequence))},[c,j]),Jt=J.useMemo(()=>{const w=$?.trace?.header?.usageJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.usageJson]),de=J.useMemo(()=>{const w=$?.trace?.header?.telemetryJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.telemetryJson]),he=d==="inputs"?Dt?.inputs:d==="output"?Dt?.outputs:void 0,M=Np({count:At.length,getScrollElement:()=>Bt.current,estimateSize:()=>64,overscan:6});if(J.useEffect(()=>{!tt||!At.length||Y(At.at(-1).eventSequence)},[tt,At]),J.useEffect(()=>{const w=Kt.find(ct=>ct.eventSequence===C);if(!w?.bodyToken){ut(void 0);return}const H=lt.current.get(w.bodyToken);if(H!==void 0){lt.current.delete(w.bodyToken),lt.current.set(w.bodyToken,H),ut(H);return}let bt=!0;return ut(void 0),Z(void 0),y.readDetail(w.bodyToken).then(ct=>{if(bt){for(lt.current.delete(w.bodyToken),lt.current.set(w.bodyToken,ct);lt.current.size>8;){const ot=lt.current.keys().next().value;if(ot===void 0)break;lt.current.delete(ot)}ut(ct)}}).catch(ct=>{bt&&Z(ct instanceof Error?ct.message:"Detail unavailable")}),()=>{bt=!1}},[y,Kt,C]),J.useEffect(()=>{const w=d==="inputs"?"run.started":d==="output"?"run.succeeded":void 0;if(!w)return;const H=[...Kt].reverse().find(bt=>bt.eventKind===w);H&&Y(H.eventSequence)},[Kt,d]),!i&&a&&o)return p.jsxs("aside",{className:"inspector","aria-label":"Node declaration",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Declaration"}),p.jsx("h2",{children:a.displayNames[o]||o})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),Dt?p.jsxs("div",{className:"inspector-body declaration",children:[p.jsxs("section",{children:[p.jsx("h3",{children:"Instructions"}),p.jsx("p",{className:"instructions",children:Dt.instructions||"No instructions"})]}),p.jsxs("section",{className:"signature-columns",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"Inputs"}),Dt.inputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]}),p.jsxs("div",{children:[p.jsx("h3",{children:"Outputs"}),Dt.outputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Runtime"}),p.jsx(Vc,{value:Dt.runtime})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Models"}),p.jsx(Vc,{value:Dt.model})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Skills & tools"}),p.jsx(Vc,{value:{skills:Dt.skills,tools:Dt.tools}})]})]}):p.jsx("p",{className:"empty-copy",children:"This node has no agent declaration metadata."})]});if(!i||!$)return null;const B=xp(G),Q=d==="inputs"?"inputs":"outputs";return p.jsxs("aside",{className:"inspector","aria-label":"Run inspector",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Historical execution"}),p.jsx("h2",{children:$.name}),p.jsx("span",{className:`status-pill status-${$.status}`,children:$.status})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),p.jsx("nav",{className:"inspector-tabs","aria-label":"Run detail views",children:["overview","inputs","output","trace","logs"].map(w=>p.jsx("button",{type:"button",className:d===w?"active":"",onClick:()=>g(w),children:w},w))}),p.jsxs("div",{className:"inspector-body",children:[K&&p.jsx("p",{className:"error-banner",children:K}),d==="overview"&&p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:"metric-grid",children:[p.jsxs("div",{children:[p.jsx("small",{children:"Status"}),p.jsx("strong",{children:$.status})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Revision"}),p.jsx("strong",{children:$.revision})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Started"}),p.jsx("strong",{children:$.startedAt?"yes":"—"})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Duration"}),p.jsx("strong",{children:$.startedAt&&$.endedAt?`${Math.max(0,$.endedAt-$.startedAt).toFixed(2)}s`:"—"})]})]}),$.error&&p.jsx("p",{className:"node-failure",children:$.error}),$.trace&&p.jsxs("section",{children:[p.jsx("h3",{children:"Trace header"}),p.jsxs("dl",{className:"trace-header",children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Status"}),p.jsx("dd",{children:$.trace.status})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Events"}),p.jsx("dd",{children:$.trace.eventCount})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Size"}),p.jsxs("dd",{children:[$.trace.sizeBytes," B"]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Complete"}),p.jsx("dd",{children:$.trace.complete?"yes":"no"})]}),$.trace.header&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Model"}),p.jsx("dd",{children:$.trace.header.model})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Iterations"}),p.jsxs("dd",{children:[$.trace.header.iterations,"/",$.trace.header.maxIterations]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Duration"}),p.jsxs("dd",{children:[$.trace.header.durationMs," ms"]})]})]})]}),Jt!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Usage"}),p.jsx(Qn,{value:Jt})]}),de!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Telemetry"}),p.jsx(Qn,{value:de})]})]})]}),(d==="inputs"||d==="output")&&p.jsxs("section",{children:[p.jsx("h3",{children:d==="inputs"?"Invocation inputs":"Terminal output"}),he?.length?p.jsxs("div",{className:"declared-fields",children:[p.jsx("small",{children:"Declared fields"}),he.map(w=>p.jsxs("span",{children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type})]},w.name))]}):null,B&&Q in B?p.jsx(Qn,{value:B[Q]}):p.jsxs("p",{className:"empty-copy",children:["No retained ",d," are available."]})]}),d==="trace"&&p.jsxs("section",{className:"trace-layout",children:[p.jsxs("div",{className:"trace-toolbar",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"RunTrace"}),p.jsxs("span",{children:[At.length," complete turns"]})]}),p.jsx("button",{type:"button",className:tt?"toggle active":"toggle",onClick:()=>ht(w=>!w),children:tt?"Following live":"Follow latest"})]}),p.jsx("div",{className:"turn-list",ref:Bt,children:p.jsx("div",{style:{height:M.getTotalSize(),position:"relative"},children:M.getVirtualItems().map(w=>{const H=At[w.index];return p.jsxs("button",{type:"button",className:`turn-row ${C===H.eventSequence?"active":""} ${H.error?"failed":""}`,style:{transform:`translateY(${w.start}px)`},onClick:()=>{ht(!1),Y(H.eventSequence)},children:[p.jsxs("strong",{children:["Turn ",H.iteration??w.index+1]}),p.jsx("span",{children:H.durationMs?`${H.durationMs} ms`:"—"}),p.jsxs("small",{children:[H.toolCount," tools · ",H.predictCount," predicts"]})]},H.eventSequence)})})}),p.jsx("div",{className:"turn-detail",children:G!==void 0?p.jsx(Qn,{value:G}):p.jsx("p",{className:"empty-copy",children:"Select a turn."})})]}),d==="logs"&&p.jsxs("section",{children:[p.jsx("h3",{children:"Node logs"}),p.jsx("div",{className:"log-list",children:Ht.map(w=>p.jsxs("button",{type:"button",onClick:()=>{y.readDetail(w.bodyToken).then(ut).catch(H=>{Z(H instanceof Error?H.message:"Log unavailable")})},children:[p.jsx("span",{className:`log-level level-${w.level}`,children:w.level}),p.jsx("time",{children:new Date(w.timestamp*1e3).toLocaleTimeString()}),p.jsxs("span",{children:["#",w.sequence]})]},w.sequence))}),G!==void 0&&p.jsx(Qn,{value:G})]})]})]})}function Dp({value:y,onChange:a}){const i=J.useRef(null);return J.useEffect(()=>{if(!i.current)return;const o=new Ii({parent:i.current,state:Cm.create({doc:y,extensions:[Lm(),Hm.of([]),Ii.lineWrapping,Ii.theme({"&":{backgroundColor:"#0e1112",color:"#dce4df"},".cm-content":{caretColor:"#eeff8c",minHeight:"110px"},".cm-gutters":{backgroundColor:"#0e1112",color:"#626b67",border:"0"},"&.cm-focused":{outline:"1px solid #778357"}}),Ii.updateListener.of(f=>{f.docChanged&&a(f.state.doc.toString())})]})});return()=>o.destroy()},[]),p.jsx("div",{className:"json-editor",ref:i})}function Mp(y){const a=JSON.parse(y);if(!Kn(a))throw new Error("Run input must be a JSON object");return a}function _p({workflow:y,run:a,pending:i,onStart:o,onCancel:f}){const[c,v]=J.useState(!1),[d,g]=J.useState("{}"),[m,z]=J.useState(),j=a?.summary?.status==="pending"||a?.summary?.status==="running",R=async()=>{if(!y)return;z(void 0);let C;if(c)try{C=Mp(d)}catch(Y){z(Y instanceof Error?Y.message:"Run input is invalid JSON");return}try{await o(y.workflowId,C)}catch(Y){z(Y instanceof Error?Y.message:"Operator rejected the run")}};return p.jsxs("div",{className:"run-controls",children:[y&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"run-button",disabled:i?.kind==="start",onClick:()=>{R()},children:i?.kind==="start"?"Requesting…":"Run"}),p.jsx("button",{type:"button",className:`input-toggle ${c?"active":""}`,onClick:()=>v(C=>!C),children:c?"Hide JSON input":"Add JSON input"})]}),j&&a?.summary&&p.jsx("button",{type:"button",className:"cancel-button",disabled:i?.kind==="cancel",onClick:()=>{z(void 0),f(a.summary.runId).catch(C=>{z(C instanceof Error?C.message:"Cancellation failed")})},children:i?.kind==="cancel"?"Cancelling…":"Cancel run"}),c&&y&&p.jsxs("div",{className:"input-popover",children:[p.jsxs("div",{children:[p.jsx("strong",{children:"Workflow input"}),p.jsx("span",{children:"Schema-blind JSON object"})]}),p.jsx(Dp,{value:d,onChange:g})]}),m&&p.jsx("div",{className:"action-error",children:m})]})}const ah={runs:{},liveEvents:{},liveLogs:{},operatorInstanceId:"",sequence:"0",connection:"connecting"};function Rp(y,a){if(a.type==="baseline"){const g=Object.fromEntries(a.baseline.runs.filter(m=>m.summary).map(m=>[m.summary.runId,m]));return{...ah,catalog:a.baseline.catalog,runs:g,operatorInstanceId:a.baseline.catalog.operatorInstanceId,sequence:a.baseline.asOfSequence,connection:"live"}}if(a.type==="connection")return{...y,connection:a.connection,error:a.error};if(a.type==="action")return{...y,action:a.action};const{envelope:i}=a;if(i.operatorInstanceId!==y.operatorInstanceId)throw new Error("Operator epoch changed");if(i.payload.oneofKind!=="update")throw new Error("Operator requested a structural reset");const o=i.payload.update;if(BigInt(o.sequence)!==BigInt(y.sequence)+1n)throw new Error(`Operator update gap after sequence ${y.sequence}`);const f={...y,sequence:o.sequence,error:void 0},c=o.change;if(c.oneofKind==="catalogReplaced")return c.catalogReplaced.catalog&&(f.catalog=c.catalogReplaced.catalog),f;if(c.oneofKind==="runCreated"&&c.runCreated.summary){const g=c.runCreated.summary;return f.runs={...y.runs,[g.runId]:{operatorInstanceId:y.operatorInstanceId,asOfSequence:o.sequence,summary:g,nodes:c.runCreated.nodes,latestLogSequence:"0",logPageToken:"",topology:c.runCreated.topology}},f}const v=c.oneofKind==="runStatusChanged"?c.runStatusChanged.runId:c.oneofKind==="nodeStatusChanged"?c.nodeStatusChanged.runId:c.oneofKind==="logAppended"?c.logAppended.runId:c.oneofKind==="agentEventAppended"?c.agentEventAppended.runId:c.oneofKind==="traceFinalized"?c.traceFinalized.runId:"",d=y.runs[v];if(!d)throw new Error(`Operator update referenced unknown run ${v}`);if(c.oneofKind==="runStatusChanged"&&d.summary)f.runs={...y.runs,[v]:{...d,summary:{...d.summary,status:c.runStatusChanged.status,startedAt:c.runStatusChanged.startedAt,endedAt:c.runStatusChanged.endedAt,revision:c.runStatusChanged.revision}}};else if(c.oneofKind==="nodeStatusChanged"){const g=c.nodeStatusChanged;f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(m=>m.nodeId===g.nodeId?{...m,status:g.status,startedAt:g.startedAt,endedAt:g.endedAt,revision:g.revision,error:g.error}:m)}}}else if(c.oneofKind==="logAppended"&&c.logAppended.log)f.liveLogs={...y.liveLogs,[v]:[...y.liveLogs[v]??[],c.logAppended.log]};else if(c.oneofKind==="agentEventAppended"&&c.agentEventAppended.event){const g=`${v}:${c.agentEventAppended.nodeId}`;f.liveEvents={...y.liveEvents,[g]:[...y.liveEvents[g]??[],c.agentEventAppended.event]}}else c.oneofKind==="traceFinalized"&&c.traceFinalized.trace&&(f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(g=>g.nodeId===c.traceFinalized.nodeId?{...g,trace:c.traceFinalized.trace}:g)}});return f}function wp(y){const[a,i]=J.useReducer(Rp,ah),o=J.useRef(0),f=J.useCallback(async()=>{const d=await y.loadBaseline();return i({type:"baseline",baseline:d}),d},[y]);J.useEffect(()=>{const d=++o.current;let g=!1;return(async()=>{let z=250;for(;!g&&o.current===d;)try{i({type:"connection",connection:"connecting"});const j=await y.loadBaseline();if(g)return;i({type:"baseline",baseline:j}),z=250;let R=j.asOfSequence;for await(const C of y.streamUpdates(j.catalog.operatorInstanceId,R)){if(g)return;if(C.payload.oneofKind!=="update"||BigInt(C.payload.update.sequence)!==BigInt(R)+1n)break;i({type:"envelope",envelope:C}),R=C.payload.update.sequence}i({type:"connection",connection:"reconnecting"})}catch(j){if(g)return;i({type:"connection",connection:"reconnecting",error:j instanceof Error?j.message:"Operator connection failed"});const{promise:R,resolve:C}=Promise.withResolvers();window.setTimeout(C,z),await R,z=Math.min(z*2,4e3)}})(),()=>{g=!0,o.current+=1}},[y]);const c=J.useCallback(async(d,g)=>{i({type:"action",action:{kind:"start",target:d}});try{return await y.startRun(d,g)}finally{i({type:"action",action:void 0})}},[y]),v=J.useCallback(async d=>{i({type:"action",action:{kind:"cancel",target:d}});try{await y.cancelRun(d)}finally{i({type:"action",action:void 0})}},[y]);return{state:a,reconcile:f,startRun:c,cancelRun:v}}function Up({api:y}){const{state:a,startRun:i,cancelRun:o}=wp(y),[f,c]=J.useState(),[v,d]=J.useState();J.useEffect(()=>{const G=a.catalog?.workflows??[];if(!G.length){c(void 0);return}if(!f){c({kind:"workflow",workflowId:G[0].workflowId});return}G.some(ut=>ut.workflowId===f.workflowId)||c({kind:"workflow",workflowId:G[0].workflowId})},[f,a.catalog]);const g=a.catalog?.workflows.find(G=>G.workflowId===f?.workflowId),m=f?.kind==="run"?a.runs[f.runId]:void 0,z=J.useMemo(()=>Object.values(a.runs).filter(G=>G.summary?.workflowId===g?.workflowId).sort((G,ut)=>Number(ut.summary.createdSequence)-Number(G.summary.createdSequence))[0],[a.runs,g?.workflowId]),j=J.useCallback(G=>d(G),[]),R=J.useCallback(G=>{c(G),d(void 0)},[]),C=m??(f?.kind==="workflow"?z:void 0),Y=m&&v?`${m.summary?.runId}:${v}`:"";return p.jsxs("div",{className:"app-shell",children:[p.jsxs("header",{className:"topbar",children:[p.jsxs("div",{className:"brand",children:[p.jsx("span",{className:"brand-mark","aria-hidden":"true",children:"A"}),p.jsxs("div",{children:[p.jsx("strong",{children:"Avalanche"}),p.jsx("span",{children:"Operator"})]})]}),p.jsxs("div",{className:"breadcrumb",children:[p.jsx("span",{children:g?.rootAlias||"Local operator"}),g&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:g.displayName})]}),m?.summary&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:m.summary.runId})]})]}),p.jsxs("div",{className:`connection connection-${a.connection}`,children:[p.jsx("span",{}),a.connection==="live"?"Live":a.connection,p.jsxs("small",{children:["seq ",a.sequence]})]})]}),a.error&&p.jsx("div",{className:"connection-error",children:a.error}),p.jsxs("main",{className:`workspace ${v?"with-inspector":""}`,children:[p.jsx(ip,{catalog:a.catalog,runs:a.runs,selection:f,onSelect:R}),p.jsxs("section",{className:"canvas-shell",children:[p.jsxs("header",{className:"view-header",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:m?"Historical run":"Current definition"}),p.jsx("h1",{children:m?.summary?.runId||g?.displayName||"Operator"}),p.jsx("p",{children:m?`Recorded topology · ${m.summary?.status??"unknown"}`:g?`${g.nodeIds.length} nodes · ${g.relativeFile}`:"Waiting for a workflow catalog"})]}),p.jsx(_p,{workflow:m?void 0:g,run:m??C,pending:a.action,onStart:i,onCancel:o})]}),p.jsxs("div",{className:m?"canvas run-canvas":"canvas blueprint-canvas",children:[g||m?.topology?p.jsx(cp,{workflow:m?void 0:g,runTopology:m?.topology,runNodes:m?.nodes,onOpenNode:j}):p.jsxs("div",{className:"empty-state",children:[p.jsx("span",{children:"◇"}),p.jsx("h2",{children:"No workflows discovered"}),p.jsx("p",{children:"Catalog changes will appear here as the operator scans configured targets."})]}),m&&p.jsxs("div",{className:"historical-badge",children:[p.jsx("span",{children:"Immutable run snapshot"}),"Current workflow changes do not alter this canvas"]})]})]}),v&&p.jsx(jp,{api:y,workflow:g,run:m,nodeId:v,liveEvents:a.liveEvents[Y],liveLogs:m?.summary?a.liveLogs[m.summary.runId]:void 0,onClose:()=>d(void 0)})]})]})}const ih=document.getElementById("root");if(!ih)throw new Error("Operator UI root element is missing");Qm.createRoot(ih).render(p.jsx(J.StrictMode,{children:p.jsx(Up,{api:new ep})})); +`).replace(Fg,"")}function dd(t,e){return e=rd(e),rd(t)===e}function pt(t,e,n,l,u,s){switch(n){case"children":typeof l=="string"?e==="body"||e==="textarea"&&l===""||tl(t,l):(typeof l=="number"||typeof l=="bigint")&&e!=="body"&&tl(t,""+l);break;case"className":Va(t,"class",l);break;case"tabIndex":Va(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Va(t,n,l);break;case"style":fo(t,l,s);break;case"data":if(e!=="object"){Va(t,"data",l);break}case"src":case"href":if(l===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(n);break}l=Ga(""+l),t.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(e!=="input"&&pt(t,e,"name",u.name,u,null),pt(t,e,"formEncType",u.formEncType,u,null),pt(t,e,"formMethod",u.formMethod,u,null),pt(t,e,"formTarget",u.formTarget,u,null)):(pt(t,e,"encType",u.encType,u,null),pt(t,e,"method",u.method,u,null),pt(t,e,"target",u.target,u,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(n);break}l=Ga(""+l),t.setAttribute(n,l);break;case"onClick":l!=null&&(t.onclick=we);break;case"onScroll":l!=null&&nt("scroll",t);break;case"onScrollEnd":l!=null&&nt("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(u.children!=null)throw Error(o(60));t.innerHTML=n}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}n=Ga(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(n,""+l):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":l===!0?t.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(n,l):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(n,l):t.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(n):t.setAttribute(n,l);break;case"popover":nt("beforetoggle",t),nt("toggle",t),Ha(t,"popover",l);break;case"xlinkActuate":Re(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Re(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Re(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Re(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Re(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Re(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Re(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Re(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Re(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ha(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2h)break;var x=b.transferSize,_=b.initiatorType;x&&hd(_)&&(b=b.responseEnd,r+=x*(b"u"?null:document;function Nd(t,e,n){var l=xl;if(l&&typeof e=="string"&&e){var u=me(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Ed.has(u)||(Ed.add(u),t={rel:t,crossOrigin:n,href:e},l.querySelector(u)===null&&(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function om(t){We.D(t),Nd("dns-prefetch",t,null)}function fm(t,e){We.C(t,e),Nd("preconnect",t,e)}function rm(t,e,n){We.L(t,e,n);var l=xl;if(l&&t&&e){var u='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+me(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+me(n.imageSizes)+'"]')):u+='[href="'+me(t)+'"]';var s=u;switch(e){case"style":s=jl(t);break;case"script":s=Dl(t)}ze.has(s)||(t=j({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),ze.set(s,t),l.querySelector(u)!==null||e==="style"&&l.querySelector(Ea(s))||e==="script"&&l.querySelector(Na(s))||(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function dm(t,e){We.m(t,e);var n=xl;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+me(l)+'"][href="'+me(t)+'"]',s=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Dl(t)}if(!ze.has(s)&&(t=j({rel:"modulepreload",href:t},e),ze.set(s,t),n.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Na(s)))return}l=n.createElement("link"),Qt(l,"link",t),Ct(l),n.head.appendChild(l)}}}function hm(t,e,n){We.S(t,e,n);var l=xl;if(l&&t){var u=Fn(l).hoistableStyles,s=jl(t);e=e||"default";var r=u.get(s);if(!r){var h={loading:0,preload:null};if(r=l.querySelector(Ea(s)))h.loading=5;else{t=j({rel:"stylesheet",href:t,"data-precedence":e},n),(n=ze.get(s))&&rc(t,n);var b=r=l.createElement("link");Ct(b),Qt(b,"link",t),b._p=new Promise(function(N,x){b.onload=N,b.onerror=x}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Hi(r,e,l)}r={type:"stylesheet",instance:r,count:1,state:h},u.set(s,r)}}}function gm(t,e){We.X(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function mm(t,e){We.M(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0,type:"module"},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function Ad(t,e,n,l){var u=(u=Ie.current)?Li(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=jl(n.href),n=Fn(u).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=jl(n.href);var s=Fn(u).hoistableStyles,r=s.get(t);if(r||(u=u.ownerDocument||u,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,r),(s=u.querySelector(Ea(t)))&&!s._p&&(r.instance=s,r.state.loading=5),ze.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ze.set(t,n),s||ym(u,t,n,r.state))),e&&l===null)throw Error(o(528,""));return r}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Dl(n),n=Fn(u).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function jl(t){return'href="'+me(t)+'"'}function Ea(t){return'link[rel="stylesheet"]['+t+"]"}function Od(t){return j({},t,{"data-precedence":t.precedence,precedence:null})}function ym(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),Qt(e,"link",n),Ct(e),t.head.appendChild(e))}function Dl(t){return'[src="'+me(t)+'"]'}function Na(t){return"script[async]"+t}function xd(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+me(n.href)+'"]');if(l)return e.instance=l,Ct(l),l;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ct(l),Qt(l,"style",u),Hi(l,n.precedence,t),e.instance=l;case"stylesheet":u=jl(n.href);var s=t.querySelector(Ea(u));if(s)return e.state.loading|=4,e.instance=s,Ct(s),s;l=Od(n),(u=ze.get(u))&&rc(l,u),s=(t.ownerDocument||t).createElement("link"),Ct(s);var r=s;return r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),e.state.loading|=4,Hi(s,n.precedence,t),e.instance=s;case"script":return s=Dl(n.src),(u=t.querySelector(Na(s)))?(e.instance=u,Ct(u),u):(l=n,(u=ze.get(s))&&(l=j({},n),dc(l,u)),t=t.ownerDocument||t,u=t.createElement("script"),Ct(u),Qt(u,"link",l),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,Hi(l,n.precedence,t));return e.instance}function Hi(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,s=u,r=0;r title"):null)}function pm(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Md(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function vm(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=jl(l.href),s=e.querySelector(Ea(u));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Yi.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,Ct(s);return}s=e.ownerDocument||e,l=Od(l),(u=ze.get(u))&&rc(l,u),s=s.createElement("link"),Ct(s);var r=s;r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Yi.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var hc=0;function bm(t,e){return t.stylesheets&&t.count===0&&Xi(t,t.stylesheets),0hc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Yi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xi(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Gi=null;function Xi(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gi=new Map,e.forEach(Sm,t),Gi=null,Yi.call(t))}function Sm(t,e){if(!(e.state.loading&4)){var n=Gi.get(t);if(n)var l=n.get(null);else{n=new Map,Gi.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y)}catch(a){console.error(a)}}return y(),Sc.exports=Gm(),Sc.exports}var Qm=Xm();class Km extends W{constructor(){super("avalanche.operator.Empty",[])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poszc},{no:6,name:"run_id",kind:"scalar",T:9},{no:7,name:"workflow_selector",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.flowName="",i.inputJson="",i.contextJson="",i.inputFiles=[],i.runId="",i.workflowSelector="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:3,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.agentMetadataJson={},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:5,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"cron",kind:"scalar",T:9},{no:8,name:"next_run_at",kind:"scalar",T:1},{no:9,name:"last_run_at",kind:"scalar",T:1},{no:10,name:"workflow_id",kind:"scalar",T:9},{no:11,name:"display_name",kind:"scalar",T:9},{no:12,name:"root_alias",kind:"scalar",T:9},{no:13,name:"relative_file",kind:"scalar",T:9},{no:14,name:"builder_symbol",kind:"scalar",T:9},{no:15,name:"agent_node_ids",kind:"scalar",repeat:2,T:9},{no:16,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:17,name:"webhook_path",kind:"scalar",T:9},{no:18,name:"webhook_url",kind:"scalar",T:9},{no:19,name:"webhook_active",kind:"scalar",T:8}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.name="",i.filePath="",i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.cron="",i.nextRunAt=0,i.lastRunAt=0,i.workflowId="",i.displayName="",i.rootAlias="",i.relativeFile="",i.builderSymbol="",i.agentNodeIds=[],i.agentMetadataJson={},i.webhookPath="",i.webhookUrl="",i.webhookActive=!1,a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posEc},{no:5,name:"scan_targets",kind:"message",repeat:2,T:()=>Ac},{no:6,name:"diagnostics",kind:"message",repeat:2,T:()=>Nc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.revision="0",i.workflows=[],i.scanTargets=[],i.diagnostics=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posOc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.valueJson="",i.files=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posxc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.status="",i.revision="0",i.available=!1,i.complete=!1,i.eventCount="0",i.sizeBytes="0",i.latestEventSequence="0",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl},{no:8,name:"revision",kind:"scalar",T:4},{no:9,name:"event_page_token",kind:"scalar",T:9},{no:10,name:"error",kind:"scalar",opt:!0,T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeId="",i.name="",i.nodeType="",i.status="",i.startedAt=0,i.endedAt=0,i.revision="0",i.eventPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:5,name:"latest_log_sequence",kind:"scalar",T:4},{no:6,name:"log_page_token",kind:"scalar",T:9},{no:7,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.nodes=[],i.latestLogSequence="0",i.logPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.logs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql},{no:6,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runId="",i.nodeId="",i.events=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:2,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:3,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodes=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posPi}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posjc},{no:3,name:"run_status_changed",kind:"message",oneof:"change",T:()=>Dc},{no:4,name:"node_status_changed",kind:"message",oneof:"change",T:()=>Mc},{no:5,name:"log_appended",kind:"message",oneof:"change",T:()=>_c},{no:6,name:"agent_event_appended",kind:"message",oneof:"change",T:()=>Rc},{no:7,name:"trace_finalized",kind:"message",oneof:"change",T:()=>wc},{no:8,name:"catalog_replaced",kind:"message",oneof:"change",T:()=>Uc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.sequence="0",i.change={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBc},{no:3,name:"reset_required",kind:"message",oneof:"payload",T:()=>qc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.payload={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posawait this.client.getRunSnapshot({runId:g.runId,operatorInstanceId:f,asOfSequence:c}).response)),d=await this.getCatalog();if(a.operatorInstanceId!==f||d.operatorInstanceId!==f||a.revision!==d.revision||BigInt(a.asOfSequence)>BigInt(c)||BigInt(d.asOfSequence)d.nodeId===i);if(!o?.eventPageToken)return[];const f=[];let c=o.eventPageToken,v="0";do{const d=await this.client.listAgentEvents({pageToken:c,afterEventSequence:v,pageSize:100}).response;f.push(...d.events),d.events.length&&(v=d.events.at(-1).eventSequence),c=d.nextPageToken}while(c);return f}async listLogs(a){if(!a.logPageToken)return[];const i=[];let o=a.logPageToken,f="0";do{const c=await this.client.listLogs({pageToken:o,afterSequence:f,pageSize:100}).response;i.push(...c.logs),c.logs.length&&(f=c.logs.at(-1).sequence),o=c.nextPageToken}while(o);return i}async readDetail(a){const i=[];for await(const v of this.client.readDetail({bodyToken:a}).responses)i.push(v.data);const o=i.reduce((v,d)=>v+d.length,0),f=new Uint8Array(o);let c=0;for(const v of i)f.set(v,c),c+=v.length;return JSON.parse(new TextDecoder().decode(f))}async startRun(a,i){return(await this.client.startRun({flowName:"",workflowSelector:a,runId:"",inputJson:i===void 0?"":JSON.stringify(i),contextJson:"",inputFiles:[]}).response).runId}async cancelRun(a){await this.client.cancelRun({runId:a}).response}}function np(y){return y==="success"?"✓":y==="failed"?"!":y==="running"?"●":"·"}function lp({workflow:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState(!0);return p.jsxs("div",{className:"workflow-branch",children:[p.jsxs("div",{className:"tree-row",children:[p.jsx("button",{type:"button",className:"tree-disclosure",onClick:()=>c(v=>!v),"aria-label":`${f?"Collapse":"Expand"} ${y.displayName}`,children:f?"⌄":"›"}),p.jsxs("button",{type:"button",className:i?.kind==="workflow"&&i.workflowId===y.workflowId?"tree-select active":"tree-select",onClick:()=>o({kind:"workflow",workflowId:y.workflowId}),children:[p.jsx("span",{className:"workflow-glyph",children:"◇"}),p.jsxs("span",{children:[p.jsx("strong",{children:y.displayName}),p.jsx("small",{children:y.relativeFile})]})]})]}),f&&p.jsxs("div",{className:"run-branches",children:[a.map(v=>{const d=v.summary;return p.jsxs("button",{type:"button",className:i?.kind==="run"&&i.runId===d.runId?"run-select active":"run-select",onClick:()=>o({kind:"run",workflowId:y.workflowId,runId:d.runId}),children:[p.jsx("span",{className:`run-dot status-${d.status}`,children:np(d.status)}),p.jsxs("span",{children:[p.jsx("strong",{children:d.runId}),p.jsx("small",{children:d.startedAt?`Created at sequence ${d.createdSequence}`:"Awaiting start"})]})]},d.runId)}),!a.length&&p.jsx("span",{className:"no-runs",children:"No runs yet"})]})]})}function ap(y,a){return y.workflows.filter(i=>i.rootAlias===a.alias)}function ip({catalog:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState({});if(!y)return p.jsxs("aside",{className:"explorer skeleton","aria-label":"Explorer",children:[p.jsx("div",{}),p.jsx("div",{}),p.jsx("div",{})]});const v=y.scanTargets.length?y.scanTargets:[{alias:"workflows",targetPath:"Configured workflows",kind:"directory"}];return p.jsxs("aside",{className:"explorer","aria-label":"Explorer",children:[p.jsxs("header",{children:[p.jsx("span",{className:"eyebrow",children:"Navigator"}),p.jsx("h2",{children:"Explorer"}),p.jsxs("span",{className:"catalog-revision",children:["catalog r",y.revision]})]}),y.diagnostics.length>0&&p.jsxs("details",{className:"diagnostics",open:!0,children:[p.jsxs("summary",{children:[y.diagnostics.length," reload issue",y.diagnostics.length===1?"":"s"]}),y.diagnostics.map(d=>p.jsxs("div",{children:[p.jsx("strong",{children:d.kind.replaceAll("_"," ")}),p.jsx("span",{children:d.path}),p.jsx("p",{children:d.message})]},`${d.path}-${d.kind}`))]}),p.jsx("div",{className:"target-list",children:v.map(d=>{const g=d.alias==="workflows"?y.workflows:ap(y,d),m=!!f[d.alias];return p.jsxs("section",{className:"target",children:[p.jsxs("button",{type:"button",className:"target-heading",onClick:()=>c(z=>{const j={...z};return j[d.alias]?delete j[d.alias]:j[d.alias]=!0,j}),children:[p.jsx("span",{children:m?"›":"⌄"}),p.jsx("span",{className:"target-kind",children:d.kind==="file"?"F":"D"}),p.jsxs("span",{children:[p.jsx("strong",{children:d.alias}),p.jsx("small",{title:d.targetPath,children:d.targetPath})]})]}),!m&&p.jsx("div",{className:"workflow-list",children:g.map(z=>p.jsx(lp,{workflow:z,runs:Object.values(a).filter(j=>j.summary?.workflowId===z.workflowId).sort((j,R)=>Number(R.summary.createdSequence)-Number(j.summary.createdSequence)),selection:i,onSelect:o},z.workflowId))})]},d.alias)})})]})}function Kn(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function Id(y){return Array.isArray(y)?y.flatMap(a=>!Kn(a)||typeof a.name!="string"?[]:[{name:a.name,type:typeof a.type=="string"?a.type:void 0,description:typeof a.description=="string"?a.description:void 0}]):[]}function eh(y){if(y)try{const a=JSON.parse(y);if(!Kn(a))return;const i=Kn(a.signature)?a.signature:{};return{instructions:typeof i.instructions=="string"?i.instructions:"",inputs:Id(i.inputs),outputs:Id(i.outputs),model:a.models,runtime:a.runtime,skills:a.skills,tools:a.tools}}catch{return}}const nh=J.memo(({data:y})=>p.jsxs("button",{type:"button",className:`node-card ${y.status?`status-${y.status}`:"blueprint"}`,onClick:y.onOpen,"aria-label":`Inspect ${y.label}`,children:[p.jsx(Qd,{type:"target",position:Kd.Left,isConnectable:!1}),p.jsx("span",{className:"node-kicker",children:y.nodeType}),p.jsx("strong",{children:y.label}),y.status&&p.jsx("span",{className:"node-status",children:y.status}),y.duration&&p.jsx("span",{className:"node-duration",children:y.duration}),y.error&&p.jsx("span",{className:"node-error",children:y.error}),y.declaration&&p.jsxs("span",{className:"field-grid",children:[p.jsxs("span",{children:[p.jsx("small",{children:"Inputs"}),y.declaration.inputs.map(a=>p.jsx("span",{className:"field",children:a.name},`input-${a.name}`))]}),p.jsxs("span",{children:[p.jsx("small",{children:"Outputs"}),y.declaration.outputs.map(a=>p.jsx("span",{className:"field",children:a.name},`output-${a.name}`))]})]}),p.jsx(Qd,{type:"source",position:Kd.Right,isConnectable:!1})]}));nh.displayName="WorkflowNodeCard";function up(y){const a=Object.fromEntries(y.nodeIds.map(c=>[c,0]));for(const c of Object.values(y.graph))for(const v of c.children)a[v]=(a[v]??0)+1;const i={},o=y.nodeIds.filter(c=>a[c]===0);for(const c of o)i[c]=0;for(let c=0;cv.map((d,g)=>[d,{x:Number(c)*330,y:g*220-(v.length-1)*110}])))}function sp(y){if(!y.startedAt)return;const a=y.endedAt||Date.now()/1e3,i=Math.max(0,a-y.startedAt);return i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m`}function cp({workflow:y,runTopology:a,runNodes:i=[],onOpenNode:o}){const f=J.useMemo(()=>{if(a)return a;if(y)return{nodeIds:y.nodeIds,graph:y.graph,nodeTypes:y.nodeTypes,displayNames:y.displayNames,agentMetadataJson:y.agentMetadataJson}},[a,y]),c=J.useMemo(()=>{if(!f)return{nodes:[],edges:[]};const v=up(f),d=Object.fromEntries(i.map(j=>[j.nodeId,j])),g=f.nodeIds.map(j=>{const R=d[j];return{id:j,type:"workflow",position:v[j],data:{label:f.displayNames[j]||R?.name||j,nodeType:f.nodeTypes[j]||R?.nodeType||"step",status:R?.status,error:R?.error,duration:R?sp(R):void 0,declaration:eh(a?a.agentMetadataJson[j]:y?.agentMetadataJson[j]),onOpen:()=>o(j)}}}),m=new Set,z=[];for(const[j,R]of Object.entries(f.graph))for(const C of R.children){const Y=`${j}->${C}`;m.has(Y)||(m.add(Y),z.push({id:Y,source:j,target:C,markerEnd:{type:Mm.ArrowClosed},className:"dag-edge"}))}return{nodes:g,edges:z}},[o,i,a,f,y]);return p.jsxs(_m,{nodes:c.nodes,edges:c.edges,nodeTypes:{workflow:nh},fitView:!0,fitViewOptions:{padding:.24},minZoom:.25,maxZoom:1.8,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[p.jsx(Rm,{color:"rgba(255,255,255,.06)",gap:24,size:1}),p.jsx(wm,{showInteractive:!1})]})}function op(y,a,i){const o=new Array(y);return new Proxy(o,{get(f,c,v){if(typeof c=="string"){const d=c.charCodeAt(0);if(d>=48&&d<=57){const g=+c;if(Number.isInteger(g)&&g>=0&&go[z]!==m))&&(o=d,f=a(...d),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(f),c=!1),f}return v.updateDeps=d=>{o=d},v}function Pd(y,a){if(y===void 0)throw new Error("Unexpected undefined");return y}const fp=(y,a)=>Math.abs(y-a)<1.01,rp=(y,a,i)=>{let o;return function(...f){y.clearTimeout(o),o=y.setTimeout(()=>a.apply(this,f),i)}};let Ma;const Lc=()=>{if(Ma!==void 0)return Ma;if(typeof navigator>"u")return Ma=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ma=!0;const y=navigator.maxTouchPoints;return Ma=navigator.platform==="MacIntel"&&y!==void 0&&y>0},th=y=>{const{offsetWidth:a,offsetHeight:i}=y;return{width:a,height:i}},dp=y=>y,hp=y=>{const a=Math.max(y.startIndex-y.overscan,0),o=Math.min(y.endIndex+y.overscan,y.count-1)-a+1,f=new Array(o);for(let c=0;c{const i=y.scrollElement;if(!i)return;const o=y.targetWindow;if(!o)return;const f=v=>{const{width:d,height:g}=v;a({width:Math.round(d),height:Math.round(g)})};if(f(th(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(v=>{const d=()=>{const g=v[0];if(g?.borderBoxSize){const m=g.borderBoxSize[0];if(m){f({width:m.inlineSize,height:m.blockSize});return}}f(th(i))};y.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},tu={passive:!0},mp=typeof window>"u"?!0:"onscrollend"in window,yp=(y,a,i)=>{const o=y.scrollElement;if(!o)return;const f=y.targetWindow;if(!f)return;const c=y.options.useScrollendEvent&∓let v=0;const d=c?null:rp(f,()=>a(v,!1),y.options.isScrollingResetDelay),g=j=>()=>{v=i(o),d?.(),a(v,j)},m=g(!0),z=g(!1);return o.addEventListener("scroll",m,tu),c&&o.addEventListener("scrollend",z,tu),()=>{o.removeEventListener("scroll",m),c&&o.removeEventListener("scrollend",z)}},pp=(y,a)=>yp(y,a,i=>{const{horizontal:o,isRtl:f}=y.options;return o?i.scrollLeft*(f&&-1||1):i.scrollTop}),vp=(y,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(y),f=i.options.getItemKey(o);return i.itemSizeCache.get(f)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(y),f=i.options.getItemKey(o),c=i.itemSizeCache.get(f);if(c!==void 0)return c}return y[i.options.horizontal?"offsetWidth":"offsetHeight"]},bp=(y,{adjustments:a=0,behavior:i},o)=>{var f,c;(c=(f=o.scrollElement)==null?void 0:f.scrollTo)==null||c.call(f,{[o.options.horizontal?"left":"top"]:y+a,behavior:i})},Sp=bp;class Tp{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,f;return((f=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:f.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(f=>{f.forEach(c=>{const v=()=>{const d=c.target,g=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,z]of this.elementsCache)if(z===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(d,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(v):v()})}));return{disconnect:()=>{var f;(f=o())==null||f.disconnect(),i=null},observe:f=>{var c;return(c=o())==null?void 0:c.observe(f,{box:"border-box"})},unobserve:f=>{var c;return(c=o())==null?void 0:c.unobserve(f)}}})(),this.range=null,this.setOptions=i=>{var o,f;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:dp,rangeExtractor:hp,onChange:()=>{},measureElement:vp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const R in i){const C=i[R];C!==void 0&&(c[R]=C)}const v=this.options;let d=null,g=null,m=!1;if(v!==void 0&&v.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const R=v.count,C=c.count,Y=this.getMeasurements(),G=R>0?((o=Y[0])==null?void 0:o.key)??v.getItemKey(0):null,ut=R>0?((f=Y[R-1])==null?void 0:f.key)??v.getItemKey(R-1):null;if(C!==R||R>0&&C>0&&(c.getItemKey(0)!==G||c.getItemKey(C-1)!==ut)){m=!0;const tt=R>0?this.getVirtualItemForOffset(this.getScrollOffset())??Y[0]:null;tt&&(d=[tt.key,this.getScrollOffset()-tt.start]);const ht=c.followOnAppend===!0?"auto":c.followOnAppend||null;ht&&C>R&&this.isAtEnd(v.scrollEndThreshold)&&(R===0||c.getItemKey(C-1)!==ut)&&(g=ht)}}this.options=c,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let z=!1,j=0;if(d&&this.scrollOffset!==null){const[R,C]=d,Y=this.getMeasurements(),{count:G,getItemKey:ut}=this.options;let K=0;for(;K{var o,f;(f=(o=this.options).onChange)==null||f.call(o,this,i)},this.maybeNotify=_l(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,v)=>{if(v&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=v?d===c?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Lc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",v,tu),c.addEventListener("touchend",d,tu),this.unsubs.push(()=>{c.removeEventListener("touchstart",v),c.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const f=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,f&&this.scrollElement&&this.options.enabled){const[c,v,d,g]=f;c!==null&&!d&&(Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?g!==0&&(this._iosDeferredAdjustment+=g):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const f=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=f,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=_l(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,f,c,v,d,g,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m}),{key:!1}),this.getMeasurements=_l(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m},z)=>{const j=this.itemSizeCache;if(!v)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const K of this.laneAssignments.keys())K>=i&&this.laneAssignments.delete(K);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(K=>{this.itemSizeCache.set(K.key,K.size)}));const R=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),d===1){const K=i*2;let Z=this._flatMeasurements;if(!Z||Z.length0&<.set(Z.subarray(0,R*2)),Z=lt,this._flatMeasurements=Z}let tt;if(R===0)tt=o+f;else{const lt=R-1;tt=Z[lt*2]+Z[lt*2+1]+m}for(let lt=R;lt1){ht=tt;const Kt=Y[ht],At=Kt!==void 0?C[Kt]:void 0;lt=At?At.end+m:o+f}else if(ut===d){let Kt=0,At=G[0],Ht=Y[0];for(let Jt=1;Jtthis.options.debug}),this.calculateRange=_l(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,f,c)=>i.length===0||o===0?(this.range=null,null):(this.range=zp(i,o,f,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=_l(()=>{let i=null,o=null;const f=this.calculateRange();return f&&(i=f.startIndex,o=f.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,f,c,v)=>c===null||v===null?[]:i({startIndex:c,endIndex:v,overscan:o,count:f}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,f=i.getAttribute(o);return f?parseInt(f,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const f=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(f!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),v=Math.max(0,f-c),d=Math.min(this.options.count-1,f+c);return i>=v&&i<=d}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((v,d)=>{v.isConnected||(this.observer.unobserve(v),this.elementsCache.delete(d))});return}const o=this.indexFromElement(i),f=this.options.getItemKey(o),c=this.elementsCache.get(f);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(f,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var f,c;if(i<0||i>=this.options.count)return;let v,d,g;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)g=this.options.getItemKey(i),d=m[i*2],v=m[i*2+1];else{const R=this.measurementsCache[i];if(!R)return;g=R.key,d=R.start,v=R.size}const z=this.itemSizeCache.get(g)??v,j=o-z;if(j!==0){const R=this.options.anchorTo==="end"&&((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,C=R?this.getTotalSize():0,Y=this.getScrollOffset()+this.scrollAdjustments,ut=!this.itemSizeCache.has(g)?d[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const f=[];for(let c=0,v=i.length;cthis.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const f=this._flatMeasurements,c=this.options.lanes===1&&f!=null,v=lh(0,o.length-1,c?d=>f[d*2]:d=>Pd(o[d]).start,i);return Pd(o[v])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,f=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),v=this.getScrollOffset();o==="auto"&&(o=i>=v+c?"end":"start"),o==="center"?i+=(f-c)/2:o==="end"&&(i-=c);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const f=this.getSize(),c=this.getScrollOffset(),v=this.measurementsCache[i];if(!v)return;if(o==="auto")if(v.end>=c+f-this.options.scrollPaddingEnd)o="end";else if(v.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?v.end+this.options.scrollPaddingEnd:v.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,v.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),v=this.now();this.scrollState={index:null,align:o,behavior:f,startedAt:v,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[v,d]=c,g=this.now();this.scrollState={index:i,align:d,behavior:f,startedAt:g,lastTargetOffset:v,stableFrames:0},this._scrollToOffset(v,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const f=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let f;if(o.length===0)f=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,v=this._flatMeasurements;v!=null?f=v[c*2]+v[c*2+1]:f=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let v=o.length-1;for(;v>=0&&c.some(d=>d===null);){const d=o[v];c[d.lane]===null&&(c[d.lane]=d.end),v--}f=Math.max(...c.filter(d=>d!==null))}return Math.max(f-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const f of o)f&&this.itemSizeCache.has(f.key)&&i.push({index:f.index,key:f.key,start:f.start,size:f.size,end:f.end,lane:f.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:f})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:f,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,f=o?o[0]:this.scrollState.lastTargetOffset,c=1,v=f!==this.scrollState.lastTargetOffset;if(!v&&fp(f,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==f&&this._scrollToOffset(f,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,v){const d=this.getSize()||600,g=Math.abs(f-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&g>d;this.scrollState.lastTargetOffset=f,m||(this.scrollState.behavior="auto"),this._scrollToOffset(f,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const lh=(y,a,i,o)=>{for(;y<=a;){const f=(y+a)/2|0,c=i(f);if(co)a=f-1;else return f}return y>0?y-1:0};function kp(y,a,i){let o=0;for(;o<=a;){const f=(o+a)/2|0,c=y[f*2];if(ci)a=f-1;else return f}return o>0?o-1:0}function zp(y,a,i,o,f){const c=y.length-1;if(y.length<=o)return{startIndex:0,endIndex:c};if(o===1&&f!==null){const m=kp(f,c,i);let z=m;const j=i+a;for(;zy[m].start,i),g=d;if(o===1)for(;g1){const m=Array(o).fill(0);for(;gj=0&&z.some(j=>j>=i);){const j=y[d];z[j.lane]=j.start,d--}d=Math.max(0,d-d%o),g=Math.min(c,g+(o-1-g%o))}return{startIndex:d,endIndex:g}}const Hc=typeof document<"u"?J.useLayoutEffect:J.useEffect;function Ep({useFlushSync:y=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const f=J.useReducer(z=>z+1,0)[1],c=J.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const v=z=>{const j=c.current;if(!j.enabled||!j.container)return;const R=z.getTotalSize();if(R!==j.lastSize){j.lastSize=R;const C=z.options.horizontal?"width":"height";j.container.style[C]=`${R}px`}},d=z=>{const j=c.current;if(!j.enabled||!j.container)return;v(z);const R=!!z.options.horizontal,C=j.mode==="transform",Y=R?"left":"top",G=z.options.scrollMargin,ut=z.getVirtualItems();for(const K of ut){const Z=K.start-G,tt=z.elementsCache.get(K.key);tt&&j.lastPositions.get(tt)!==Z&&(j.lastPositions.set(tt,Z),C?tt.style.transform=R?`translate3d(${Z}px, 0, 0)`:`translate3d(0, ${Z}px, 0)`:tt.style[Y]=`${Z}px`)}},g={...o,onChange:(z,j)=>{var R;const C=c.current;let Y=!0;if(C.enabled){d(z);const G=z.range,ut=C.prevRange;Y=!ut||ut.isScrolling!==z.isScrolling||ut.startIndex!==G?.startIndex||ut.endIndex!==G?.endIndex,Y&&(C.prevRange=G?{startIndex:G.startIndex,endIndex:G.endIndex,isScrolling:z.isScrolling}:null)}Y&&(y&&j?Um.flushSync(f):f()),(R=o.onChange)==null||R.call(o,z,j)}},[m]=J.useState(()=>{const z=new Tp(g);return Object.assign(z,{containerRef:j=>{const R=c.current;if(R.container=j,R.lastSize=null,j&&R.enabled){const C=z.getTotalSize();R.lastSize=C;const Y=z.options.horizontal?"width":"height";j.style[Y]=`${C}px`}}})});return m.setOptions(g),Hc(()=>m._didMount(),[]),Hc(()=>(v(m),m._willUpdate())),Hc(()=>{d(m)}),m}function Np(y){return Ep({observeElementRect:gp,observeElementOffset:pp,scrollToFn:Sp,...y})}function Qn({value:y,depth:a=0}){return y===null?p.jsx("span",{className:"value-null",children:"null"}):typeof y=="string"?p.jsx("span",{className:"value-string",children:y}):typeof y=="number"||typeof y=="boolean"?p.jsx("span",{className:"value-scalar",children:String(y)}):Array.isArray(y)?p.jsx("ol",{className:"value-list",children:y.map((i,o)=>p.jsx("li",{children:p.jsx(Qn,{value:i,depth:a+1})},`${a}-${o}`))}):Kn(y)?y.kind==="predict_rlm_file"&&typeof y.path=="string"?p.jsxs("span",{className:"file-value",title:"Reported host path; contents are not copied",children:[p.jsx("span",{"aria-hidden":"true",children:"↗"}),p.jsxs("span",{children:[p.jsx("small",{children:"PredictRLM file"}),p.jsx("code",{children:y.path})]})]}):y.kind==="unavailable"&&typeof y.reason=="string"?p.jsxs("span",{className:"value-unavailable",children:["Unavailable · ",y.reason]}):p.jsx("dl",{className:"value-object",children:Object.entries(y).map(([i,o])=>p.jsxs("div",{children:[p.jsx("dt",{children:i}),p.jsx("dd",{children:p.jsx(Qn,{value:o,depth:a+1})})]},i))}):p.jsx("span",{className:"value-unavailable",children:"Unavailable"})}const Ap=[],Op=[];function Vc({value:y}){return p.jsx("pre",{className:"json-block",children:JSON.stringify(y,null,2)})}function xp(y){if(Kn(y))return Kn(y.data)?y.data:y}function jp({api:y,workflow:a,run:i,nodeId:o,liveEvents:f=Ap,liveLogs:c=Op,onClose:v}){const[d,g]=J.useState("overview"),[m,z]=J.useState([]),[j,R]=J.useState([]),[C,Y]=J.useState(),[G,ut]=J.useState(),[K,Z]=J.useState(),[tt,ht]=J.useState(!0),lt=J.useRef(new Map),Bt=J.useRef(null),$=i?.nodes.find(w=>w.nodeId===o),jt=i?i.topology?.agentMetadataJson[o??""]:a?.agentMetadataJson[o??""],Dt=jt?eh(jt):void 0;J.useEffect(()=>{if(g("overview"),z([]),R([]),Y(void 0),ut(void 0),ht(!0),lt.current.clear(),!i||!o)return;let w=!0;return Promise.all([y.listAgentEvents(i,o),y.listLogs(i)]).then(([H,bt])=>{w&&(z(H),R(bt.filter(ct=>!ct.nodeId||ct.nodeId===o)))}).catch(H=>{w&&Z(H instanceof Error?H.message:"Details unavailable")}),()=>{w=!1}},[y,o,i]);const Kt=J.useMemo(()=>{const w=new Map;for(const H of[...m,...f])w.set(H.eventSequence,H);return[...w.values()].sort((H,bt)=>Number(H.eventSequence)-Number(bt.eventSequence))},[m,f]),At=Kt.filter(w=>w.eventKind==="iteration.recorded"),Ht=J.useMemo(()=>{const w=new Map;for(const H of[...j,...c])w.set(H.sequence,H);return[...w.values()].sort((H,bt)=>Number(H.sequence)-Number(bt.sequence))},[c,j]),Jt=J.useMemo(()=>{const w=$?.trace?.header?.usageJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.usageJson]),de=J.useMemo(()=>{const w=$?.trace?.header?.telemetryJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.telemetryJson]),he=d==="inputs"?Dt?.inputs:d==="output"?Dt?.outputs:void 0,M=Np({count:At.length,getScrollElement:()=>Bt.current,estimateSize:()=>64,overscan:6});if(J.useEffect(()=>{!tt||!At.length||Y(At.at(-1).eventSequence)},[tt,At]),J.useEffect(()=>{const w=Kt.find(ct=>ct.eventSequence===C);if(!w?.bodyToken){ut(void 0);return}const H=lt.current.get(w.bodyToken);if(H!==void 0){lt.current.delete(w.bodyToken),lt.current.set(w.bodyToken,H),ut(H);return}let bt=!0;return ut(void 0),Z(void 0),y.readDetail(w.bodyToken).then(ct=>{if(bt){for(lt.current.delete(w.bodyToken),lt.current.set(w.bodyToken,ct);lt.current.size>8;){const ot=lt.current.keys().next().value;if(ot===void 0)break;lt.current.delete(ot)}ut(ct)}}).catch(ct=>{bt&&Z(ct instanceof Error?ct.message:"Detail unavailable")}),()=>{bt=!1}},[y,Kt,C]),J.useEffect(()=>{const w=d==="inputs"?"run.started":d==="output"?"run.succeeded":void 0;if(!w)return;const H=[...Kt].reverse().find(bt=>bt.eventKind===w);H&&Y(H.eventSequence)},[Kt,d]),!i&&a&&o)return p.jsxs("aside",{className:"inspector","aria-label":"Node declaration",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Declaration"}),p.jsx("h2",{children:a.displayNames[o]||o})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),Dt?p.jsxs("div",{className:"inspector-body declaration",children:[p.jsxs("section",{children:[p.jsx("h3",{children:"Instructions"}),p.jsx("p",{className:"instructions",children:Dt.instructions||"No instructions"})]}),p.jsxs("section",{className:"signature-columns",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"Inputs"}),Dt.inputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]}),p.jsxs("div",{children:[p.jsx("h3",{children:"Outputs"}),Dt.outputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Runtime"}),p.jsx(Vc,{value:Dt.runtime})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Models"}),p.jsx(Vc,{value:Dt.model})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Skills & tools"}),p.jsx(Vc,{value:{skills:Dt.skills,tools:Dt.tools}})]})]}):p.jsx("p",{className:"empty-copy",children:"This node has no agent declaration metadata."})]});if(!i||!$)return null;const B=xp(G),Q=d==="inputs"?"inputs":"outputs";return p.jsxs("aside",{className:"inspector","aria-label":"Run inspector",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Historical execution"}),p.jsx("h2",{children:$.name}),p.jsx("span",{className:`status-pill status-${$.status}`,children:$.status})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),p.jsx("nav",{className:"inspector-tabs","aria-label":"Run detail views",children:["overview","inputs","output","trace","logs"].map(w=>p.jsx("button",{type:"button",className:d===w?"active":"",onClick:()=>g(w),children:w},w))}),p.jsxs("div",{className:"inspector-body",children:[K&&p.jsx("p",{className:"error-banner",children:K}),d==="overview"&&p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:"metric-grid",children:[p.jsxs("div",{children:[p.jsx("small",{children:"Status"}),p.jsx("strong",{children:$.status})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Revision"}),p.jsx("strong",{children:$.revision})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Started"}),p.jsx("strong",{children:$.startedAt?"yes":"—"})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Duration"}),p.jsx("strong",{children:$.startedAt&&$.endedAt?`${Math.max(0,$.endedAt-$.startedAt).toFixed(2)}s`:"—"})]})]}),$.error&&p.jsx("p",{className:"node-failure",children:$.error}),$.trace&&p.jsxs("section",{children:[p.jsx("h3",{children:"Trace header"}),p.jsxs("dl",{className:"trace-header",children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Status"}),p.jsx("dd",{children:$.trace.status})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Events"}),p.jsx("dd",{children:$.trace.eventCount})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Size"}),p.jsxs("dd",{children:[$.trace.sizeBytes," B"]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Complete"}),p.jsx("dd",{children:$.trace.complete?"yes":"no"})]}),$.trace.header&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Model"}),p.jsx("dd",{children:$.trace.header.model})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Iterations"}),p.jsxs("dd",{children:[$.trace.header.iterations,"/",$.trace.header.maxIterations]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Duration"}),p.jsxs("dd",{children:[$.trace.header.durationMs," ms"]})]})]})]}),Jt!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Usage"}),p.jsx(Qn,{value:Jt})]}),de!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Telemetry"}),p.jsx(Qn,{value:de})]})]})]}),(d==="inputs"||d==="output")&&p.jsxs("section",{children:[p.jsx("h3",{children:d==="inputs"?"Invocation inputs":"Terminal output"}),he?.length?p.jsxs("div",{className:"declared-fields",children:[p.jsx("small",{children:"Declared fields"}),he.map(w=>p.jsxs("span",{children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type})]},w.name))]}):null,B&&Q in B?p.jsx(Qn,{value:B[Q]}):p.jsxs("p",{className:"empty-copy",children:["No retained ",d," are available."]})]}),d==="trace"&&p.jsxs("section",{className:"trace-layout",children:[p.jsxs("div",{className:"trace-toolbar",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"RunTrace"}),p.jsxs("span",{children:[At.length," complete turns"]})]}),p.jsx("button",{type:"button",className:tt?"toggle active":"toggle",onClick:()=>ht(w=>!w),children:tt?"Following live":"Follow latest"})]}),p.jsx("div",{className:"turn-list",ref:Bt,children:p.jsx("div",{style:{height:M.getTotalSize(),position:"relative"},children:M.getVirtualItems().map(w=>{const H=At[w.index];return p.jsxs("button",{type:"button",className:`turn-row ${C===H.eventSequence?"active":""} ${H.error?"failed":""}`,style:{transform:`translateY(${w.start}px)`},onClick:()=>{ht(!1),Y(H.eventSequence)},children:[p.jsxs("strong",{children:["Turn ",H.iteration??w.index+1]}),p.jsx("span",{children:H.durationMs?`${H.durationMs} ms`:"—"}),p.jsxs("small",{children:[H.toolCount," tools · ",H.predictCount," predicts"]})]},H.eventSequence)})})}),p.jsx("div",{className:"turn-detail",children:G!==void 0?p.jsx(Qn,{value:G}):p.jsx("p",{className:"empty-copy",children:"Select a turn."})})]}),d==="logs"&&p.jsxs("section",{children:[p.jsx("h3",{children:"Node logs"}),p.jsx("div",{className:"log-list",children:Ht.map(w=>p.jsxs("button",{type:"button",onClick:()=>{y.readDetail(w.bodyToken).then(ut).catch(H=>{Z(H instanceof Error?H.message:"Log unavailable")})},children:[p.jsx("span",{className:`log-level level-${w.level}`,children:w.level}),p.jsx("time",{children:new Date(w.timestamp*1e3).toLocaleTimeString()}),p.jsxs("span",{children:["#",w.sequence]})]},w.sequence))}),G!==void 0&&p.jsx(Qn,{value:G})]})]})]})}function Dp({value:y,onChange:a}){const i=J.useRef(null);return J.useEffect(()=>{if(!i.current)return;const o=new Ii({parent:i.current,state:Cm.create({doc:y,extensions:[Lm(),Hm.of([]),Ii.lineWrapping,Ii.theme({"&":{backgroundColor:"#ffffff",color:"#17211c"},".cm-content":{caretColor:"#2563eb",minHeight:"110px"},".cm-gutters":{backgroundColor:"#f6f8f7",color:"#7b8680",border:"0"},"&.cm-focused":{outline:"1px solid #9bb6f5"}}),Ii.updateListener.of(f=>{f.docChanged&&a(f.state.doc.toString())})]})});return()=>o.destroy()},[]),p.jsx("div",{className:"json-editor",ref:i})}function Mp(y){const a=JSON.parse(y);if(!Kn(a))throw new Error("Run input must be a JSON object");return a}function _p({workflow:y,run:a,pending:i,onStart:o,onCancel:f}){const[c,v]=J.useState(!1),[d,g]=J.useState("{}"),[m,z]=J.useState(),j=a?.summary?.status==="pending"||a?.summary?.status==="running",R=async()=>{if(!y)return;z(void 0);let C;if(c)try{C=Mp(d)}catch(Y){z(Y instanceof Error?Y.message:"Run input is invalid JSON");return}try{await o(y.workflowId,C)}catch(Y){z(Y instanceof Error?Y.message:"Operator rejected the run")}};return p.jsxs("div",{className:"run-controls",children:[y&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"run-button",disabled:i?.kind==="start",onClick:()=>{R()},children:i?.kind==="start"?"Requesting…":"Run"}),p.jsx("button",{type:"button",className:`input-toggle ${c?"active":""}`,onClick:()=>v(C=>!C),children:c?"Hide JSON input":"Add JSON input"})]}),j&&a?.summary&&p.jsx("button",{type:"button",className:"cancel-button",disabled:i?.kind==="cancel",onClick:()=>{z(void 0),f(a.summary.runId).catch(C=>{z(C instanceof Error?C.message:"Cancellation failed")})},children:i?.kind==="cancel"?"Cancelling…":"Cancel run"}),c&&y&&p.jsxs("div",{className:"input-popover",children:[p.jsxs("div",{children:[p.jsx("strong",{children:"Workflow input"}),p.jsx("span",{children:"Schema-blind JSON object"})]}),p.jsx(Dp,{value:d,onChange:g})]}),m&&p.jsx("div",{className:"action-error",children:m})]})}const ah={runs:{},liveEvents:{},liveLogs:{},operatorInstanceId:"",sequence:"0",connection:"connecting"};function Rp(y,a){if(a.type==="baseline"){const g=Object.fromEntries(a.baseline.runs.filter(m=>m.summary).map(m=>[m.summary.runId,m]));return{...ah,catalog:a.baseline.catalog,runs:g,operatorInstanceId:a.baseline.catalog.operatorInstanceId,sequence:a.baseline.asOfSequence,connection:"live"}}if(a.type==="connection")return{...y,connection:a.connection,error:a.error};if(a.type==="action")return{...y,action:a.action};const{envelope:i}=a;if(i.operatorInstanceId!==y.operatorInstanceId)throw new Error("Operator epoch changed");if(i.payload.oneofKind!=="update")throw new Error("Operator requested a structural reset");const o=i.payload.update;if(BigInt(o.sequence)!==BigInt(y.sequence)+1n)throw new Error(`Operator update gap after sequence ${y.sequence}`);const f={...y,sequence:o.sequence,error:void 0},c=o.change;if(c.oneofKind==="catalogReplaced")return c.catalogReplaced.catalog&&(f.catalog=c.catalogReplaced.catalog),f;if(c.oneofKind==="runCreated"&&c.runCreated.summary){const g=c.runCreated.summary;return f.runs={...y.runs,[g.runId]:{operatorInstanceId:y.operatorInstanceId,asOfSequence:o.sequence,summary:g,nodes:c.runCreated.nodes,latestLogSequence:"0",logPageToken:"",topology:c.runCreated.topology}},f}const v=c.oneofKind==="runStatusChanged"?c.runStatusChanged.runId:c.oneofKind==="nodeStatusChanged"?c.nodeStatusChanged.runId:c.oneofKind==="logAppended"?c.logAppended.runId:c.oneofKind==="agentEventAppended"?c.agentEventAppended.runId:c.oneofKind==="traceFinalized"?c.traceFinalized.runId:"",d=y.runs[v];if(!d)throw new Error(`Operator update referenced unknown run ${v}`);if(c.oneofKind==="runStatusChanged"&&d.summary)f.runs={...y.runs,[v]:{...d,summary:{...d.summary,status:c.runStatusChanged.status,startedAt:c.runStatusChanged.startedAt,endedAt:c.runStatusChanged.endedAt,revision:c.runStatusChanged.revision}}};else if(c.oneofKind==="nodeStatusChanged"){const g=c.nodeStatusChanged;f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(m=>m.nodeId===g.nodeId?{...m,status:g.status,startedAt:g.startedAt,endedAt:g.endedAt,revision:g.revision,error:g.error}:m)}}}else if(c.oneofKind==="logAppended"&&c.logAppended.log)f.liveLogs={...y.liveLogs,[v]:[...y.liveLogs[v]??[],c.logAppended.log]};else if(c.oneofKind==="agentEventAppended"&&c.agentEventAppended.event){const g=`${v}:${c.agentEventAppended.nodeId}`;f.liveEvents={...y.liveEvents,[g]:[...y.liveEvents[g]??[],c.agentEventAppended.event]}}else c.oneofKind==="traceFinalized"&&c.traceFinalized.trace&&(f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(g=>g.nodeId===c.traceFinalized.nodeId?{...g,trace:c.traceFinalized.trace}:g)}});return f}function wp(y){const[a,i]=J.useReducer(Rp,ah),o=J.useRef(0),f=J.useCallback(async()=>{const d=await y.loadBaseline();return i({type:"baseline",baseline:d}),d},[y]);J.useEffect(()=>{const d=++o.current;let g=!1;return(async()=>{let z=250;for(;!g&&o.current===d;)try{i({type:"connection",connection:"connecting"});const j=await y.loadBaseline();if(g)return;i({type:"baseline",baseline:j}),z=250;let R=j.asOfSequence;for await(const C of y.streamUpdates(j.catalog.operatorInstanceId,R)){if(g)return;if(C.payload.oneofKind!=="update"||BigInt(C.payload.update.sequence)!==BigInt(R)+1n)break;i({type:"envelope",envelope:C}),R=C.payload.update.sequence}i({type:"connection",connection:"reconnecting"})}catch(j){if(g)return;i({type:"connection",connection:"reconnecting",error:j instanceof Error?j.message:"Operator connection failed"});const{promise:R,resolve:C}=Promise.withResolvers();window.setTimeout(C,z),await R,z=Math.min(z*2,4e3)}})(),()=>{g=!0,o.current+=1}},[y]);const c=J.useCallback(async(d,g)=>{i({type:"action",action:{kind:"start",target:d}});try{return await y.startRun(d,g)}finally{i({type:"action",action:void 0})}},[y]),v=J.useCallback(async d=>{i({type:"action",action:{kind:"cancel",target:d}});try{await y.cancelRun(d)}finally{i({type:"action",action:void 0})}},[y]);return{state:a,reconcile:f,startRun:c,cancelRun:v}}function Up({api:y}){const{state:a,startRun:i,cancelRun:o}=wp(y),[f,c]=J.useState(),[v,d]=J.useState();J.useEffect(()=>{const G=a.catalog?.workflows??[];if(!G.length){c(void 0);return}if(!f){c({kind:"workflow",workflowId:G[0].workflowId});return}G.some(ut=>ut.workflowId===f.workflowId)||c({kind:"workflow",workflowId:G[0].workflowId})},[f,a.catalog]);const g=a.catalog?.workflows.find(G=>G.workflowId===f?.workflowId),m=f?.kind==="run"?a.runs[f.runId]:void 0,z=J.useMemo(()=>Object.values(a.runs).filter(G=>G.summary?.workflowId===g?.workflowId).sort((G,ut)=>Number(ut.summary.createdSequence)-Number(G.summary.createdSequence))[0],[a.runs,g?.workflowId]),j=J.useCallback(G=>d(G),[]),R=J.useCallback(G=>{c(G),d(void 0)},[]),C=m??(f?.kind==="workflow"?z:void 0),Y=m&&v?`${m.summary?.runId}:${v}`:"";return p.jsxs("div",{className:"app-shell",children:[p.jsxs("header",{className:"topbar",children:[p.jsxs("div",{className:"brand",children:[p.jsx("span",{className:"brand-mark","aria-hidden":"true",children:"A"}),p.jsxs("div",{children:[p.jsx("strong",{children:"Avalanche"}),p.jsx("span",{children:"Operator"})]})]}),p.jsxs("div",{className:"breadcrumb",children:[p.jsx("span",{children:g?.rootAlias||"Local operator"}),g&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:g.displayName})]}),m?.summary&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:m.summary.runId})]})]}),p.jsxs("div",{className:`connection connection-${a.connection}`,children:[p.jsx("span",{}),a.connection==="live"?"Live":a.connection,p.jsxs("small",{children:["seq ",a.sequence]})]})]}),a.error&&p.jsx("div",{className:"connection-error",children:a.error}),p.jsxs("main",{className:`workspace ${v?"with-inspector":""}`,children:[p.jsx(ip,{catalog:a.catalog,runs:a.runs,selection:f,onSelect:R}),p.jsxs("section",{className:"canvas-shell",children:[p.jsxs("header",{className:"view-header",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:m?"Historical run":"Current definition"}),p.jsx("h1",{children:m?.summary?.runId||g?.displayName||"Operator"}),p.jsx("p",{children:m?`Recorded topology · ${m.summary?.status??"unknown"}`:g?`${g.nodeIds.length} nodes · ${g.relativeFile}`:"Waiting for a workflow catalog"})]}),p.jsx(_p,{workflow:m?void 0:g,run:m??C,pending:a.action,onStart:i,onCancel:o})]}),p.jsxs("div",{className:m?"canvas run-canvas":"canvas blueprint-canvas",children:[g||m?.topology?p.jsx(cp,{workflow:m?void 0:g,runTopology:m?.topology,runNodes:m?.nodes,onOpenNode:j}):p.jsxs("div",{className:"empty-state",children:[p.jsx("span",{children:"◇"}),p.jsx("h2",{children:"No workflows discovered"}),p.jsx("p",{children:"Catalog changes will appear here as the operator scans configured targets."})]}),m&&p.jsxs("div",{className:"historical-badge",children:[p.jsx("span",{children:"Immutable run snapshot"}),"Current workflow changes do not alter this canvas"]})]})]}),v&&p.jsx(jp,{api:y,workflow:g,run:m,nodeId:v,liveEvents:a.liveEvents[Y],liveLogs:m?.summary?a.liveLogs[m.summary.runId]:void 0,onClose:()=>d(void 0)})]})]})}const ih=document.getElementById("root");if(!ih)throw new Error("Operator UI root element is missing");Qm.createRoot(ih).render(p.jsx(J.StrictMode,{children:p.jsx(Up,{api:new ep})})); diff --git a/src/runtime/operator/web_assets/index.html b/src/runtime/operator/web_assets/index.html index ccc31d3..802ce13 100644 --- a/src/runtime/operator/web_assets/index.html +++ b/src/runtime/operator/web_assets/index.html @@ -5,11 +5,11 @@ Avalanche Operator - + - +
diff --git a/web/operator/src/RunControls.tsx b/web/operator/src/RunControls.tsx index 8767834..614bfb3 100644 --- a/web/operator/src/RunControls.tsx +++ b/web/operator/src/RunControls.tsx @@ -24,10 +24,10 @@ function JsonEditor({ value, onChange }: JsonEditorProps) { keymap.of([]), EditorView.lineWrapping, EditorView.theme({ - "&": { backgroundColor: "#0e1112", color: "#dce4df" }, - ".cm-content": { caretColor: "#eeff8c", minHeight: "110px" }, - ".cm-gutters": { backgroundColor: "#0e1112", color: "#626b67", border: "0" }, - "&.cm-focused": { outline: "1px solid #778357" }, + "&": { backgroundColor: "#ffffff", color: "#17211c" }, + ".cm-content": { caretColor: "#2563eb", minHeight: "110px" }, + ".cm-gutters": { backgroundColor: "#f6f8f7", color: "#7b8680", border: "0" }, + "&.cm-focused": { outline: "1px solid #9bb6f5" }, }), EditorView.updateListener.of((update) => { if (update.docChanged) onChange(update.state.doc.toString()); diff --git a/web/operator/src/styles.css b/web/operator/src/styles.css index a189e4a..5effa7d 100644 --- a/web/operator/src/styles.css +++ b/web/operator/src/styles.css @@ -1,49 +1,48 @@ :root { - color: #dce4df; - background: #0d1011; - font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif; + color: #17211c; + background: #f6f8f7; + font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-synthesis: none; - --panel: #131718; - --panel-raised: #181d1e; - --line: rgba(217, 232, 224, 0.1); - --muted: #87918d; - --acid: #d9ed72; - --mint: #79dab7; - --amber: #f0bd68; - --red: #f18378; + --panel: #ffffff; + --panel-raised: #ffffff; + --line: #dfe4e1; + --muted: #68746e; + --acid: #2563eb; + --mint: #16805d; + --amber: #a15c00; + --red: #c43d36; } * { box-sizing: border-box; } html, body, #root { width: 100%; height: 100%; margin: 0; overflow: hidden; } button, input { font: inherit; } button { color: inherit; } -code, pre, .eyebrow, small { font-family: "DM Mono", monospace; } +code, pre, .eyebrow, small { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .app-shell { height: 100%; display: grid; grid-template-rows: 58px auto 1fr; } .topbar { display: grid; grid-template-columns: 260px 1fr auto; align-items: center; - padding: 0 20px; border-bottom: 1px solid var(--line); background: #101314; - z-index: 10; + padding: 0 20px; border-bottom: 1px solid var(--line); background: #ffffff; + z-index: 10; box-shadow: 0 1px 2px rgba(20, 31, 26, .04); } .brand { display: flex; align-items: center; gap: 11px; } .brand-mark { - width: 30px; height: 30px; display: grid; place-items: center; color: #101314; - background: var(--acid); font-weight: 800; clip-path: polygon(50% 0, 100% 100%, 0 100%); - padding-top: 8px; + width: 30px; height: 30px; display: grid; place-items: center; color: #ffffff; + background: var(--acid); font-weight: 750; border-radius: 8px; } .brand div { display: flex; align-items: baseline; gap: 7px; } .brand strong { font-size: 15px; letter-spacing: -0.02em; } -.brand span:last-child { color: var(--muted); font: 11px "DM Mono"; text-transform: uppercase; } +.brand span:last-child { color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; } .breadcrumb { display: flex; justify-content: center; gap: 9px; color: var(--muted); font-size: 12px; } .breadcrumb i { opacity: 0.4; } -.breadcrumb strong { color: #cfd8d3; font-weight: 500; } -.connection { display: flex; align-items: center; gap: 8px; font: 11px "DM Mono"; text-transform: capitalize; } -.connection > span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); } -.connection-live > span { background: var(--mint); box-shadow: 0 0 10px var(--mint); } -.connection small { color: #59615e; margin-left: 5px; } +.breadcrumb strong { color: #26322c; font-weight: 600; } +.connection { display: flex; align-items: center; gap: 8px; font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: capitalize; } +.connection > span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); } +.connection-live > span { background: var(--mint); } +.connection small { color: #87918c; margin-left: 5px; } .connection-error, .action-error, .error-banner { - background: #4c2525; color: #ffd4cf; padding: 8px 18px; font-size: 12px; - border-bottom: 1px solid #813c37; + background: #fff1f0; color: #9d2923; padding: 8px 18px; font-size: 12px; + border-bottom: 1px solid #efb9b5; } .workspace { min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr); } @@ -53,7 +52,7 @@ code, pre, .eyebrow, small { font-family: "DM Mono", monospace; } .eyebrow { display: block; color: var(--acid); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; } h1, h2, h3, p { margin-top: 0; } .explorer h2 { margin: 5px 0 0; font-size: 17px; } -.catalog-revision { position: absolute; right: 18px; bottom: 17px; color: #67706c; font: 9px "DM Mono"; } +.catalog-revision { position: absolute; right: 18px; bottom: 17px; color: #7b8680; font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .target-list { padding: 4px 10px 30px; } .target { border-top: 1px solid var(--line); padding-top: 7px; margin-top: 4px; } .target-heading, .tree-row, .tree-select, .run-select { width: 100%; min-width: 0; } @@ -61,160 +60,162 @@ h1, h2, h3, p { margin-top: 0; } background: none; border: 0; cursor: pointer; text-align: left; } .target-heading { display: grid; grid-template-columns: 12px 22px minmax(0,1fr); gap: 5px; align-items: center; padding: 8px 5px; } -.target-heading > span:first-child { color: #5e6763; } -.target-kind { width: 20px; height: 20px; border: 1px solid #49524e; border-radius: 3px; display: grid; place-items: center; font: 9px "DM Mono"; color: #a8b1ad; } +.target-heading > span:first-child { color: #7a8580; } +.target-kind { width: 20px; height: 20px; border: 1px solid #cbd2ce; border-radius: 5px; display: grid; place-items: center; font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #55615b; background: #f7f9f8; } .target-heading strong, .target-heading small, .tree-select strong, .tree-select small, .run-select strong, .run-select small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .target-heading strong { font-size: 11px; font-weight: 600; } -.target-heading small { color: #5f6965; font-size: 8px; margin-top: 2px; } -.workflow-list { border-left: 1px solid #303637; margin-left: 16px; padding-left: 7px; } +.target-heading small { color: #7b8680; font-size: 8px; margin-top: 2px; } +.workflow-list { border-left: 1px solid #e2e7e4; margin-left: 16px; padding-left: 7px; } .tree-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: stretch; } -.tree-disclosure { color: #5f6865; text-align: center; padding: 0; } -.tree-select { display: grid; grid-template-columns: 23px minmax(0, 1fr); gap: 4px; padding: 8px; border-radius: 4px; } -.tree-select:hover, .run-select:hover, .tree-select.active, .run-select.active { background: #202627; } +.tree-disclosure { color: #75807b; text-align: center; padding: 0; } +.tree-select { display: grid; grid-template-columns: 23px minmax(0, 1fr); gap: 4px; padding: 8px; border-radius: 7px; } +.tree-select:hover, .run-select:hover, .tree-select.active, .run-select.active { background: #f1f4f2; } .tree-select.active { box-shadow: inset 2px 0 var(--acid); } .workflow-glyph { color: var(--acid); font-size: 16px; } .tree-select strong { font-size: 11px; font-weight: 600; } -.tree-select small, .run-select small { color: #68716e; font-size: 8px; margin-top: 3px; } -.run-branches { margin-left: 28px; border-left: 1px dashed #303637; padding: 3px 0 6px 8px; } -.run-select { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 5px; align-items: center; padding: 7px; border-radius: 4px; } -.run-select strong { font: 9px "DM Mono"; } -.run-dot { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font: 9px "DM Mono"; background: #252c2a; color: var(--muted); } +.tree-select small, .run-select small { color: #7b8680; font-size: 8px; margin-top: 3px; } +.run-branches { margin-left: 28px; border-left: 1px dashed #d9dfdc; padding: 3px 0 6px 8px; } +.run-select { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 5px; align-items: center; padding: 7px; border-radius: 7px; } +.run-select strong { font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } +.run-dot { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #eef2f0; color: var(--muted); } .run-dot.status-success { color: var(--mint); } .run-dot.status-failed { color: var(--red); } .run-dot.status-running { color: var(--acid); } -.no-runs { display: block; color: #525a57; padding: 7px; font: 8px "DM Mono"; } -.diagnostics { margin: 0 12px 12px; padding: 9px; background: #34291c; border: 1px solid #5d472b; border-radius: 4px; font-size: 10px; } +.no-runs { display: block; color: #8a948f; padding: 7px; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } +.diagnostics { margin: 0 12px 12px; padding: 9px; background: #fff8eb; border: 1px solid #ead1a2; border-radius: 8px; font-size: 10px; } .diagnostics summary { color: var(--amber); cursor: pointer; } -.diagnostics div { margin-top: 9px; border-top: 1px solid #5d472b; padding-top: 8px; } +.diagnostics div { margin-top: 9px; border-top: 1px solid #ead1a2; padding-top: 8px; } .diagnostics strong, .diagnostics span { display: block; } -.diagnostics span { color: #ac9473; font: 8px "DM Mono"; overflow: hidden; text-overflow: ellipsis; } -.diagnostics p { color: #d4bd9b; margin: 4px 0 0; } +.diagnostics span { color: #8b7655; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; } +.diagnostics p { color: #735b37; margin: 4px 0 0; } .skeleton { padding: 20px; } -.skeleton div { height: 38px; background: #1b2021; margin-bottom: 9px; animation: pulse 1.2s infinite alternate; } +.skeleton div { height: 38px; background: #edf1ef; margin-bottom: 9px; border-radius: 7px; animation: pulse 1.2s infinite alternate; } @keyframes pulse { to { opacity: .45; } } -.canvas-shell { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr; background: #0f1213; } +.canvas-shell { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr; background: #f7f9f8; } .view-header { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; border-bottom: 1px solid var(--line); } .view-header h1 { margin: 4px 0 2px; font-size: 22px; letter-spacing: -.035em; } .view-header p { margin: 0; color: var(--muted); font-size: 11px; } .canvas { position: relative; min-height: 0; } -.blueprint-canvas { background: radial-gradient(circle at 55% 35%, rgba(72, 97, 86, .14), transparent 45%), #0f1213; } -.run-canvas { background: radial-gradient(circle at 55% 35%, rgba(89, 76, 62, .13), transparent 45%), #111313; } -.react-flow__controls { background: #1b2021; border: 1px solid var(--line); box-shadow: none; } -.react-flow__controls-button { background: #1b2021; border-bottom-color: var(--line); fill: #aeb8b3; } -.react-flow__controls-button:hover { background: #272e2f; } -.react-flow__edge-path { stroke: #66736d; stroke-width: 1.4; } -.react-flow__arrowhead polyline { stroke: #66736d; fill: #66736d; } -.node-card { width: 248px; min-height: 102px; position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 15px; text-align: left; background: #171c1d; border: 1px solid #47514d; border-radius: 6px; box-shadow: 0 14px 30px rgba(0,0,0,.25); cursor: pointer; } -.node-card:hover { border-color: var(--acid); transform: translateY(-1px); } -.node-card.blueprint { background: linear-gradient(145deg, #18201f, #15191a); } +.blueprint-canvas { background: radial-gradient(circle, #dce3df 1px, transparent 1px), #f7f9f8; background-size: 24px 24px; } +.run-canvas { background: radial-gradient(circle, #e1e4df 1px, transparent 1px), #fafaf8; background-size: 24px 24px; } +.react-flow__controls { background: #ffffff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(20, 31, 26, .08); overflow: hidden; } +.react-flow__controls-button { background: #ffffff; border-bottom-color: var(--line); fill: #55615b; } +.react-flow__controls-button:hover { background: #f1f4f2; } +.react-flow__edge-path { stroke: #87938d; stroke-width: 1.4; } +.react-flow__arrowhead polyline { stroke: #87938d; fill: #87938d; } +.node-card { width: 248px; min-height: 102px; position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 15px; text-align: left; background: #ffffff; border: 1px solid #d3dad6; border-radius: 10px; box-shadow: 0 8px 24px rgba(25, 39, 32, .08); cursor: pointer; } +.node-card:hover { border-color: var(--acid); transform: translateY(-1px); box-shadow: 0 10px 28px rgba(25, 39, 32, .12); } +.node-card.blueprint { background: #ffffff; } .node-card strong { font-size: 13px; } -.node-kicker { color: #78827e; font: 8px "DM Mono"; letter-spacing: .12em; text-transform: uppercase; } -.node-status { position: absolute; right: 12px; top: 12px; font: 8px "DM Mono"; text-transform: uppercase; color: var(--muted); } -.node-duration { color: var(--muted); font: 9px "DM Mono"; } -.node-error { color: #ffaaa2; background: rgba(118,44,40,.25); padding: 5px; border-radius: 3px; font-size: 9px; max-height: 42px; overflow: hidden; } -.node-card.status-success { border-color: #426b5c; } -.node-card.status-failed { border-color: #984d47; } -.node-card.status-running { border-color: #9aa64f; box-shadow: 0 0 0 1px rgba(217,237,114,.12), 0 14px 30px rgba(0,0,0,.25); } +.node-kicker { color: #77827c; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; } +.node-status { position: absolute; right: 12px; top: 12px; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; color: var(--muted); } +.node-duration { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } +.node-error { color: #9d2923; background: #fff1f0; padding: 5px; border-radius: 5px; font-size: 9px; max-height: 42px; overflow: hidden; } +.node-card.status-success { border-color: #7ebda4; } +.node-card.status-failed { border-color: #df8d87; } +.node-card.status-running { border-color: #7ca2f6; box-shadow: 0 0 0 2px rgba(37, 99, 235, .08), 0 8px 24px rgba(25, 39, 32, .08); } .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; border-top: 1px solid var(--line); padding-top: 8px; } .field-grid > span { min-width: 0; } -.field-grid small { display: block; color: #68726e; font-size: 7px; text-transform: uppercase; margin-bottom: 3px; } -.field { display: block; color: #b2bdb7; font: 8px "DM Mono"; overflow: hidden; text-overflow: ellipsis; } -.react-flow__handle { width: 7px; height: 7px; background: var(--acid); border: 1px solid #101314; } -.historical-badge { position: absolute; right: 18px; bottom: 18px; z-index: 5; padding: 9px 12px; background: rgba(26, 24, 21, .92); border: 1px solid #665642; color: #9d8f7c; font-size: 9px; border-radius: 4px; } -.historical-badge span { display: block; color: var(--amber); font: 8px "DM Mono"; text-transform: uppercase; margin-bottom: 3px; } -.empty-state { height: 100%; display: grid; place-content: center; text-align: center; color: #66706c; } +.field-grid small { display: block; color: #78837d; font-size: 7px; text-transform: uppercase; margin-bottom: 3px; } +.field { display: block; color: #36423c; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; } +.react-flow__handle { width: 7px; height: 7px; background: var(--acid); border: 1px solid #ffffff; } +.historical-badge { position: absolute; right: 18px; bottom: 18px; z-index: 5; padding: 9px 12px; background: rgba(255, 252, 245, .96); border: 1px solid #dfc99e; color: #766548; font-size: 9px; border-radius: 8px; box-shadow: 0 4px 14px rgba(54, 44, 25, .08); } +.historical-badge span { display: block; color: var(--amber); font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; margin-bottom: 3px; } +.empty-state { height: 100%; display: grid; place-content: center; text-align: center; color: #6d7872; } .empty-state > span { color: var(--acid); font-size: 40px; } -.empty-state h2 { color: #c6cfca; margin: 8px 0; } +.empty-state h2 { color: #27332d; margin: 8px 0; } .empty-state p { max-width: 390px; font-size: 12px; } .inspector { min-width: 0; background: var(--panel-raised); border-left: 1px solid var(--line); overflow: hidden; display: grid; grid-template-rows: auto auto 1fr; } .inspector > header { display: flex; justify-content: space-between; align-items: start; padding: 19px 20px 14px; border-bottom: 1px solid var(--line); } .inspector h2 { margin: 4px 0 5px; font-size: 18px; } -.icon-button { width: 30px; height: 30px; background: none; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-size: 19px; } -.icon-button:hover { border-color: #69736f; } -.status-pill { display: inline-flex; padding: 3px 7px; border: 1px solid #48514e; border-radius: 20px; color: var(--muted); font: 8px "DM Mono"; text-transform: uppercase; } -.status-pill.status-failed { color: var(--red); border-color: #75413d; } -.status-pill.status-success { color: var(--mint); border-color: #355e50; } +.icon-button { width: 30px; height: 30px; background: #ffffff; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-size: 19px; } +.icon-button:hover { border-color: #9da7a2; background: #f7f9f8; } +.status-pill { display: inline-flex; padding: 3px 7px; border: 1px solid #cbd2ce; border-radius: 20px; color: var(--muted); font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; background: #f7f9f8; } +.status-pill.status-failed { color: var(--red); border-color: #e5aaa5; background: #fff5f4; } +.status-pill.status-success { color: var(--mint); border-color: #a6d1c0; background: #f2fbf7; } .inspector-tabs { display: flex; overflow-x: auto; padding: 0 10px; border-bottom: 1px solid var(--line); } -.inspector-tabs button { padding: 11px 9px 9px; background: none; border: 0; border-bottom: 2px solid transparent; color: #727c77; font: 8px "DM Mono"; text-transform: uppercase; cursor: pointer; } +.inspector-tabs button { padding: 11px 9px 9px; background: none; border: 0; border-bottom: 2px solid transparent; color: #6e7973; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; cursor: pointer; } .inspector-tabs button.active { color: var(--acid); border-bottom-color: var(--acid); } .inspector-body { overflow: auto; padding: 18px 20px 30px; } .inspector-body section { margin-bottom: 23px; } -.inspector-body h3 { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #a3ada8; } -.instructions { color: #c4cdc8; white-space: pre-wrap; font-size: 12px; line-height: 1.65; } +.inspector-body h3 { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #56615b; } +.instructions { color: #36423c; white-space: pre-wrap; font-size: 12px; line-height: 1.65; } .signature-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .field-detail { border-top: 1px solid var(--line); padding: 8px 0; } .field-detail strong, .field-detail code { display: block; font-size: 10px; } -.field-detail code { color: #79837f; font-size: 8px; margin-top: 2px; } -.field-detail p { color: #78817d; font-size: 9px; margin: 4px 0 0; } +.field-detail code { color: #68746e; font-size: 8px; margin-top: 2px; } +.field-detail p { color: #737e78; font-size: 9px; margin: 4px 0 0; } .declared-fields { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; } -.declared-fields > small { width: 100%; color: #69736e; font-size: 8px; text-transform: uppercase; } -.declared-fields > span { display: inline-flex; gap: 5px; padding: 4px 6px; border: 1px solid var(--line); background: #111516; font-size: 9px; } -.declared-fields code { color: #77837d; } -.json-block { padding: 11px; background: #101415; border: 1px solid var(--line); border-radius: 4px; overflow: auto; color: #aab5af; font-size: 9px; white-space: pre-wrap; } +.declared-fields > small { width: 100%; color: #717c76; font-size: 8px; text-transform: uppercase; } +.declared-fields > span { display: inline-flex; gap: 5px; padding: 4px 6px; border: 1px solid var(--line); background: #f7f9f8; border-radius: 5px; font-size: 9px; } +.declared-fields code { color: #5d6963; } +.json-block { padding: 11px; background: #f6f8f7; border: 1px solid var(--line); border-radius: 7px; overflow: auto; color: #35413b; font-size: 9px; white-space: pre-wrap; } .metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } -.metric-grid > div { background: #111516; border: 1px solid var(--line); padding: 10px; } +.metric-grid > div { background: #f7f9f8; border: 1px solid var(--line); border-radius: 7px; padding: 10px; } .metric-grid small, .metric-grid strong { display: block; } -.metric-grid small { color: #68716e; font-size: 7px; text-transform: uppercase; } +.metric-grid small { color: #717c76; font-size: 7px; text-transform: uppercase; } .metric-grid strong { margin-top: 5px; font-size: 11px; } -.node-failure { padding: 10px; background: #3a2020; border: 1px solid #713d39; color: #ffc1ba; font-size: 10px; } +.node-failure { padding: 10px; background: #fff1f0; border: 1px solid #efb9b5; border-radius: 7px; color: #9d2923; font-size: 10px; } .trace-header, .value-object { margin: 0; } .trace-header > div, .value-object > div { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 10px; border-top: 1px solid var(--line); padding: 7px 0; } -.trace-header dt, .value-object dt { color: #727c77; font: 8px "DM Mono"; } +.trace-header dt, .value-object dt { color: #6f7a74; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .trace-header dd, .value-object dd { margin: 0; font-size: 10px; min-width: 0; } -.empty-copy { color: #69736e; font-size: 11px; } +.empty-copy { color: #76817b; font-size: 11px; } .trace-layout { display: grid; grid-template-rows: auto 220px auto; gap: 12px; } .trace-toolbar { display: flex; justify-content: space-between; align-items: center; } .trace-toolbar h3 { margin: 0 0 3px; } -.trace-toolbar span { color: #69736e; font: 8px "DM Mono"; } -.toggle { background: none; border: 1px solid #48514d; color: #818b86; border-radius: 20px; padding: 5px 8px; font: 8px "DM Mono"; cursor: pointer; } -.toggle.active { color: var(--acid); border-color: #77834a; } -.turn-list { height: 220px; overflow: auto; border: 1px solid var(--line); background: #111516; } +.trace-toolbar span { color: #717c76; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } +.toggle { background: #ffffff; border: 1px solid #cbd2ce; color: #647069; border-radius: 20px; padding: 5px 8px; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; cursor: pointer; } +.toggle.active { color: var(--acid); border-color: #9bb6f5; background: #f4f7ff; } +.turn-list { height: 220px; overflow: auto; border: 1px solid var(--line); background: #ffffff; border-radius: 7px; } .turn-row { position: absolute; left: 0; top: 0; width: 100%; height: 60px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px; background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; } -.turn-row:hover, .turn-row.active { background: #202627; } +.turn-row:hover, .turn-row.active { background: #f1f4f2; } .turn-row.active { box-shadow: inset 2px 0 var(--acid); } .turn-row.failed { box-shadow: inset 2px 0 var(--red); } .turn-row strong { font-size: 10px; } -.turn-row span, .turn-row small { color: #78817d; font: 8px "DM Mono"; } +.turn-row span, .turn-row small { color: #748079; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .turn-row small { grid-column: 1 / -1; } .turn-detail { border-top: 1px solid var(--line); padding-top: 12px; } -.value-object .value-object { border-left: 1px solid #313837; padding-left: 8px; } -.value-string { color: #c4d99d; white-space: pre-wrap; overflow-wrap: anywhere; } -.value-scalar { color: #82c8cc; } -.value-null { color: #68716e; } +.value-object .value-object { border-left: 1px solid #dfe4e1; padding-left: 8px; } +.value-string { color: #42722d; white-space: pre-wrap; overflow-wrap: anywhere; } +.value-scalar { color: #16697a; } +.value-null { color: #76817b; } .value-unavailable { color: var(--amber); font-size: 9px; } .value-list { margin: 0; padding-left: 20px; } .value-list li { margin: 5px 0; } -.file-value { display: flex; gap: 9px; padding: 9px; border: 1px solid #5f6441; background: #22251a; border-radius: 4px; color: var(--acid); } +.file-value { display: flex; gap: 9px; padding: 9px; border: 1px solid #c3d2f5; background: #f5f8ff; border-radius: 7px; color: #1d4ed8; } .file-value small, .file-value code { display: block; } -.file-value small { color: #919976; font-size: 7px; text-transform: uppercase; } +.file-value small { color: #687aa2; font-size: 7px; text-transform: uppercase; } .file-value code { margin-top: 3px; font-size: 9px; overflow-wrap: anywhere; } .log-list { margin-bottom: 12px; } -.log-list button { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; gap: 7px; padding: 7px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: #929c97; text-align: left; font: 8px "DM Mono"; cursor: pointer; } -.log-list button:hover { background: #202627; } +.log-list button { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; gap: 7px; padding: 7px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: #59655f; text-align: left; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; cursor: pointer; } +.log-list button:hover { background: #f1f4f2; } .log-level { text-transform: uppercase; } .level-error { color: var(--red); } .level-warning { color: var(--amber); } .run-controls { display: flex; align-items: center; gap: 7px; position: relative; } -.run-button, .cancel-button, .input-toggle { border-radius: 4px; padding: 8px 13px; cursor: pointer; font-size: 10px; } -.run-button { background: var(--acid); border: 1px solid var(--acid); color: #111412; font-weight: 700; } -.cancel-button { background: #3a2221; border: 1px solid #71403c; color: #f2a39b; } -.input-toggle { background: transparent; border: 1px solid #3c4541; color: #89938e; } -.input-toggle.active { color: var(--acid); border-color: #6e7848; } +.run-button, .cancel-button, .input-toggle { border-radius: 7px; padding: 8px 13px; cursor: pointer; font-size: 10px; } +.run-button { background: var(--acid); border: 1px solid var(--acid); color: #ffffff; font-weight: 700; } +.run-button:hover { background: #1d4ed8; border-color: #1d4ed8; } +.cancel-button { background: #ffffff; border: 1px solid #e0a6a1; color: #a92f29; } +.cancel-button:hover { background: #fff3f2; } +.input-toggle { background: #ffffff; border: 1px solid #cbd2ce; color: #5e6a64; } +.input-toggle.active { color: var(--acid); border-color: #9bb6f5; background: #f4f7ff; } .run-controls button:disabled { opacity: .5; cursor: wait; } -.input-popover { position: absolute; z-index: 20; right: 0; top: 43px; width: 390px; padding: 13px; background: #15191a; border: 1px solid #4a5450; box-shadow: 0 18px 50px rgba(0,0,0,.5); } +.input-popover { position: absolute; z-index: 20; right: 0; top: 43px; width: 390px; padding: 13px; background: #ffffff; border: 1px solid #cbd2ce; border-radius: 9px; box-shadow: 0 18px 50px rgba(20, 31, 26, .16); } .input-popover > div:first-child { display: flex; justify-content: space-between; margin-bottom: 9px; } .input-popover strong { font-size: 11px; } -.input-popover span { color: #6d7672; font: 8px "DM Mono"; } -.json-editor { border: 1px solid var(--line); font-size: 10px; } -.action-error { position: absolute; z-index: 21; right: 0; top: 44px; width: 390px; border: 1px solid #813c37; } +.input-popover span { color: #6d7872; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } +.json-editor { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; font-size: 10px; } +.action-error { position: absolute; z-index: 21; right: 0; top: 44px; width: 390px; border: 1px solid #efb9b5; border-radius: 7px; } .input-popover + .action-error { top: 205px; } @media (max-width: 1000px) { .workspace, .workspace.with-inspector { grid-template-columns: 230px minmax(0, 1fr); } - .inspector { position: fixed; z-index: 30; right: 0; top: 58px; bottom: 0; width: min(420px, calc(100vw - 230px)); box-shadow: -20px 0 50px rgba(0,0,0,.45); } + .inspector { position: fixed; z-index: 30; right: 0; top: 58px; bottom: 0; width: min(420px, calc(100vw - 230px)); box-shadow: -20px 0 50px rgba(20,31,26,.14); } .topbar { grid-template-columns: 210px 1fr auto; } } From 8288903b6d09cb412187c89fd75d423eed2bffa9 Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Mon, 3 Aug 2026 16:59:29 +0000 Subject: [PATCH 11/25] feat(tui): add operator web interface --- CHANGELOG.md | 10 +- README.md | 7 +- .../design.md | 15 +- .../specs/operator-web-ui/spec.md | 39 +++++ .../specs/operator-workflow-reload/spec.md | 4 + .../specs/versioned-run-topology/spec.md | 6 +- .../tasks.md | 13 ++ src/avalanche/agent/agent_step.py | 14 +- src/runtime/operator/convert.py | 8 +- src/runtime/operator/models.py | 2 +- src/runtime/operator/operator.py | 81 +++++++-- src/runtime/operator/proto/operator.proto | 2 +- src/runtime/operator/proto/operator_pb2.py | 156 +++++++++--------- src/runtime/operator/proto/operator_pb2.pyi | 10 +- src/runtime/operator/registry.py | 38 ++++- src/runtime/operator/run_worker.py | 4 +- .../web_assets/assets/index-BuH1gsyY.js | 9 + .../web_assets/assets/index-K_C1Akn9.js | 9 - ...{index-BNQSyDYz.css => index-bpf7CcuO.css} | 2 +- src/runtime/operator/web_assets/index.html | 4 +- test/operator_tests/test_operator.py | 37 ++++- .../test_operator_dev_reload.py | 27 +++ test/operator_tests/test_protocol_contract.py | 5 +- test/operator_tests/test_registry.py | 28 +++- web/operator/src/App.test.tsx | 71 ++++++++ web/operator/src/App.tsx | 13 +- web/operator/src/Explorer.tsx | 4 +- web/operator/src/GraphCanvas.test.tsx | 33 +++- web/operator/src/GraphCanvas.tsx | 66 ++++++-- web/operator/src/Inspector.test.tsx | 29 +++- web/operator/src/Inspector.tsx | 43 +++-- web/operator/src/RunControls.test.tsx | 3 + web/operator/src/RunControls.tsx | 3 + web/operator/src/generated/operator.ts | 24 +-- web/operator/src/styles.css | 57 ++++--- 35 files changed, 680 insertions(+), 196 deletions(-) create mode 100644 src/runtime/operator/web_assets/assets/index-BuH1gsyY.js delete mode 100644 src/runtime/operator/web_assets/assets/index-K_C1Akn9.js rename src/runtime/operator/web_assets/assets/{index-BNQSyDYz.css => index-bpf7CcuO.css} (75%) create mode 100644 web/operator/src/App.test.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 47eb564..12d7b65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,13 @@ - Added a same-process binary gRPC-Web listener and packaged browser assets. Loopback remains the default; non-loopback binding requires the explicit `--web-trusted-proxy` acknowledgement. -- Run topology now retains versioned agent declaration metadata, and bounded - trace descriptors expose stable PredictRLM header, usage, and telemetry - metadata without embedding complete trace bodies in structural snapshots. +- Run topology now retains only versioned agent input/output field schemas, + while bounded trace descriptors expose stable PredictRLM header, usage, and + telemetry metadata without embedding declaration instructions or complete + trace bodies in structural snapshots. +- Unchanged discovery results no longer advance catalog revisions, and the web UI + retains workflow/run navigation on narrow viewports with accessible input and + repeated-node labels plus WCAG AA secondary-text contrast. ### Operator transport diff --git a/README.md b/README.md index 2453e97..486f91f 100644 --- a/README.md +++ b/README.md @@ -388,9 +388,10 @@ ava operator --flows path/to/flows --web The browser shows the live workflow catalog, current definitions, immutable per-run topology, run controls, logs, and retained agent trace evidence. Source -changes replace only the current-definition canvas; earlier runs keep the -topology and agent declaration metadata captured when they started. The browser -listener is loopback-only by default. `--web-trusted-proxy` permits a +changes replace only the current-definition canvas; earlier runs keep their +topology and agent input/output field schemas without retaining instruction +bodies or execution configuration. The browser listener is loopback-only by +default. `--web-trusted-proxy` permits a non-loopback bind only when a trusted, authenticated proxy supplies the missing security boundary. diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/design.md b/openspec/changes/add-operator-web-ui-and-hot-reload/design.md index a4a9a32..5dac72c 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/design.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/design.md @@ -22,7 +22,7 @@ The gRPC protocol currently separates catalog listing from a stream of run-only ### Retain a topology snapshot with each run -Introduce a frozen workflow-topology value containing node ID order, adjacency graph, node types, display names, and serialized agent declaration metadata needed to interpret recorded invocation values. Construct it from the worker's `prepared` event, not the current catalog descriptor: the worker event represents what that run actually loaded and executed. Store it on the in-memory run record and include it in the structural run snapshot and transport representation. +Introduce a frozen workflow-topology value containing node ID order, adjacency graph, node types, display names, and per-agent input/output field schemas needed to interpret recorded invocation values. Construct it from the worker's `prepared` event, not the current catalog descriptor: the worker event represents what that run actually loaded and executed. Store it on the in-memory run record and include it in the structural run snapshot and transport representation. The run projection serializes only each field's name, type, and description; full declaration metadata remains current-catalog state and is not copied into runs. `RunState.nodes` remains execution state keyed by node ID. The topology snapshot is the rendering and identity layer. A run view joins the two; it never reads the current `WorkflowInfo` to supply missing nodes or edges. @@ -103,6 +103,19 @@ Workflow cards place agent input and output field lists inside their own bounds. Run cards retain the same structural edges but prioritize execution status, duration, and failure state. They do not reuse current agent field declarations, which could be incorrect for a historical run. +### Keep the browser surface responsive and accessible + +At 375 CSS pixels and wider, navigation remains available through either the persistent +Explorer or a compact disclosure rather than being removed. The workspace and canvas +use bounded, shrinkable layout tracks so the selected title, primary actions, and graph +stay inside the document viewport; graph overflow is handled by canvas pan and zoom. + +CodeMirror receives a descriptive accessible name through its editor attributes. +Secondary text colors use shared tokens that meet WCAG 2.2 Level AA contrast against +their actual backgrounds. When multiple topology nodes share one declaration display +name, cards append a stable invocation discriminator derived from retained node identity +to both the visible label and accessible name. + ### Retain bounded agent invocation inputs and outputs PredictRLM `run.started` evidence contains actual invocation inputs, but Avalanche currently projects only their field names. Preserve supported input values in that existing event, matching the terminal outputs already projected from `run.succeeded`. The run inspector reads both through existing agent-event and hydrated-trace detail paths and presents separate Inputs and Output views using declaration metadata retained with that run's topology only as labels. diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md index d0d8c2f..d671843 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md @@ -144,3 +144,42 @@ The web UI listener SHALL default to loopback-only access. Enabling non-loopback #### Scenario: Default launch - **WHEN** a user starts the operator web UI without an explicit listener host - **THEN** the UI is reachable only through a loopback address + +### Requirement: Preserve navigation and controls on narrow viewports + +The web UI SHALL retain access to workflow and run navigation, the selected view's +identity, and its primary controls at viewport widths of 375 CSS pixels or greater. +The workflow and run canvases SHALL remain bounded by the visible workspace rather +than forcing primary content beyond the document viewport. + +#### Scenario: User opens the operator on a narrow viewport +- **WHEN** the browser viewport is 375 CSS pixels wide +- **THEN** the user can access the Explorer hierarchy, select workflows and retained runs, read the selected view title, and use its primary controls without horizontal document scrolling + +#### Scenario: User opens a workflow graph on a narrow viewport +- **WHEN** a current workflow or historical run canvas is displayed at 375 CSS pixels wide +- **THEN** the canvas remains inside the visible workspace and the user can pan and zoom the graph + +### Requirement: Expose accessible controls and readable text + +The web UI SHALL provide an accessible name for every interactive control and input. +Text and meaningful graphical labels SHALL meet WCAG 2.2 Level AA minimum contrast +requirements in their rendered states. + +#### Scenario: User opens the JSON input editor +- **WHEN** the schema-blind JSON input editor is visible +- **THEN** assistive technology identifies it by a descriptive workflow-input name + +#### Scenario: Secondary workflow metadata is displayed +- **WHEN** connection, catalog, workflow, run, or node metadata is rendered +- **THEN** its foreground and background colors meet WCAG 2.2 Level AA minimum contrast + +### Requirement: Distinguish repeated node invocations + +The current-workflow and historical-run canvases SHALL expose a distinct visible and +accessible identity for each node, including when several nodes invoke the same +declared function or agent. + +#### Scenario: A workflow invokes the same declaration more than once +- **WHEN** two or more nodes have the same display name +- **THEN** each node card remains distinguishable by a stable invocation identity in both its visible label and accessible name diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-workflow-reload/spec.md b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-workflow-reload/spec.md index a45d13a..34123ea 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-workflow-reload/spec.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-workflow-reload/spec.md @@ -20,6 +20,10 @@ The operator SHALL replace the current workflow catalog only with one complete, - **WHEN** a watched source change cannot produce a valid replacement catalog - **THEN** the operator retains the last valid catalog and exposes the discovery diagnostic without publishing a partial catalog +#### Scenario: Watched sources remain unchanged +- **WHEN** no watched workflow source or effective catalog content has changed +- **THEN** the operator retains the current catalog revision and does not publish a replacement catalog update + ### Requirement: Isolate runs from later catalog revisions A catalog reload SHALL affect workflow selection and runs started after the reload. It SHALL NOT mutate the recorded definition or execution state of an existing run. diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md index 7e6d0f4..0b2ed88 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/versioned-run-topology/spec.md @@ -6,12 +6,16 @@ Retain the exact workflow definition used by each run so operator clients can re ### Requirement: Capture an immutable executed topology -When the operator creates a run, it SHALL retain an immutable workflow topology snapshot derived from the workflow that was prepared for that run. The snapshot SHALL include node identity and ordering, graph edges, node types, display metadata required to render the run's workflow graph, and serialized agent declaration metadata required to interpret retained invocation values without consulting the current catalog. +When the operator creates a run, it SHALL retain an immutable workflow topology snapshot derived from the workflow that was prepared for that run. The snapshot SHALL include node identity and ordering, graph edges, node types, display metadata required to render the run's workflow graph, and each agent node's declared input and output field schemas required to interpret retained invocation values without consulting the current catalog. Retained run field schemas SHALL contain only field names, types, and descriptions; they SHALL exclude signature names, instruction bodies, models, runtime configuration, skills, packages, modules, and tools. #### Scenario: Run begins from the current workflow - **WHEN** a run is created for a workflow - **THEN** the run has a topology snapshot matching the workflow definition actually prepared for that run +#### Scenario: Agent declaration contains execution instructions +- **WHEN** a prepared agent declaration includes signature or skill instructions and other execution configuration +- **THEN** the run topology retains only that agent's input and output field names, types, and descriptions + ### Requirement: Serve historical run topology Run detail retrieval SHALL return the run's retained topology snapshot together with its node execution state. It SHALL NOT substitute the topology of the currently discovered workflow. diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md b/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md index 811f13a..d017090 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md @@ -7,6 +7,8 @@ - [x] 1.5 Preserve bounded structured agent invocation inputs and terminal outputs in existing evidence, encode nested PredictRLM `File` values as tagged paths, and verify input, output, list, unsupported, over-limit, and worker-to-operator behavior. - [x] 1.6 Retain bounded worker-provided node failure messages in node state, snapshots, live updates, protocol conversion, and run inspection with focused regression coverage. - [x] 1.7 Decompose exportable `RunTrace` into a lightweight header, paginated rich event/turn descriptors, and complete on-demand `IterationStep` bodies; migrate TUI hydration away from monolithic `ReadTrace` and verify semantic coverage and bounded reads. +- [x] 1.8 Replace retained run declaration metadata with input/output field schemas containing only names, types, and descriptions; keep full declarations in the current catalog. +- [x] 1.9 Update topology transport and browser parsing for the schema-only projection, with regression coverage proving instructions and execution configuration are absent. ## 2. Atomic catalog reload and live updates @@ -40,3 +42,14 @@ - [x] 5.1 Run focused operator, protocol, TUI-client, adapter, and browser test suites; add an end-to-end local operator reload scenario. - [x] 5.2 Update local development and operator documentation with web UI launch, loopback exposure, reload semantics, and the distinction between workflow and run views. + +## 6. Dogfood remediation + +- [x] 6.1 Prevent unchanged watched sources or semantically unchanged discovery results from advancing the catalog revision or publishing replacement updates, with focused watcher and operator regression coverage. +- [x] 6.2 Make the healthy desktop workspace and workflow canvas consume the available viewport instead of collapsing to content height. +- [x] 6.3 Preserve Explorer workflow/run navigation, selected-view titles, primary controls, and bounded pannable canvases at 375 CSS pixels and wider. +- [x] 6.4 Give the CodeMirror workflow-input editor a descriptive accessible name and add an accessibility regression assertion. +- [x] 6.5 Update secondary metadata colors to meet WCAG 2.2 Level AA contrast in populated workflow and run views. +- [x] 6.6 Give repeated node invocations distinct visible labels and accessible names derived from stable node identity. +- [x] 6.7 Correct the retained-output empty-state grammar. +- [x] 6.8 Add browser regression coverage for desktop sizing, narrow navigation and canvas bounds, repeated invocation identity, accessible input naming, empty-state copy, and automated contrast checks. diff --git a/src/avalanche/agent/agent_step.py b/src/avalanche/agent/agent_step.py index 39f77b9..7f500bd 100644 --- a/src/avalanche/agent/agent_step.py +++ b/src/avalanche/agent/agent_step.py @@ -409,6 +409,14 @@ def make_agent(self) -> Agent: tools=self.tools, ) + def field_schema_metadata(self) -> dict[str, list[dict[str, str]]]: + """Serialize only the declared invocation field schemas.""" + signature = resolve_signature(self.signature, name=self.step_name) + return { + "inputs": _serialize_signature_fields(signature.input_fields, type_key="type"), + "outputs": _serialize_signature_fields(signature.output_fields, type_key="type"), + } + def declaration_metadata( self, workflow_defaults: Mapping[str, Any] | None = None ) -> dict[str, Any]: @@ -478,7 +486,9 @@ async def bound(*args: Any, **kwargs: Any) -> Any: _SECRET_KEY_PARTS = ("api_key", "auth", "credential", "password", "secret", "token") -def _serialize_signature_fields(fields: Mapping[str, Any]) -> list[dict[str, str]]: +def _serialize_signature_fields( + fields: Mapping[str, Any], *, type_key: str = "annotation" +) -> list[dict[str, str]]: serialized = [] for name, field in fields.items(): extra = getattr(field, "json_schema_extra", None) @@ -488,7 +498,7 @@ def _serialize_signature_fields(fields: Mapping[str, Any]) -> list[dict[str, str serialized.append( { "name": name, - "annotation": _annotation_name(getattr(field, "annotation", Any)), + type_key: _annotation_name(getattr(field, "annotation", Any)), "description": description if isinstance(description, str) else "", } ) diff --git a/src/runtime/operator/convert.py b/src/runtime/operator/convert.py index 4a19b31..360f89e 100644 --- a/src/runtime/operator/convert.py +++ b/src/runtime/operator/convert.py @@ -156,7 +156,7 @@ def workflow_topology_to_proto(topology: WorkflowTopology) -> pb.WorkflowTopolog graph={parent: pb.NodeEdges(children=children) for parent, children in topology.graph}, node_types=dict(topology.node_types), display_names=dict(topology.display_names), - agent_metadata_json=dict(topology.agent_metadata_json), + agent_field_schemas_json=dict(topology.agent_field_schemas_json), ) @@ -167,10 +167,10 @@ def workflow_topology_from_proto(msg: pb.WorkflowTopologyMsg) -> WorkflowTopolog graph=tuple((node_id, tuple(msg.graph[node_id].children)) for node_id in node_ids), node_types=tuple((node_id, msg.node_types[node_id]) for node_id in node_ids), display_names=tuple((node_id, msg.display_names[node_id]) for node_id in node_ids), - agent_metadata_json=tuple( - (node_id, msg.agent_metadata_json[node_id]) + agent_field_schemas_json=tuple( + (node_id, msg.agent_field_schemas_json[node_id]) for node_id in node_ids - if node_id in msg.agent_metadata_json + if node_id in msg.agent_field_schemas_json ), ) diff --git a/src/runtime/operator/models.py b/src/runtime/operator/models.py index fcafead..21b0737 100644 --- a/src/runtime/operator/models.py +++ b/src/runtime/operator/models.py @@ -49,7 +49,7 @@ class WorkflowTopology: graph: tuple[tuple[str, tuple[str, ...]], ...] = () node_types: tuple[tuple[str, str], ...] = () display_names: tuple[tuple[str, str], ...] = () - agent_metadata_json: tuple[tuple[str, str], ...] = () + agent_field_schemas_json: tuple[tuple[str, str], ...] = () @dataclass diff --git a/src/runtime/operator/operator.py b/src/runtime/operator/operator.py index 2ed1d7a..68cf8da 100644 --- a/src/runtime/operator/operator.py +++ b/src/runtime/operator/operator.py @@ -1346,11 +1346,14 @@ def _watch_loop(self) -> None: self._refresh_workflows() def _refresh_workflows(self) -> None: + previous = self._registry.view # Publishing descriptors and replacing schedules are one logical update. # Otherwise an old cron can resolve newly-published same-ID source in the # small window between these two operations. with self._scheduler.reconciliation_boundary(): view = self._registry.rescan(validate=routes_for) + if view is previous: + return self._scheduler.reconcile(view.by_id.values()) self._reconcile_webhooks(view.by_id.values()) self._publish_catalog(view) @@ -1406,10 +1409,10 @@ def _run_from_prepared( display_names=tuple( (node_id, prepared["display_names"][node_id]) for node_id in node_ids ), - agent_metadata_json=tuple( - (node_id, prepared["agent_metadata_json"][node_id]) + agent_field_schemas_json=tuple( + (node_id, prepared["agent_field_schemas_json"][node_id]) for node_id in node_ids - if node_id in prepared["agent_metadata_json"] + if node_id in prepared["agent_field_schemas_json"] ), ) run = RunState( @@ -2578,6 +2581,8 @@ def _replace_queue_contents(subscription: queue.Queue, item: Any) -> None: _MAX_EVENT_EDGES = 100_000 _MAX_EVENT_FIELD_LENGTH = 4096 _MAX_EVENT_MESSAGE_LENGTH = 65_536 +_MAX_EVENT_AGENT_FIELD_SCHEMA_BYTES = 1024 * 1024 +_MAX_EVENT_AGENT_FIELD_SCHEMAS_TOTAL_BYTES = 16 * 1024 * 1024 _MAX_EVENT_TRACEBACK_LENGTH = 262_144 _MAX_EVENT_TIMESTAMP_MAGNITUDE = 10**12 @@ -2689,7 +2694,7 @@ def _validate_preparation_event(event: object) -> str: "node_types", "display_names", "display_name", - "agent_metadata_json", + "agent_field_schemas_json", }, ) node_ids = _required_field(event, "node_ids") @@ -2707,7 +2712,9 @@ def _validate_preparation_event(event: object) -> str: _graph_mapping(event, "graph") node_types = _string_mapping(event, "node_types") display_names = _string_mapping(event, "display_names") - agent_metadata_json = _string_mapping(event, "agent_metadata_json") + agent_field_schemas_json = _agent_field_schema_mapping( + event, "agent_field_schemas_json" + ) for node_id in node_ids: if node_id not in node_types: raise _CoordinatorProtocolError( @@ -2717,11 +2724,11 @@ def _validate_preparation_event(event: object) -> str: raise _CoordinatorProtocolError( f"field 'display_names' is missing node {_bounded_ascii(node_id)}" ) - unknown_agent_nodes = set(agent_metadata_json).difference(node_ids) + unknown_agent_nodes = set(agent_field_schemas_json).difference(node_ids) if unknown_agent_nodes: unknown = min(unknown_agent_nodes) raise _CoordinatorProtocolError( - f"field 'agent_metadata_json' references unknown node " + f"field 'agent_field_schemas_json' references unknown node " f"{_bounded_ascii(unknown)}" ) display_name = event.get("display_name") @@ -2886,7 +2893,12 @@ def _timestamp_field(event: dict[str, Any], field: str) -> float | int: raise _CoordinatorProtocolError(f"field {field!r} must be a bounded finite number") -def _string_mapping(event: dict[str, Any], field: str) -> Mapping[str, str]: +def _string_mapping( + event: dict[str, Any], + field: str, + *, + maximum_value_length: int | None = _MAX_EVENT_FIELD_LENGTH, +) -> Mapping[str, str]: value = _required_field(event, field) if ( type(value) is not dict @@ -2895,11 +2907,60 @@ def _string_mapping(event: dict[str, Any], field: str) -> Mapping[str, str]: type(key) is not str or type(item) is not str or len(key) > _MAX_EVENT_FIELD_LENGTH - or len(item) > _MAX_EVENT_FIELD_LENGTH + or (maximum_value_length is not None and len(item) > maximum_value_length) for key, item in value.items() ) ): - raise _CoordinatorProtocolError(f"field {field!r} must map strings to strings") + raise _CoordinatorProtocolError(f"field {field!r} must map bounded strings to strings") + return value + + +def _agent_field_schema_mapping(event: dict[str, Any], field: str) -> Mapping[str, str]: + value = _string_mapping(event, field, maximum_value_length=None) + total_bytes = 0 + for schema_json in value.values(): + try: + encoded_size = len(schema_json.encode("utf-8")) + schema = json.loads(schema_json) + except (UnicodeEncodeError, json.JSONDecodeError) as exc: + raise _CoordinatorProtocolError( + f"field {field!r} values must be UTF-8 JSON objects" + ) from exc + if encoded_size > _MAX_EVENT_AGENT_FIELD_SCHEMA_BYTES: + raise _CoordinatorProtocolError( + f"field {field!r} values must not exceed " + f"{_MAX_EVENT_AGENT_FIELD_SCHEMA_BYTES} UTF-8 bytes" + ) + total_bytes += encoded_size + if type(schema) is not dict or set(schema) != {"inputs", "outputs"}: + raise _CoordinatorProtocolError( + f"field {field!r} values must contain only input and output schemas" + ) + for schemas in schema.values(): + if type(schemas) is not list or len(schemas) > _MAX_EVENT_NODES: + raise _CoordinatorProtocolError( + f"field {field!r} inputs and outputs must be bounded lists" + ) + if any( + type(item) is not dict + or set(item) != {"name", "type", "description"} + or type(item["name"]) is not str + or not item["name"] + or len(item["name"]) > _MAX_EVENT_FIELD_LENGTH + or type(item["type"]) is not str + or len(item["type"]) > _MAX_EVENT_FIELD_LENGTH + or type(item["description"]) is not str + or len(item["description"]) > _MAX_EVENT_MESSAGE_LENGTH + for item in schemas + ): + raise _CoordinatorProtocolError( + f"field {field!r} contains an invalid invocation field schema" + ) + if total_bytes > _MAX_EVENT_AGENT_FIELD_SCHEMAS_TOTAL_BYTES: + raise _CoordinatorProtocolError( + f"field {field!r} must not exceed " + f"{_MAX_EVENT_AGENT_FIELD_SCHEMAS_TOTAL_BYTES} total UTF-8 bytes" + ) return value diff --git a/src/runtime/operator/proto/operator.proto b/src/runtime/operator/proto/operator.proto index f79c193..dee20ee 100644 --- a/src/runtime/operator/proto/operator.proto +++ b/src/runtime/operator/proto/operator.proto @@ -114,7 +114,7 @@ message WorkflowTopologyMsg { map graph = 2; map node_types = 3; map display_names = 4; - map agent_metadata_json = 5; + map agent_field_schemas_json = 5; } message FlowInfoMsg { diff --git a/src/runtime/operator/proto/operator_pb2.py b/src/runtime/operator/proto/operator_pb2.py index d2cff4b..f815967 100644 --- a/src/runtime/operator/proto/operator_pb2.py +++ b/src/runtime/operator/proto/operator_pb2.py @@ -24,7 +24,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eoperator.proto\x12\x12\x61valanche.operator\"\x07\n\x05\x45mpty\"\xb2\x01\n\x0fStartRunRequest\x12\x11\n\tflow_name\x18\x01 \x01(\t\x12\x12\n\ninput_json\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_json\x18\x03 \x01(\t\x12\x37\n\x0binput_files\x18\x04 \x03(\x0b\x32\".avalanche.operator.FileAttachment\x12\x0e\n\x06run_id\x18\x06 \x01(\t\x12\x19\n\x11workflow_selector\x18\x07 \x01(\t\"i\n\x0e\x46ileAttachment\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x04 \x01(\t\x12\x0e\n\x06sha256\x18\x05 \x01(\t\"\"\n\x10StartRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\"\n\x10\x43\x61ncelRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"[\n\x17ListRunSummariesRequest\x12\x19\n\x11workflow_selector\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x12\n\npage_token\x18\x03 \x01(\t\"]\n\x15GetRunSnapshotRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x1c\n\x14operator_instance_id\x18\x02 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x03 \x01(\x04\"P\n\x0fListLogsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"]\n\x16ListAgentEventsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x1c\n\x14\x61\x66ter_event_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"c\n\x10ReadTraceRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x1c\n\x14operator_instance_id\x18\x04 \x01(\t\"\'\n\x11ReadDetailRequest\x12\x12\n\nbody_token\x18\x01 \x01(\t\"T\n\x1cStreamOperatorUpdatesRequest\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\"\x1d\n\tNodeEdges\x12\x10\n\x08\x63hildren\x18\x01 \x03(\t\"\xd3\x04\n\x13WorkflowTopologyMsg\x12\x10\n\x08node_ids\x18\x01 \x03(\t\x12\x41\n\x05graph\x18\x02 \x03(\x0b\x32\x32.avalanche.operator.WorkflowTopologyMsg.GraphEntry\x12J\n\nnode_types\x18\x03 \x03(\x0b\x32\x36.avalanche.operator.WorkflowTopologyMsg.NodeTypesEntry\x12P\n\rdisplay_names\x18\x04 \x03(\x0b\x32\x39.avalanche.operator.WorkflowTopologyMsg.DisplayNamesEntry\x12[\n\x13\x61gent_metadata_json\x18\x05 \x03(\x0b\x32>.avalanche.operator.WorkflowTopologyMsg.AgentMetadataJsonEntry\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcd\x06\n\x0b\x46lowInfoMsg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x10\n\x08node_ids\x18\x03 \x03(\t\x12\x39\n\x05graph\x18\x04 \x03(\x0b\x32*.avalanche.operator.FlowInfoMsg.GraphEntry\x12\x42\n\nnode_types\x18\x05 \x03(\x0b\x32..avalanche.operator.FlowInfoMsg.NodeTypesEntry\x12H\n\rdisplay_names\x18\x06 \x03(\x0b\x32\x31.avalanche.operator.FlowInfoMsg.DisplayNamesEntry\x12\x0c\n\x04\x63ron\x18\x07 \x01(\t\x12\x13\n\x0bnext_run_at\x18\x08 \x01(\x01\x12\x13\n\x0blast_run_at\x18\t \x01(\x01\x12\x13\n\x0bworkflow_id\x18\n \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x12\x12\n\nroot_alias\x18\x0c \x01(\t\x12\x15\n\rrelative_file\x18\r \x01(\t\x12\x16\n\x0e\x62uilder_symbol\x18\x0e \x01(\t\x12\x16\n\x0e\x61gent_node_ids\x18\x0f \x03(\t\x12S\n\x13\x61gent_metadata_json\x18\x10 \x03(\x0b\x32\x36.avalanche.operator.FlowInfoMsg.AgentMetadataJsonEntry\x12\x14\n\x0cwebhook_path\x18\x11 \x01(\t\x12\x13\n\x0bwebhook_url\x18\x12 \x01(\t\x12\x16\n\x0ewebhook_active\x18\x13 \x01(\x08\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x16\x44iscoveryDiagnosticMsg\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\"A\n\rScanTargetMsg\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12\x13\n\x0btarget_path\x18\x02 \x01(\t\x12\x0c\n\x04kind\x18\x03 \x01(\t\"\x8a\x02\n\x12\x43\x61talogSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x32\n\tworkflows\x18\x04 \x03(\x0b\x32\x1f.avalanche.operator.FlowInfoMsg\x12\x37\n\x0cscan_targets\x18\x05 \x03(\x0b\x32!.avalanche.operator.ScanTargetMsg\x12?\n\x0b\x64iagnostics\x18\x06 \x03(\x0b\x32*.avalanche.operator.DiscoveryDiagnosticMsg\"\x92\x01\n\x14ResultFileAttachment\x12\x15\n\rattachment_id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x17\n\nmedia_type\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06sha256\x18\x05 \x01(\tB\x07\n\x05_nameB\r\n\x0b_media_type\"[\n\x0cRunResultMsg\x12\x12\n\nvalue_json\x18\x01 \x01(\t\x12\x37\n\x05\x66iles\x18\x02 \x03(\x0b\x32(.avalanche.operator.ResultFileAttachment\"\xde\x01\n\rRunSummaryMsg\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x11\n\tflow_name\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x14\n\x0ctriggered_by\x18\x06 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12\x1d\n\x15workflow_display_name\x18\x08 \x01(\t\x12\x18\n\x10\x63reated_sequence\x18\t \x01(\x04\x12\x10\n\x08revision\x18\n \x01(\x04\"\xda\x01\n\x0eTraceHeaderMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x16\n\tsub_model\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\niterations\x18\x04 \x01(\x04\x12\x16\n\x0emax_iterations\x18\x05 \x01(\x04\x12\x13\n\x0b\x64uration_ms\x18\x06 \x01(\x04\x12\x12\n\nusage_json\x18\x07 \x01(\t\x12\x1b\n\x0etelemetry_json\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\x0c\n\n_sub_modelB\x11\n\x0f_telemetry_json\"\xd7\x01\n\x12TraceDescriptorMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\x04\x12\x11\n\tavailable\x18\x03 \x01(\x08\x12\x10\n\x08\x63omplete\x18\x04 \x01(\x08\x12\x13\n\x0b\x65vent_count\x18\x05 \x01(\x04\x12\x12\n\nsize_bytes\x18\x06 \x01(\x04\x12\x1d\n\x15latest_event_sequence\x18\x07 \x01(\x04\x12\x32\n\x06header\x18\x08 \x01(\x0b\x32\".avalanche.operator.TraceHeaderMsg\"\xfa\x01\n\x0fNodeSnapshotMsg\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tnode_type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12\x12\n\nstarted_at\x18\x05 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x06 \x01(\x01\x12\x35\n\x05trace\x18\x07 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\x12\x10\n\x08revision\x18\x08 \x01(\x04\x12\x18\n\x10\x65vent_page_token\x18\t \x01(\t\x12\x12\n\x05\x65rror\x18\n \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x9e\x02\n\x0eRunSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x32\n\x07summary\x18\x03 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x04 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x1b\n\x13latest_log_sequence\x18\x05 \x01(\x04\x12\x16\n\x0elog_page_token\x18\x06 \x01(\t\x12\x39\n\x08topology\x18\x07 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"\x90\x01\n\x0eRunSummaryPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12/\n\x04runs\x18\x03 \x03(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x85\x01\n\x16LogRecordDescriptorMsg\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x02 \x01(\x01\x12\r\n\x05level\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12\x12\n\nsize_bytes\x18\x05 \x01(\x04\x12\x12\n\nbody_token\x18\x06 \x01(\t\"\x92\x01\n\x07LogPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x38\n\x04logs\x18\x03 \x03(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x8e\x02\n\x17\x41gentEventDescriptorMsg\x12\x16\n\x0e\x65vent_sequence\x18\x01 \x01(\x04\x12\x12\n\nsize_bytes\x18\x02 \x01(\x04\x12\x12\n\nbody_token\x18\x03 \x01(\t\x12\x15\n\rinvocation_id\x18\x04 \x01(\t\x12\x12\n\nevent_kind\x18\x05 \x01(\t\x12\x16\n\titeration\x18\x06 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64uration_ms\x18\x07 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x65rror\x18\x08 \x01(\x08\x12\x12\n\ntool_count\x18\t \x01(\r\x12\x15\n\rpredict_count\x18\n \x01(\rB\x0c\n\n_iterationB\x0e\n\x0c_duration_ms\"\xbd\x01\n\x0e\x41gentEventPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12;\n\x06\x65vents\x18\x05 \x03(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\"N\n\nTraceChunk\x12\x10\n\x08revision\x18\x01 \x01(\x04\x12\x13\n\x0b\x63hunk_index\x18\x02 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x04 \x01(\x08\"=\n\x0b\x44\x65tailChunk\x12\x13\n\x0b\x63hunk_index\x18\x01 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x03 \x01(\x08\"\xaf\x01\n\nRunCreated\x12\x32\n\x07summary\x18\x01 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x02 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x39\n\x08topology\x18\x03 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"j\n\x10RunStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nstarted_at\x18\x03 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x04 \x01(\x01\x12\x10\n\x08revision\x18\x05 \x01(\x04\"\x9a\x01\n\x11NodeStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x10\n\x08revision\x18\x06 \x01(\x04\x12\x12\n\x05\x65rror\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"V\n\x0bLogAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x37\n\x03log\x18\x02 \x01(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\"q\n\x12\x41gentEventAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12:\n\x05\x65vent\x18\x03 \x01(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\"h\n\x0eTraceFinalized\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x35\n\x05trace\x18\x03 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\"J\n\x0f\x43\x61talogReplaced\x12\x37\n\x07\x63\x61talog\x18\x01 \x01(\x0b\x32&.avalanche.operator.CatalogSnapshotMsg\"\xee\x03\n\x0eOperatorUpdate\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x35\n\x0brun_created\x18\x02 \x01(\x0b\x32\x1e.avalanche.operator.RunCreatedH\x00\x12\x42\n\x12run_status_changed\x18\x03 \x01(\x0b\x32$.avalanche.operator.RunStatusChangedH\x00\x12\x44\n\x13node_status_changed\x18\x04 \x01(\x0b\x32%.avalanche.operator.NodeStatusChangedH\x00\x12\x37\n\x0clog_appended\x18\x05 \x01(\x0b\x32\x1f.avalanche.operator.LogAppendedH\x00\x12\x46\n\x14\x61gent_event_appended\x18\x06 \x01(\x0b\x32&.avalanche.operator.AgentEventAppendedH\x00\x12=\n\x0ftrace_finalized\x18\x07 \x01(\x0b\x32\".avalanche.operator.TraceFinalizedH\x00\x12?\n\x10\x63\x61talog_replaced\x18\x08 \x01(\x0b\x32#.avalanche.operator.CatalogReplacedH\x00\x42\x08\n\x06\x63hange\"?\n\rResetRequired\x12\x15\n\rhistory_floor\x18\x01 \x01(\x04\x12\x17\n\x0flatest_sequence\x18\x02 \x01(\x04\"\xb4\x01\n\x16OperatorUpdateEnvelope\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x34\n\x06update\x18\x02 \x01(\x0b\x32\".avalanche.operator.OperatorUpdateH\x00\x12;\n\x0ereset_required\x18\x03 \x01(\x0b\x32!.avalanche.operator.ResetRequiredH\x00\x42\t\n\x07payload2\xf9\x07\n\x0fOperatorService\x12O\n\nGetCatalog\x12\x19.avalanche.operator.Empty\x1a&.avalanche.operator.CatalogSnapshotMsg\x12U\n\x08StartRun\x12#.avalanche.operator.StartRunRequest\x1a$.avalanche.operator.StartRunResponse\x12L\n\tCancelRun\x12$.avalanche.operator.CancelRunRequest\x1a\x19.avalanche.operator.Empty\x12S\n\x0cGetRunResult\x12!.avalanche.operator.GetRunRequest\x1a .avalanche.operator.RunResultMsg\x12\x63\n\x10ListRunSummaries\x12+.avalanche.operator.ListRunSummariesRequest\x1a\".avalanche.operator.RunSummaryPage\x12_\n\x0eGetRunSnapshot\x12).avalanche.operator.GetRunSnapshotRequest\x1a\".avalanche.operator.RunSnapshotMsg\x12L\n\x08ListLogs\x12#.avalanche.operator.ListLogsRequest\x1a\x1b.avalanche.operator.LogPage\x12\x61\n\x0fListAgentEvents\x12*.avalanche.operator.ListAgentEventsRequest\x1a\".avalanche.operator.AgentEventPage\x12S\n\tReadTrace\x12$.avalanche.operator.ReadTraceRequest\x1a\x1e.avalanche.operator.TraceChunk0\x01\x12V\n\nReadDetail\x12%.avalanche.operator.ReadDetailRequest\x1a\x1f.avalanche.operator.DetailChunk0\x01\x12w\n\x15StreamOperatorUpdates\x12\x30.avalanche.operator.StreamOperatorUpdatesRequest\x1a*.avalanche.operator.OperatorUpdateEnvelope0\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eoperator.proto\x12\x12\x61valanche.operator\"\x07\n\x05\x45mpty\"\xb2\x01\n\x0fStartRunRequest\x12\x11\n\tflow_name\x18\x01 \x01(\t\x12\x12\n\ninput_json\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_json\x18\x03 \x01(\t\x12\x37\n\x0binput_files\x18\x04 \x03(\x0b\x32\".avalanche.operator.FileAttachment\x12\x0e\n\x06run_id\x18\x06 \x01(\t\x12\x19\n\x11workflow_selector\x18\x07 \x01(\t\"i\n\x0e\x46ileAttachment\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x04 \x01(\t\x12\x0e\n\x06sha256\x18\x05 \x01(\t\"\"\n\x10StartRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\"\n\x10\x43\x61ncelRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"[\n\x17ListRunSummariesRequest\x12\x19\n\x11workflow_selector\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x12\n\npage_token\x18\x03 \x01(\t\"]\n\x15GetRunSnapshotRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x1c\n\x14operator_instance_id\x18\x02 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x03 \x01(\x04\"P\n\x0fListLogsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"]\n\x16ListAgentEventsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x1c\n\x14\x61\x66ter_event_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"c\n\x10ReadTraceRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x1c\n\x14operator_instance_id\x18\x04 \x01(\t\"\'\n\x11ReadDetailRequest\x12\x12\n\nbody_token\x18\x01 \x01(\t\"T\n\x1cStreamOperatorUpdatesRequest\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\"\x1d\n\tNodeEdges\x12\x10\n\x08\x63hildren\x18\x01 \x03(\t\"\xe0\x04\n\x13WorkflowTopologyMsg\x12\x10\n\x08node_ids\x18\x01 \x03(\t\x12\x41\n\x05graph\x18\x02 \x03(\x0b\x32\x32.avalanche.operator.WorkflowTopologyMsg.GraphEntry\x12J\n\nnode_types\x18\x03 \x03(\x0b\x32\x36.avalanche.operator.WorkflowTopologyMsg.NodeTypesEntry\x12P\n\rdisplay_names\x18\x04 \x03(\x0b\x32\x39.avalanche.operator.WorkflowTopologyMsg.DisplayNamesEntry\x12\x64\n\x18\x61gent_field_schemas_json\x18\x05 \x03(\x0b\x32\x42.avalanche.operator.WorkflowTopologyMsg.AgentFieldSchemasJsonEntry\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a<\n\x1a\x41gentFieldSchemasJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcd\x06\n\x0b\x46lowInfoMsg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x10\n\x08node_ids\x18\x03 \x03(\t\x12\x39\n\x05graph\x18\x04 \x03(\x0b\x32*.avalanche.operator.FlowInfoMsg.GraphEntry\x12\x42\n\nnode_types\x18\x05 \x03(\x0b\x32..avalanche.operator.FlowInfoMsg.NodeTypesEntry\x12H\n\rdisplay_names\x18\x06 \x03(\x0b\x32\x31.avalanche.operator.FlowInfoMsg.DisplayNamesEntry\x12\x0c\n\x04\x63ron\x18\x07 \x01(\t\x12\x13\n\x0bnext_run_at\x18\x08 \x01(\x01\x12\x13\n\x0blast_run_at\x18\t \x01(\x01\x12\x13\n\x0bworkflow_id\x18\n \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x12\x12\n\nroot_alias\x18\x0c \x01(\t\x12\x15\n\rrelative_file\x18\r \x01(\t\x12\x16\n\x0e\x62uilder_symbol\x18\x0e \x01(\t\x12\x16\n\x0e\x61gent_node_ids\x18\x0f \x03(\t\x12S\n\x13\x61gent_metadata_json\x18\x10 \x03(\x0b\x32\x36.avalanche.operator.FlowInfoMsg.AgentMetadataJsonEntry\x12\x14\n\x0cwebhook_path\x18\x11 \x01(\t\x12\x13\n\x0bwebhook_url\x18\x12 \x01(\t\x12\x16\n\x0ewebhook_active\x18\x13 \x01(\x08\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x16\x44iscoveryDiagnosticMsg\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\"A\n\rScanTargetMsg\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12\x13\n\x0btarget_path\x18\x02 \x01(\t\x12\x0c\n\x04kind\x18\x03 \x01(\t\"\x8a\x02\n\x12\x43\x61talogSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x32\n\tworkflows\x18\x04 \x03(\x0b\x32\x1f.avalanche.operator.FlowInfoMsg\x12\x37\n\x0cscan_targets\x18\x05 \x03(\x0b\x32!.avalanche.operator.ScanTargetMsg\x12?\n\x0b\x64iagnostics\x18\x06 \x03(\x0b\x32*.avalanche.operator.DiscoveryDiagnosticMsg\"\x92\x01\n\x14ResultFileAttachment\x12\x15\n\rattachment_id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x17\n\nmedia_type\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06sha256\x18\x05 \x01(\tB\x07\n\x05_nameB\r\n\x0b_media_type\"[\n\x0cRunResultMsg\x12\x12\n\nvalue_json\x18\x01 \x01(\t\x12\x37\n\x05\x66iles\x18\x02 \x03(\x0b\x32(.avalanche.operator.ResultFileAttachment\"\xde\x01\n\rRunSummaryMsg\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x11\n\tflow_name\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x14\n\x0ctriggered_by\x18\x06 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12\x1d\n\x15workflow_display_name\x18\x08 \x01(\t\x12\x18\n\x10\x63reated_sequence\x18\t \x01(\x04\x12\x10\n\x08revision\x18\n \x01(\x04\"\xda\x01\n\x0eTraceHeaderMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x16\n\tsub_model\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\niterations\x18\x04 \x01(\x04\x12\x16\n\x0emax_iterations\x18\x05 \x01(\x04\x12\x13\n\x0b\x64uration_ms\x18\x06 \x01(\x04\x12\x12\n\nusage_json\x18\x07 \x01(\t\x12\x1b\n\x0etelemetry_json\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\x0c\n\n_sub_modelB\x11\n\x0f_telemetry_json\"\xd7\x01\n\x12TraceDescriptorMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\x04\x12\x11\n\tavailable\x18\x03 \x01(\x08\x12\x10\n\x08\x63omplete\x18\x04 \x01(\x08\x12\x13\n\x0b\x65vent_count\x18\x05 \x01(\x04\x12\x12\n\nsize_bytes\x18\x06 \x01(\x04\x12\x1d\n\x15latest_event_sequence\x18\x07 \x01(\x04\x12\x32\n\x06header\x18\x08 \x01(\x0b\x32\".avalanche.operator.TraceHeaderMsg\"\xfa\x01\n\x0fNodeSnapshotMsg\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tnode_type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12\x12\n\nstarted_at\x18\x05 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x06 \x01(\x01\x12\x35\n\x05trace\x18\x07 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\x12\x10\n\x08revision\x18\x08 \x01(\x04\x12\x18\n\x10\x65vent_page_token\x18\t \x01(\t\x12\x12\n\x05\x65rror\x18\n \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x9e\x02\n\x0eRunSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x32\n\x07summary\x18\x03 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x04 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x1b\n\x13latest_log_sequence\x18\x05 \x01(\x04\x12\x16\n\x0elog_page_token\x18\x06 \x01(\t\x12\x39\n\x08topology\x18\x07 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"\x90\x01\n\x0eRunSummaryPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12/\n\x04runs\x18\x03 \x03(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x85\x01\n\x16LogRecordDescriptorMsg\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x02 \x01(\x01\x12\r\n\x05level\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12\x12\n\nsize_bytes\x18\x05 \x01(\x04\x12\x12\n\nbody_token\x18\x06 \x01(\t\"\x92\x01\n\x07LogPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x38\n\x04logs\x18\x03 \x03(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x8e\x02\n\x17\x41gentEventDescriptorMsg\x12\x16\n\x0e\x65vent_sequence\x18\x01 \x01(\x04\x12\x12\n\nsize_bytes\x18\x02 \x01(\x04\x12\x12\n\nbody_token\x18\x03 \x01(\t\x12\x15\n\rinvocation_id\x18\x04 \x01(\t\x12\x12\n\nevent_kind\x18\x05 \x01(\t\x12\x16\n\titeration\x18\x06 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64uration_ms\x18\x07 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x65rror\x18\x08 \x01(\x08\x12\x12\n\ntool_count\x18\t \x01(\r\x12\x15\n\rpredict_count\x18\n \x01(\rB\x0c\n\n_iterationB\x0e\n\x0c_duration_ms\"\xbd\x01\n\x0e\x41gentEventPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12;\n\x06\x65vents\x18\x05 \x03(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\"N\n\nTraceChunk\x12\x10\n\x08revision\x18\x01 \x01(\x04\x12\x13\n\x0b\x63hunk_index\x18\x02 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x04 \x01(\x08\"=\n\x0b\x44\x65tailChunk\x12\x13\n\x0b\x63hunk_index\x18\x01 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x03 \x01(\x08\"\xaf\x01\n\nRunCreated\x12\x32\n\x07summary\x18\x01 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x02 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x39\n\x08topology\x18\x03 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"j\n\x10RunStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nstarted_at\x18\x03 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x04 \x01(\x01\x12\x10\n\x08revision\x18\x05 \x01(\x04\"\x9a\x01\n\x11NodeStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x10\n\x08revision\x18\x06 \x01(\x04\x12\x12\n\x05\x65rror\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"V\n\x0bLogAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x37\n\x03log\x18\x02 \x01(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\"q\n\x12\x41gentEventAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12:\n\x05\x65vent\x18\x03 \x01(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\"h\n\x0eTraceFinalized\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x35\n\x05trace\x18\x03 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\"J\n\x0f\x43\x61talogReplaced\x12\x37\n\x07\x63\x61talog\x18\x01 \x01(\x0b\x32&.avalanche.operator.CatalogSnapshotMsg\"\xee\x03\n\x0eOperatorUpdate\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x35\n\x0brun_created\x18\x02 \x01(\x0b\x32\x1e.avalanche.operator.RunCreatedH\x00\x12\x42\n\x12run_status_changed\x18\x03 \x01(\x0b\x32$.avalanche.operator.RunStatusChangedH\x00\x12\x44\n\x13node_status_changed\x18\x04 \x01(\x0b\x32%.avalanche.operator.NodeStatusChangedH\x00\x12\x37\n\x0clog_appended\x18\x05 \x01(\x0b\x32\x1f.avalanche.operator.LogAppendedH\x00\x12\x46\n\x14\x61gent_event_appended\x18\x06 \x01(\x0b\x32&.avalanche.operator.AgentEventAppendedH\x00\x12=\n\x0ftrace_finalized\x18\x07 \x01(\x0b\x32\".avalanche.operator.TraceFinalizedH\x00\x12?\n\x10\x63\x61talog_replaced\x18\x08 \x01(\x0b\x32#.avalanche.operator.CatalogReplacedH\x00\x42\x08\n\x06\x63hange\"?\n\rResetRequired\x12\x15\n\rhistory_floor\x18\x01 \x01(\x04\x12\x17\n\x0flatest_sequence\x18\x02 \x01(\x04\"\xb4\x01\n\x16OperatorUpdateEnvelope\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x34\n\x06update\x18\x02 \x01(\x0b\x32\".avalanche.operator.OperatorUpdateH\x00\x12;\n\x0ereset_required\x18\x03 \x01(\x0b\x32!.avalanche.operator.ResetRequiredH\x00\x42\t\n\x07payload2\xf9\x07\n\x0fOperatorService\x12O\n\nGetCatalog\x12\x19.avalanche.operator.Empty\x1a&.avalanche.operator.CatalogSnapshotMsg\x12U\n\x08StartRun\x12#.avalanche.operator.StartRunRequest\x1a$.avalanche.operator.StartRunResponse\x12L\n\tCancelRun\x12$.avalanche.operator.CancelRunRequest\x1a\x19.avalanche.operator.Empty\x12S\n\x0cGetRunResult\x12!.avalanche.operator.GetRunRequest\x1a .avalanche.operator.RunResultMsg\x12\x63\n\x10ListRunSummaries\x12+.avalanche.operator.ListRunSummariesRequest\x1a\".avalanche.operator.RunSummaryPage\x12_\n\x0eGetRunSnapshot\x12).avalanche.operator.GetRunSnapshotRequest\x1a\".avalanche.operator.RunSnapshotMsg\x12L\n\x08ListLogs\x12#.avalanche.operator.ListLogsRequest\x1a\x1b.avalanche.operator.LogPage\x12\x61\n\x0fListAgentEvents\x12*.avalanche.operator.ListAgentEventsRequest\x1a\".avalanche.operator.AgentEventPage\x12S\n\tReadTrace\x12$.avalanche.operator.ReadTraceRequest\x1a\x1e.avalanche.operator.TraceChunk0\x01\x12V\n\nReadDetail\x12%.avalanche.operator.ReadDetailRequest\x1a\x1f.avalanche.operator.DetailChunk0\x01\x12w\n\x15StreamOperatorUpdates\x12\x30.avalanche.operator.StreamOperatorUpdatesRequest\x1a*.avalanche.operator.OperatorUpdateEnvelope0\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -37,8 +37,8 @@ _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_options = b'8\001' _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._loaded_options = None _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_options = b'8\001' - _globals['_WORKFLOWTOPOLOGYMSG_AGENTMETADATAJSONENTRY']._loaded_options = None - _globals['_WORKFLOWTOPOLOGYMSG_AGENTMETADATAJSONENTRY']._serialized_options = b'8\001' + _globals['_WORKFLOWTOPOLOGYMSG_AGENTFIELDSCHEMASJSONENTRY']._loaded_options = None + _globals['_WORKFLOWTOPOLOGYMSG_AGENTFIELDSCHEMASJSONENTRY']._serialized_options = b'8\001' _globals['_FLOWINFOMSG_GRAPHENTRY']._loaded_options = None _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_options = b'8\001' _globals['_FLOWINFOMSG_NODETYPESENTRY']._loaded_options = None @@ -76,79 +76,79 @@ _globals['_NODEEDGES']._serialized_start=1033 _globals['_NODEEDGES']._serialized_end=1062 _globals['_WORKFLOWTOPOLOGYMSG']._serialized_start=1065 - _globals['_WORKFLOWTOPOLOGYMSG']._serialized_end=1660 - _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_start=1424 - _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_end=1499 - _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_start=1501 - _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_end=1549 - _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_start=1551 - _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_end=1602 - _globals['_WORKFLOWTOPOLOGYMSG_AGENTMETADATAJSONENTRY']._serialized_start=1604 - _globals['_WORKFLOWTOPOLOGYMSG_AGENTMETADATAJSONENTRY']._serialized_end=1660 - _globals['_FLOWINFOMSG']._serialized_start=1663 - _globals['_FLOWINFOMSG']._serialized_end=2508 - _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_start=1424 - _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_end=1499 - _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_start=1501 - _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_end=1549 - _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_start=1551 - _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_end=1602 - _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_start=1604 - _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_end=1660 - _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_start=2510 - _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_end=2579 - _globals['_SCANTARGETMSG']._serialized_start=2581 - _globals['_SCANTARGETMSG']._serialized_end=2646 - _globals['_CATALOGSNAPSHOTMSG']._serialized_start=2649 - _globals['_CATALOGSNAPSHOTMSG']._serialized_end=2915 - _globals['_RESULTFILEATTACHMENT']._serialized_start=2918 - _globals['_RESULTFILEATTACHMENT']._serialized_end=3064 - _globals['_RUNRESULTMSG']._serialized_start=3066 - _globals['_RUNRESULTMSG']._serialized_end=3157 - _globals['_RUNSUMMARYMSG']._serialized_start=3160 - _globals['_RUNSUMMARYMSG']._serialized_end=3382 - _globals['_TRACEHEADERMSG']._serialized_start=3385 - _globals['_TRACEHEADERMSG']._serialized_end=3603 - _globals['_TRACEDESCRIPTORMSG']._serialized_start=3606 - _globals['_TRACEDESCRIPTORMSG']._serialized_end=3821 - _globals['_NODESNAPSHOTMSG']._serialized_start=3824 - _globals['_NODESNAPSHOTMSG']._serialized_end=4074 - _globals['_RUNSNAPSHOTMSG']._serialized_start=4077 - _globals['_RUNSNAPSHOTMSG']._serialized_end=4363 - _globals['_RUNSUMMARYPAGE']._serialized_start=4366 - _globals['_RUNSUMMARYPAGE']._serialized_end=4510 - _globals['_LOGRECORDDESCRIPTORMSG']._serialized_start=4513 - _globals['_LOGRECORDDESCRIPTORMSG']._serialized_end=4646 - _globals['_LOGPAGE']._serialized_start=4649 - _globals['_LOGPAGE']._serialized_end=4795 - _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_start=4798 - _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_end=5068 - _globals['_AGENTEVENTPAGE']._serialized_start=5071 - _globals['_AGENTEVENTPAGE']._serialized_end=5260 - _globals['_TRACECHUNK']._serialized_start=5262 - _globals['_TRACECHUNK']._serialized_end=5340 - _globals['_DETAILCHUNK']._serialized_start=5342 - _globals['_DETAILCHUNK']._serialized_end=5403 - _globals['_RUNCREATED']._serialized_start=5406 - _globals['_RUNCREATED']._serialized_end=5581 - _globals['_RUNSTATUSCHANGED']._serialized_start=5583 - _globals['_RUNSTATUSCHANGED']._serialized_end=5689 - _globals['_NODESTATUSCHANGED']._serialized_start=5692 - _globals['_NODESTATUSCHANGED']._serialized_end=5846 - _globals['_LOGAPPENDED']._serialized_start=5848 - _globals['_LOGAPPENDED']._serialized_end=5934 - _globals['_AGENTEVENTAPPENDED']._serialized_start=5936 - _globals['_AGENTEVENTAPPENDED']._serialized_end=6049 - _globals['_TRACEFINALIZED']._serialized_start=6051 - _globals['_TRACEFINALIZED']._serialized_end=6155 - _globals['_CATALOGREPLACED']._serialized_start=6157 - _globals['_CATALOGREPLACED']._serialized_end=6231 - _globals['_OPERATORUPDATE']._serialized_start=6234 - _globals['_OPERATORUPDATE']._serialized_end=6728 - _globals['_RESETREQUIRED']._serialized_start=6730 - _globals['_RESETREQUIRED']._serialized_end=6793 - _globals['_OPERATORUPDATEENVELOPE']._serialized_start=6796 - _globals['_OPERATORUPDATEENVELOPE']._serialized_end=6976 - _globals['_OPERATORSERVICE']._serialized_start=6979 - _globals['_OPERATORSERVICE']._serialized_end=7996 + _globals['_WORKFLOWTOPOLOGYMSG']._serialized_end=1673 + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_start=1433 + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_end=1508 + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_start=1510 + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_end=1558 + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_start=1560 + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_end=1611 + _globals['_WORKFLOWTOPOLOGYMSG_AGENTFIELDSCHEMASJSONENTRY']._serialized_start=1613 + _globals['_WORKFLOWTOPOLOGYMSG_AGENTFIELDSCHEMASJSONENTRY']._serialized_end=1673 + _globals['_FLOWINFOMSG']._serialized_start=1676 + _globals['_FLOWINFOMSG']._serialized_end=2521 + _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_start=1433 + _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_end=1508 + _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_start=1510 + _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_end=1558 + _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_start=1560 + _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_end=1611 + _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_start=2465 + _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_end=2521 + _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_start=2523 + _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_end=2592 + _globals['_SCANTARGETMSG']._serialized_start=2594 + _globals['_SCANTARGETMSG']._serialized_end=2659 + _globals['_CATALOGSNAPSHOTMSG']._serialized_start=2662 + _globals['_CATALOGSNAPSHOTMSG']._serialized_end=2928 + _globals['_RESULTFILEATTACHMENT']._serialized_start=2931 + _globals['_RESULTFILEATTACHMENT']._serialized_end=3077 + _globals['_RUNRESULTMSG']._serialized_start=3079 + _globals['_RUNRESULTMSG']._serialized_end=3170 + _globals['_RUNSUMMARYMSG']._serialized_start=3173 + _globals['_RUNSUMMARYMSG']._serialized_end=3395 + _globals['_TRACEHEADERMSG']._serialized_start=3398 + _globals['_TRACEHEADERMSG']._serialized_end=3616 + _globals['_TRACEDESCRIPTORMSG']._serialized_start=3619 + _globals['_TRACEDESCRIPTORMSG']._serialized_end=3834 + _globals['_NODESNAPSHOTMSG']._serialized_start=3837 + _globals['_NODESNAPSHOTMSG']._serialized_end=4087 + _globals['_RUNSNAPSHOTMSG']._serialized_start=4090 + _globals['_RUNSNAPSHOTMSG']._serialized_end=4376 + _globals['_RUNSUMMARYPAGE']._serialized_start=4379 + _globals['_RUNSUMMARYPAGE']._serialized_end=4523 + _globals['_LOGRECORDDESCRIPTORMSG']._serialized_start=4526 + _globals['_LOGRECORDDESCRIPTORMSG']._serialized_end=4659 + _globals['_LOGPAGE']._serialized_start=4662 + _globals['_LOGPAGE']._serialized_end=4808 + _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_start=4811 + _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_end=5081 + _globals['_AGENTEVENTPAGE']._serialized_start=5084 + _globals['_AGENTEVENTPAGE']._serialized_end=5273 + _globals['_TRACECHUNK']._serialized_start=5275 + _globals['_TRACECHUNK']._serialized_end=5353 + _globals['_DETAILCHUNK']._serialized_start=5355 + _globals['_DETAILCHUNK']._serialized_end=5416 + _globals['_RUNCREATED']._serialized_start=5419 + _globals['_RUNCREATED']._serialized_end=5594 + _globals['_RUNSTATUSCHANGED']._serialized_start=5596 + _globals['_RUNSTATUSCHANGED']._serialized_end=5702 + _globals['_NODESTATUSCHANGED']._serialized_start=5705 + _globals['_NODESTATUSCHANGED']._serialized_end=5859 + _globals['_LOGAPPENDED']._serialized_start=5861 + _globals['_LOGAPPENDED']._serialized_end=5947 + _globals['_AGENTEVENTAPPENDED']._serialized_start=5949 + _globals['_AGENTEVENTAPPENDED']._serialized_end=6062 + _globals['_TRACEFINALIZED']._serialized_start=6064 + _globals['_TRACEFINALIZED']._serialized_end=6168 + _globals['_CATALOGREPLACED']._serialized_start=6170 + _globals['_CATALOGREPLACED']._serialized_end=6244 + _globals['_OPERATORUPDATE']._serialized_start=6247 + _globals['_OPERATORUPDATE']._serialized_end=6741 + _globals['_RESETREQUIRED']._serialized_start=6743 + _globals['_RESETREQUIRED']._serialized_end=6806 + _globals['_OPERATORUPDATEENVELOPE']._serialized_start=6809 + _globals['_OPERATORUPDATEENVELOPE']._serialized_end=6989 + _globals['_OPERATORSERVICE']._serialized_start=6992 + _globals['_OPERATORSERVICE']._serialized_end=8009 # @@protoc_insertion_point(module_scope) diff --git a/src/runtime/operator/proto/operator_pb2.pyi b/src/runtime/operator/proto/operator_pb2.pyi index d6800a1..0bb3291 100644 --- a/src/runtime/operator/proto/operator_pb2.pyi +++ b/src/runtime/operator/proto/operator_pb2.pyi @@ -131,7 +131,7 @@ class NodeEdges(_message.Message): def __init__(self, children: _Optional[_Iterable[str]] = ...) -> None: ... class WorkflowTopologyMsg(_message.Message): - __slots__ = ("node_ids", "graph", "node_types", "display_names", "agent_metadata_json") + __slots__ = ("node_ids", "graph", "node_types", "display_names", "agent_field_schemas_json") class GraphEntry(_message.Message): __slots__ = ("key", "value") KEY_FIELD_NUMBER: _ClassVar[int] @@ -153,7 +153,7 @@ class WorkflowTopologyMsg(_message.Message): key: str value: str def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - class AgentMetadataJsonEntry(_message.Message): + class AgentFieldSchemasJsonEntry(_message.Message): __slots__ = ("key", "value") KEY_FIELD_NUMBER: _ClassVar[int] VALUE_FIELD_NUMBER: _ClassVar[int] @@ -164,13 +164,13 @@ class WorkflowTopologyMsg(_message.Message): GRAPH_FIELD_NUMBER: _ClassVar[int] NODE_TYPES_FIELD_NUMBER: _ClassVar[int] DISPLAY_NAMES_FIELD_NUMBER: _ClassVar[int] - AGENT_METADATA_JSON_FIELD_NUMBER: _ClassVar[int] + AGENT_FIELD_SCHEMAS_JSON_FIELD_NUMBER: _ClassVar[int] node_ids: _containers.RepeatedScalarFieldContainer[str] graph: _containers.MessageMap[str, NodeEdges] node_types: _containers.ScalarMap[str, str] display_names: _containers.ScalarMap[str, str] - agent_metadata_json: _containers.ScalarMap[str, str] - def __init__(self, node_ids: _Optional[_Iterable[str]] = ..., graph: _Optional[_Mapping[str, NodeEdges]] = ..., node_types: _Optional[_Mapping[str, str]] = ..., display_names: _Optional[_Mapping[str, str]] = ..., agent_metadata_json: _Optional[_Mapping[str, str]] = ...) -> None: ... + agent_field_schemas_json: _containers.ScalarMap[str, str] + def __init__(self, node_ids: _Optional[_Iterable[str]] = ..., graph: _Optional[_Mapping[str, NodeEdges]] = ..., node_types: _Optional[_Mapping[str, str]] = ..., display_names: _Optional[_Mapping[str, str]] = ..., agent_field_schemas_json: _Optional[_Mapping[str, str]] = ...) -> None: ... class FlowInfoMsg(_message.Message): __slots__ = ("name", "file_path", "node_ids", "graph", "node_types", "display_names", "cron", "next_run_at", "last_run_at", "workflow_id", "display_name", "root_alias", "relative_file", "builder_symbol", "agent_node_ids", "agent_metadata_json", "webhook_path", "webhook_url", "webhook_active") diff --git a/src/runtime/operator/registry.py b/src/runtime/operator/registry.py index a6392e5..a89aed2 100644 --- a/src/runtime/operator/registry.py +++ b/src/runtime/operator/registry.py @@ -36,7 +36,7 @@ def __init__(self, selector: str, candidate_ids: tuple[str, ...]) -> None: def agent_metadata_for_workflow(workflow: Workflow, node_ids: list[str]) -> dict[str, str]: - """Serialize stable agent declaration metadata for catalog and run projections.""" + """Serialize stable agent declaration metadata for current-catalog projections.""" metadata_by_node: dict[str, str] = {} for node_id in node_ids: spec = getattr(workflow.nodes[node_id].node.fn, "__agent_step__", None) @@ -57,6 +57,24 @@ def agent_metadata_for_workflow(workflow: Workflow, node_ids: list[str]) -> dict return metadata_by_node +def agent_field_schemas_for_workflow( + workflow: Workflow, node_ids: list[str] +) -> dict[str, str]: + """Serialize only agent invocation field schemas for immutable run topology.""" + schemas_by_node: dict[str, str] = {} + for node_id in node_ids: + spec = getattr(workflow.nodes[node_id].node.fn, "__agent_step__", None) + if spec is None: + continue + schemas_by_node[node_id] = json.dumps( + spec.field_schema_metadata(), + ensure_ascii=False, + separators=(",", ":"), + sort_keys=True, + ) + return schemas_by_node + + def workflow_to_info( workflow: Workflow, file_path: str, @@ -205,8 +223,14 @@ def _scan_roots( candidate_failed = any(item.kind != "skipped" for item in diagnostics_tuple) if candidate_failed: with self._lock: + current = self._view + if ( + current.scan_targets == scan_targets + and current.diagnostics == diagnostics_tuple + ): + return current self._view = replace( - self._view, + current, scan_targets=scan_targets, diagnostics=diagnostics_tuple, ) @@ -222,8 +246,16 @@ def _scan_roots( for name, candidate_ids in short_names.items() } with self._lock: + current = self._view + if ( + current.by_id == by_id + and current.short_names == frozen_short_names + and current.scan_targets == scan_targets + and current.diagnostics == diagnostics_tuple + ): + return current view = CatalogView( - revision=self._view.revision + 1, + revision=current.revision + 1, by_id=MappingProxyType(by_id), short_names=MappingProxyType(dict(sorted(frozen_short_names.items()))), scan_targets=scan_targets, diff --git a/src/runtime/operator/run_worker.py b/src/runtime/operator/run_worker.py index 7c4123a..24da7a0 100644 --- a/src/runtime/operator/run_worker.py +++ b/src/runtime/operator/run_worker.py @@ -24,7 +24,7 @@ from ..executor import Executor, LocalExecutor, RayExecutor from .hooks import RunHooks from .models import display_name_from_id -from .registry import agent_metadata_for_workflow +from .registry import agent_field_schemas_for_workflow from .result_store import ( ResultPublicationCancelledError, detach_transferred_bundle_descriptor, @@ -335,7 +335,7 @@ def _workflow_metadata(workflow: Workflow) -> dict[str, Any]: node_id: workflow.nodes[node_id].node.node_type.value for node_id in node_ids }, "display_names": {node_id: display_name_from_id(node_id) for node_id in node_ids}, - "agent_metadata_json": agent_metadata_for_workflow(workflow, node_ids), + "agent_field_schemas_json": agent_field_schemas_for_workflow(workflow, node_ids), } diff --git a/src/runtime/operator/web_assets/assets/index-BuH1gsyY.js b/src/runtime/operator/web_assets/assets/index-BuH1gsyY.js new file mode 100644 index 0000000..b047b51 --- /dev/null +++ b/src/runtime/operator/web_assets/assets/index-BuH1gsyY.js @@ -0,0 +1,9 @@ +import{r as Dm,a as _m,b as Z,j as p,H as Kd,P as Zd,M as Mm,i as wm,B as Rm,C as Um,c as Bm}from"./graph-CoDTrhFP.js";import{S as qm,M as W,r as F,U as R,W as S,s as Oe,G as Cm}from"./protobuf-BR9ifi4u.js";import{E as Da,a as Lm,j as Hm,k as Vm}from"./editor-Dh6wG2B-.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const c of f)if(c.type==="childList")for(const v of c.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function i(f){const c={};return f.integrity&&(c.integrity=f.integrity),f.referrerPolicy&&(c.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?c.credentials="include":f.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(f){if(f.ep)return;f.ep=!0;const c=i(f);fetch(f.href,c)}})();var Tc={exports:{}},_a={},kc={exports:{}},zc={};var Jd;function Ym(){return Jd||(Jd=1,(function(m){function a(_,q){var K=_.length;_.push(q);t:for(;0>>1,Y=_[w];if(0>>1;wf(ot,K))Btf(xe,ot)?(_[w]=xe,_[Bt]=K,w=Bt):(_[w]=ot,_[ct]=K,w=ct);else if(Btf(xe,K))_[w]=xe,_[Bt]=K,w=Bt;else break t}}return q}function f(_,q){var K=_.sortIndex-q.sortIndex;return K!==0?K:_.id-q.id}if(m.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;m.unstable_now=function(){return c.now()}}else{var v=Date,d=v.now();m.unstable_now=function(){return v.now()-d}}var g=[],y=[],z=1,x=null,B=3,U=!1,H=!1,J=!1,et=!1,L=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,tt=typeof setImmediate<"u"?setImmediate:null;function ht(_){for(var q=i(y);q!==null;){if(q.callback===null)o(y);else if(q.startTime<=_)o(y),q.sortIndex=q.expirationTime,a(g,q);else break;q=i(y)}}function at(_){if(J=!1,ht(_),!H)if(i(g)!==null)H=!0,Ut||(Ut=!0,Lt());else{var q=i(y);q!==null&&he(at,q.startTime-_)}}var Ut=!1,$=-1,Tt=5,re=-1;function Qt(){return et?!0:!(m.unstable_now()-re_&&Qt());){var w=x.callback;if(typeof w=="function"){x.callback=null,B=x.priorityLevel;var Y=w(x.expirationTime<=_);if(_=m.unstable_now(),typeof Y=="function"){x.callback=Y,ht(_),q=!0;break e}x===i(g)&&o(g),ht(_)}else o(g);x=i(g)}if(x!==null)q=!0;else{var bt=i(y);bt!==null&&he(at,bt.startTime-_),q=!1}}break t}finally{x=null,B=K,U=!1}q=void 0}}finally{q?Lt():Ut=!1}}}var Lt;if(typeof tt=="function")Lt=function(){tt(Ot)};else if(typeof MessageChannel<"u"){var Zt=new MessageChannel,de=Zt.port2;Zt.port1.onmessage=Ot,Lt=function(){de.postMessage(null)}}else Lt=function(){L(Ot,0)};function he(_,q){$=L(function(){_(m.unstable_now())},q)}m.unstable_IdlePriority=5,m.unstable_ImmediatePriority=1,m.unstable_LowPriority=4,m.unstable_NormalPriority=3,m.unstable_Profiling=null,m.unstable_UserBlockingPriority=2,m.unstable_cancelCallback=function(_){_.callback=null},m.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Tt=0<_?Math.floor(1e3/_):5},m.unstable_getCurrentPriorityLevel=function(){return B},m.unstable_next=function(_){switch(B){case 1:case 2:case 3:var q=3;break;default:q=B}var K=B;B=q;try{return _()}finally{B=K}},m.unstable_requestPaint=function(){et=!0},m.unstable_runWithPriority=function(_,q){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var K=B;B=_;try{return q()}finally{B=K}},m.unstable_scheduleCallback=function(_,q,K){var w=m.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0w?(_.sortIndex=K,a(y,_),i(g)===null&&_===i(y)&&(J?(Q($),$=-1):J=!0,he(at,K-w))):(_.sortIndex=Y,a(g,_),H||U||(H=!0,Ut||(Ut=!0,Lt()))),_},m.unstable_shouldYield=Qt,m.unstable_wrapCallback=function(_){var q=B;return function(){var K=B;B=q;try{return _.apply(this,arguments)}finally{B=K}}}})(zc)),zc}var $d;function Gm(){return $d||($d=1,kc.exports=Ym()),kc.exports}var Wd;function Xm(){if(Wd)return _a;Wd=1;var m=Gm(),a=Dm(),i=_m();function o(t){var e="https://react.dev/errors/"+t;if(1Y||(t.current=w[Y],w[Y]=null,Y--)}function ot(t,e){Y++,w[Y]=t.current,t.current=e}var Bt=bt(null),xe=bt(null),Ie=bt(null),wa=bt(null);function Ra(t,e){switch(ot(Ie,e),ot(xe,t),ot(Bt,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?md(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=md(e),t=yd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ct(Bt),ot(Bt,t)}function Zn(){ct(Bt),ct(xe),ct(Ie)}function nu(t){t.memoizedState!==null&&ot(wa,t);var e=Bt.current,n=yd(e,t.type);e!==n&&(ot(xe,t),ot(Bt,n))}function Ua(t){xe.current===t&&(ct(Bt),ct(xe)),wa.current===t&&(ct(wa),Aa._currentValue=K)}var lu,Gc;function On(t){if(lu===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);lu=e&&e[1]||"",Gc=-1)":-1u||b[l]!==N[u]){var j=` +`+b[l].replace(" at new "," at ");return t.displayName&&j.includes("")&&(j=j.replace("",t.displayName)),j}while(1<=l&&0<=u);break}}}finally{au=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?On(n):""}function sh(t,e){switch(t.tag){case 26:case 27:case 5:return On(t.type);case 16:return On("Lazy");case 13:return t.child!==e&&e!==null?On("Suspense Fallback"):On("Suspense");case 19:return On("SuspenseList");case 0:case 15:return iu(t.type,!1);case 11:return iu(t.type.render,!1);case 1:return iu(t.type,!0);case 31:return On("Activity");default:return""}}function Xc(t){try{var e="",n=null;do e+=sh(t,n),n=t,t=t.return;while(t);return e}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}var uu=Object.prototype.hasOwnProperty,su=m.unstable_scheduleCallback,cu=m.unstable_cancelCallback,ch=m.unstable_shouldYield,oh=m.unstable_requestPaint,ee=m.unstable_now,fh=m.unstable_getCurrentPriorityLevel,Qc=m.unstable_ImmediatePriority,Kc=m.unstable_UserBlockingPriority,Ba=m.unstable_NormalPriority,rh=m.unstable_LowPriority,Zc=m.unstable_IdlePriority,dh=m.log,hh=m.unstable_setDisableYieldValue,Cl=null,ne=null;function Pe(t){if(typeof dh=="function"&&hh(t),ne&&typeof ne.setStrictMode=="function")try{ne.setStrictMode(Cl,t)}catch{}}var le=Math.clz32?Math.clz32:yh,gh=Math.log,mh=Math.LN2;function yh(t){return t>>>=0,t===0?32:31-(gh(t)/mh|0)|0}var qa=256,Ca=262144,La=4194304;function xn(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ha(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var u=0,s=t.suspendedLanes,r=t.pingedLanes;t=t.warmLanes;var h=l&134217727;return h!==0?(l=h&~s,l!==0?u=xn(l):(r&=h,r!==0?u=xn(r):n||(n=h&~t,n!==0&&(u=xn(n))))):(h=l&~s,h!==0?u=xn(h):r!==0?u=xn(r):n||(n=l&~t,n!==0&&(u=xn(n)))),u===0?0:e!==0&&e!==u&&(e&s)===0&&(s=u&-u,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:u}function Ll(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function ph(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jc(){var t=La;return La<<=1,(La&62914560)===0&&(La=4194304),t}function ou(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Hl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function vh(t,e,n,l,u,s){var r=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,b=t.expirationTimes,N=t.hiddenUpdates;for(n=r&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Eh=/[\n"\\]/g;function me(t){return t.replace(Eh,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function mu(t,e,n,l,u,s,r,h){t.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.type=r:t.removeAttribute("type"),e!=null?r==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ge(e)):t.value!==""+ge(e)&&(t.value=""+ge(e)):r!=="submit"&&r!=="reset"||t.removeAttribute("value"),e!=null?yu(t,r,ge(e)):n!=null?yu(t,r,ge(n)):l!=null&&t.removeAttribute("value"),u==null&&s!=null&&(t.defaultChecked=!!s),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+ge(h):t.removeAttribute("name")}function so(t,e,n,l,u,s,r,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){gu(t);return}n=n!=null?""+ge(n):"",e=e!=null?""+ge(e):n,h||e===t.value||(t.value=e),t.defaultValue=e}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=h?t.checked:!!l,t.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.name=r),gu(t)}function yu(t,e,n){e==="number"&&Ga(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Pn(t,e,n,l){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tu=!1;if(Ue)try{var Xl={};Object.defineProperty(Xl,"passive",{get:function(){Tu=!0}}),window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{Tu=!1}var en=null,ku=null,Qa=null;function mo(){if(Qa)return Qa;var t,e=ku,n=e.length,l,u="value"in en?en.value:en.textContent,s=u.length;for(t=0;t=Zl),To=" ",ko=!1;function zo(t,e){switch(t){case"keyup":return Ih.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ll=!1;function tg(t,e){switch(t){case"compositionend":return Eo(e);case"keypress":return e.which!==32?null:(ko=!0,To);case"textInput":return t=e.data,t===To&&ko?null:t;default:return null}}function eg(t,e){if(ll)return t==="compositionend"||!Ou&&zo(t,e)?(t=mo(),Qa=ku=en=null,ll=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Mo(n)}}function Ro(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ro(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Uo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ga(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ga(t.document)}return e}function Du(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var og=Ue&&"documentMode"in document&&11>=document.documentMode,al=null,_u=null,Fl=null,Mu=!1;function Bo(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mu||al==null||al!==Ga(l)||(l=al,"selectionStart"in l&&Du(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Fl&&Wl(Fl,l)||(Fl=l,l=Ci(_u,"onSelect"),0>=r,u-=r,je=1<<32-le(e)+u|n<P?(ut=V,V=null):ut=V.sibling;var rt=A(k,V,E[P],D);if(rt===null){V===null&&(V=ut);break}t&&V&&rt.alternate===null&&e(k,V),T=s(rt,T,P),ft===null?G=rt:ft.sibling=rt,ft=rt,V=ut}if(P===E.length)return n(k,V),st&&qe(k,P),G;if(V===null){for(;PP?(ut=V,V=null):ut=V.sibling;var En=A(k,V,rt.value,D);if(En===null){V===null&&(V=ut);break}t&&V&&En.alternate===null&&e(k,V),T=s(En,T,P),ft===null?G=En:ft.sibling=En,ft=En,V=ut}if(rt.done)return n(k,V),st&&qe(k,P),G;if(V===null){for(;!rt.done;P++,rt=E.next())rt=M(k,rt.value,D),rt!==null&&(T=s(rt,T,P),ft===null?G=rt:ft.sibling=rt,ft=rt);return st&&qe(k,P),G}for(V=l(V);!rt.done;P++,rt=E.next())rt=O(V,k,P,rt.value,D),rt!==null&&(t&&rt.alternate!==null&&V.delete(rt.key===null?P:rt.key),T=s(rt,T,P),ft===null?G=rt:ft.sibling=rt,ft=rt);return t&&V.forEach(function(jm){return e(k,jm)}),st&&qe(k,P),G}function vt(k,T,E,D){if(typeof E=="object"&&E!==null&&E.type===J&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case U:t:{for(var G=E.key;T!==null;){if(T.key===G){if(G=E.type,G===J){if(T.tag===7){n(k,T.sibling),D=u(T,E.props.children),D.return=k,k=D;break t}}else if(T.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Tt&&Ln(G)===T.type){n(k,T.sibling),D=u(T,E.props),la(D,E),D.return=k,k=D;break t}n(k,T);break}else e(k,T);T=T.sibling}E.type===J?(D=Rn(E.props.children,k.mode,D,E.key),D.return=k,k=D):(D=ei(E.type,E.key,E.props,null,k.mode,D),la(D,E),D.return=k,k=D)}return r(k);case H:t:{for(G=E.key;T!==null;){if(T.key===G)if(T.tag===4&&T.stateNode.containerInfo===E.containerInfo&&T.stateNode.implementation===E.implementation){n(k,T.sibling),D=u(T,E.children||[]),D.return=k,k=D;break t}else{n(k,T);break}else e(k,T);T=T.sibling}D=Lu(E,k.mode,D),D.return=k,k=D}return r(k);case Tt:return E=Ln(E),vt(k,T,E,D)}if(he(E))return C(k,T,E,D);if(Lt(E)){if(G=Lt(E),typeof G!="function")throw Error(o(150));return E=G.call(E),X(k,T,E,D)}if(typeof E.then=="function")return vt(k,T,ci(E),D);if(E.$$typeof===tt)return vt(k,T,ai(k,E),D);oi(k,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,T!==null&&T.tag===6?(n(k,T.sibling),D=u(T,E),D.return=k,k=D):(n(k,T),D=Cu(E,k.mode,D),D.return=k,k=D),r(k)):n(k,T)}return function(k,T,E,D){try{na=0;var G=vt(k,T,E,D);return ml=null,G}catch(V){if(V===gl||V===ui)throw V;var ft=ie(29,V,null,k.mode);return ft.lanes=D,ft.return=k,ft}}}var Vn=uf(!0),sf=uf(!1),sn=!1;function Fu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Iu(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function on(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(dt&2)!==0){var u=l.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),l.pending=e,e=ti(t),Go(t,null,n),e}return Pa(t,l,e,n),ti(t)}function aa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Wc(t,n)}}function Pu(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var u=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?u=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?u=s=e:s=s.next=e}else u=s=e;n={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var ts=!1;function ia(){if(ts){var t=hl;if(t!==null)throw t}}function ua(t,e,n,l){ts=!1;var u=t.updateQueue;sn=!1;var s=u.firstBaseUpdate,r=u.lastBaseUpdate,h=u.shared.pending;if(h!==null){u.shared.pending=null;var b=h,N=b.next;b.next=null,r===null?s=N:r.next=N,r=b;var j=t.alternate;j!==null&&(j=j.updateQueue,h=j.lastBaseUpdate,h!==r&&(h===null?j.firstBaseUpdate=N:h.next=N,j.lastBaseUpdate=b))}if(s!==null){var M=u.baseState;r=0,j=N=b=null,h=s;do{var A=h.lane&-536870913,O=A!==h.lane;if(O?(it&A)===A:(l&A)===A){A!==0&&A===dl&&(ts=!0),j!==null&&(j=j.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var C=t,X=h;A=e;var vt=n;switch(X.tag){case 1:if(C=X.payload,typeof C=="function"){M=C.call(vt,M,A);break t}M=C;break t;case 3:C.flags=C.flags&-65537|128;case 0:if(C=X.payload,A=typeof C=="function"?C.call(vt,M,A):C,A==null)break t;M=x({},M,A);break t;case 2:sn=!0}}A=h.callback,A!==null&&(t.flags|=64,O&&(t.flags|=8192),O=u.callbacks,O===null?u.callbacks=[A]:O.push(A))}else O={lane:A,tag:h.tag,payload:h.payload,callback:h.callback,next:null},j===null?(N=j=O,b=M):j=j.next=O,r|=A;if(h=h.next,h===null){if(h=u.shared.pending,h===null)break;O=h,h=O.next,O.next=null,u.lastBaseUpdate=O,u.shared.pending=null}}while(!0);j===null&&(b=M),u.baseState=b,u.firstBaseUpdate=N,u.lastBaseUpdate=j,s===null&&(u.shared.lanes=0),gn|=r,t.lanes=r,t.memoizedState=M}}function cf(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function of(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ts?s:8;var r=_.T,h={};_.T=h,bs(t,!1,e,n);try{var b=u(),N=_.S;if(N!==null&&N(h,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var j=vg(b,l);oa(t,e,j,fe(t))}else oa(t,e,l,fe(t))}catch(M){oa(t,e,{then:function(){},status:"rejected",reason:M},fe())}finally{q.p=s,r!==null&&h.types!==null&&(r.types=h.types),_.T=r}}function Eg(){}function ps(t,e,n,l){if(t.tag!==5)throw Error(o(476));var u=Vf(t).queue;Hf(t,u,e,K,n===null?Eg:function(){return Yf(t),n(l)})}function Vf(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:K},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Yf(t){var e=Vf(t);e.next===null&&(e=t.alternate.memoizedState),oa(t,e.next.queue,{},fe())}function vs(){return Yt(Aa)}function Gf(){return jt().memoizedState}function Xf(){return jt().memoizedState}function Ng(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=fe();t=cn(n);var l=on(e,t,n);l!==null&&(te(l,e,n),aa(l,e,n)),e={cache:Zu()},t.payload=e;return}e=e.return}}function Ag(t,e,n){var l=fe();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bi(t)?Kf(e,n):(n=Bu(t,e,n,l),n!==null&&(te(n,t,l),Zf(n,e,l)))}function Qf(t,e,n){var l=fe();oa(t,e,n,l)}function oa(t,e,n,l){var u={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bi(t))Kf(e,u);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var r=e.lastRenderedState,h=s(r,n);if(u.hasEagerState=!0,u.eagerState=h,ae(h,r))return Pa(t,e,u,0),St===null&&Ia(),!1}catch{}if(n=Bu(t,e,u,l),n!==null)return te(n,t,l),Zf(n,e,l),!0}return!1}function bs(t,e,n,l){if(l={lane:2,revertLane:Fs(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},bi(t)){if(e)throw Error(o(479))}else e=Bu(t,n,l,2),e!==null&&te(e,t,2)}function bi(t){var e=t.alternate;return t===I||e!==null&&e===I}function Kf(t,e){pl=di=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Zf(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Wc(t,n)}}var fa={readContext:Yt,use:mi,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};fa.useEffectEvent=Nt;var Jf={readContext:Yt,use:mi,useCallback:function(t,e){return Kt().memoizedState=[t,e===void 0?null:e],t},useContext:Yt,useEffect:_f,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,pi(4194308,4,Uf.bind(null,e,t),n)},useLayoutEffect:function(t,e){return pi(4194308,4,t,e)},useInsertionEffect:function(t,e){pi(4,2,t,e)},useMemo:function(t,e){var n=Kt();e=e===void 0?null:e;var l=t();if(Yn){Pe(!0);try{t()}finally{Pe(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=Kt();if(n!==void 0){var u=n(e);if(Yn){Pe(!0);try{n(e)}finally{Pe(!1)}}}else u=e;return l.memoizedState=l.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},l.queue=t,t=t.dispatch=Ag.bind(null,I,t),[l.memoizedState,t]},useRef:function(t){var e=Kt();return t={current:t},e.memoizedState=t},useState:function(t){t=ds(t);var e=t.queue,n=Qf.bind(null,I,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(t,e){var n=Kt();return ys(n,t,e)},useTransition:function(){var t=ds(!1);return t=Hf.bind(null,I,t.queue,!0,!1),Kt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=I,u=Kt();if(st){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),St===null)throw Error(o(349));(it&127)!==0||mf(l,e,n)}u.memoizedState=n;var s={value:n,getSnapshot:e};return u.queue=s,_f(pf.bind(null,l,s,t),[t]),l.flags|=2048,bl(9,{destroy:void 0},yf.bind(null,l,s,n,e),null),n},useId:function(){var t=Kt(),e=St.identifierPrefix;if(st){var n=De,l=je;n=(l&~(1<<32-le(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=hi++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(u,{is:l.is}):r.createElement(u)}}s[Ht]=e,s[Jt]=l;t:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break t;for(;r.sibling===null;){if(r.return===null||r.return===e)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=s;t:switch(Xt(s,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&Ge(e)}}return zt(e),ws(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Ge(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(o(166));if(t=Ie.current,fl(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,u=Vt,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}t[Ht]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||hd(t.nodeValue,n)),t||an(e,!0)}else t=Li(t).createTextNode(l),t[Ht]=e,e.stateNode=t}return zt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=fl(e),n!==null){if(t===null){if(!l)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Ht]=e}else Un(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;zt(e),t=!1}else n=Gu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(se(e),e):(se(e),null);if((e.flags&128)!==0)throw Error(o(558))}return zt(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=fl(e),l!==null&&l.dehydrated!==null){if(t===null){if(!u)throw Error(o(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Ht]=e}else Un(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;zt(e),u=!1}else u=Gu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(se(e),e):(se(e),null)}return se(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Ei(e,e.updateQueue),zt(e),null);case 4:return Zn(),t===null&&ec(e.stateNode.containerInfo),zt(e),null;case 10:return Le(e.type),zt(e),null;case 19:if(ct(xt),l=e.memoizedState,l===null)return zt(e),null;if(u=(e.flags&128)!==0,s=l.rendering,s===null)if(u)da(l,!1);else{if(At!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=ri(t),s!==null){for(e.flags|=128,da(l,!1),t=s.updateQueue,e.updateQueue=t,Ei(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Xo(n,t),n=n.sibling;return ot(xt,xt.current&1|2),st&&qe(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&ee()>ji&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304)}else{if(!u)if(t=ri(s),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,Ei(e,t),da(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!st)return zt(e),null}else 2*ee()-l.renderingStartTime>ji&&n!==536870912&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304);l.isBackwards?(s.sibling=e.child,e.child=s):(t=l.last,t!==null?t.sibling=s:e.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ee(),t.sibling=null,n=xt.current,ot(xt,u?n&1|2:n&1),st&&qe(e,l.treeForkCount),t):(zt(e),null);case 22:case 23:return se(e),ns(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(zt(e),e.subtreeFlags&6&&(e.flags|=8192)):zt(e),n=e.updateQueue,n!==null&&Ei(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&ct(Cn),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Le(Dt),zt(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function _g(t,e){switch(Vu(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Le(Dt),Zn(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ua(e),null;case 31:if(e.memoizedState!==null){if(se(e),e.alternate===null)throw Error(o(340));Un()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(se(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));Un()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(xt),null;case 4:return Zn(),null;case 10:return Le(e.type),null;case 22:case 23:return se(e),ns(),t!==null&&ct(Cn),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Le(Dt),null;case 25:return null;default:return null}}function vr(t,e){switch(Vu(e),e.tag){case 3:Le(Dt),Zn();break;case 26:case 27:case 5:Ua(e);break;case 4:Zn();break;case 31:e.memoizedState!==null&&se(e);break;case 13:se(e);break;case 19:ct(xt);break;case 10:Le(e.type);break;case 22:case 23:se(e),ns(),t!==null&&ct(Cn);break;case 24:Le(Dt)}}function ha(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var u=l.next;n=u;do{if((n.tag&t)===t){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==u)}}catch(h){mt(e,e.return,h)}}function dn(t,e,n){try{var l=e.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var s=u.next;l=s;do{if((l.tag&t)===t){var r=l.inst,h=r.destroy;if(h!==void 0){r.destroy=void 0,u=e;var b=n,N=h;try{N()}catch(j){mt(u,b,j)}}}l=l.next}while(l!==s)}}catch(j){mt(e,e.return,j)}}function br(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{of(e,n)}catch(l){mt(t,t.return,l)}}}function Sr(t,e,n){n.props=Gn(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){mt(t,e,l)}}function ga(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(u){mt(t,e,u)}}function _e(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(u){mt(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){mt(t,e,u)}else n.current=null}function Tr(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(u){mt(t,t.return,u)}}function Rs(t,e,n){try{var l=t.stateNode;Pg(l,t.type,n,e),l[Jt]=e}catch(u){mt(t,t.return,u)}}function kr(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bn(t.type)||t.tag===4}function Us(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||kr(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Bs(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Re));else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Bs(t,e,n),t=t.sibling;t!==null;)Bs(t,e,n),t=t.sibling}function Ni(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ni(t,e,n),t=t.sibling;t!==null;)Ni(t,e,n),t=t.sibling}function zr(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);Xt(e,l,n),e[Ht]=t,e[Jt]=n}catch(s){mt(t,t.return,s)}}var Xe=!1,wt=!1,qs=!1,Er=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function Mg(t,e){if(t=t.containerInfo,ac=Ki,t=Uo(t),Du(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var u=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var r=0,h=-1,b=-1,N=0,j=0,M=t,A=null;e:for(;;){for(var O;M!==n||u!==0&&M.nodeType!==3||(h=r+u),M!==s||l!==0&&M.nodeType!==3||(b=r+l),M.nodeType===3&&(r+=M.nodeValue.length),(O=M.firstChild)!==null;)A=M,M=O;for(;;){if(M===t)break e;if(A===n&&++N===u&&(h=r),A===s&&++j===l&&(b=r),(O=M.nextSibling)!==null)break;M=A,A=M.parentNode}M=O}n=h===-1||b===-1?null:{start:h,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(ic={focusedElem:t,selectionRange:n},Ki=!1,Ct=e;Ct!==null;)if(e=Ct,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ct=t;else for(;Ct!==null;){switch(e=Ct,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),Xt(s,l,n),s[Ht]=t,qt(s),l=s;break t;case"link":var r=Dd("link","href",u).get(l+(n.href||""));if(r){for(var h=0;hvt&&(r=vt,vt=X,X=r);var k=wo(h,X),T=wo(h,vt);if(k&&T&&(O.rangeCount!==1||O.anchorNode!==k.node||O.anchorOffset!==k.offset||O.focusNode!==T.node||O.focusOffset!==T.offset)){var E=M.createRange();E.setStart(k.node,k.offset),O.removeAllRanges(),X>vt?(O.addRange(E),O.extend(T.node,T.offset)):(E.setEnd(T.node,T.offset),O.addRange(E))}}}}for(M=[],O=h;O=O.parentNode;)O.nodeType===1&&M.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;hn?32:n,_.T=null,n=Xs,Xs=null;var s=yn,r=$e;if(Rt=0,El=yn=null,$e=0,(dt&6)!==0)throw Error(o(331));var h=dt;if(dt|=4,Ur(s.current),Mr(s,s.current,r,n),dt=h,Sa(0,!1),ne&&typeof ne.onPostCommitFiberRoot=="function")try{ne.onPostCommitFiberRoot(Cl,s)}catch{}return!0}finally{q.p=u,_.T=l,Pr(t,e)}}function ed(t,e,n){e=pe(n,e),e=zs(t.stateNode,e,2),t=on(t,e,2),t!==null&&(Hl(t,2),Me(t))}function mt(t,e,n){if(t.tag===3)ed(t,t,n);else for(;e!==null;){if(e.tag===3){ed(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(mn===null||!mn.has(l))){t=pe(n,t),n=nr(2),l=on(e,n,2),l!==null&&(lr(n,l,e,t),Hl(l,2),Me(l));break}}e=e.return}}function Js(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new Ug;var u=new Set;l.set(e,u)}else u=l.get(e),u===void 0&&(u=new Set,l.set(e,u));u.has(n)||(Hs=!0,u.add(n),t=Hg.bind(null,t,e,n),e.then(t,t))}function Hg(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,St===t&&(it&n)===n&&(At===4||At===3&&(it&62914560)===it&&300>ee()-xi?(dt&2)===0&&Nl(t,0):Vs|=n,zl===it&&(zl=0)),Me(t)}function nd(t,e){e===0&&(e=Jc()),t=wn(t,e),t!==null&&(Hl(t,e),Me(t))}function Vg(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),nd(t,n)}function Yg(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(e),nd(t,n)}function Gg(t,e){return su(t,e)}var Ui=null,Ol=null,$s=!1,Bi=!1,Ws=!1,vn=0;function Me(t){t!==Ol&&t.next===null&&(Ol===null?Ui=Ol=t:Ol=Ol.next=t),Bi=!0,$s||($s=!0,Qg())}function Sa(t,e){if(!Ws&&Bi){Ws=!0;do for(var n=!1,l=Ui;l!==null;){if(t!==0){var u=l.pendingLanes;if(u===0)var s=0;else{var r=l.suspendedLanes,h=l.pingedLanes;s=(1<<31-le(42|t)+1)-1,s&=u&~(r&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,ud(l,s))}else s=it,s=Ha(l,l===St?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Ll(l,s)||(n=!0,ud(l,s));l=l.next}while(n);Ws=!1}}function Xg(){ld()}function ld(){Bi=$s=!1;var t=0;vn!==0&&em()&&(t=vn);for(var e=ee(),n=null,l=Ui;l!==null;){var u=l.next,s=ad(l,e);s===0?(l.next=null,n===null?Ui=u:n.next=u,u===null&&(Ol=n)):(n=l,(t!==0||(s&3)!==0)&&(Bi=!0)),l=u}Rt!==0&&Rt!==5||Sa(t),vn!==0&&(vn=0)}function ad(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,u=t.expirationTimes,s=t.pendingLanes&-62914561;0h)break;var j=b.transferSize,M=b.initiatorType;j&&gd(M)&&(b=b.responseEnd,r+=j*(b"u"?null:document;function Ad(t,e,n){var l=xl;if(l&&typeof e=="string"&&e){var u=me(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Nd.has(u)||(Nd.add(u),t={rel:t,crossOrigin:n,href:e},l.querySelector(u)===null&&(e=l.createElement("link"),Xt(e,"link",t),qt(e),l.head.appendChild(e)))}}function fm(t){We.D(t),Ad("dns-prefetch",t,null)}function rm(t,e){We.C(t,e),Ad("preconnect",t,e)}function dm(t,e,n){We.L(t,e,n);var l=xl;if(l&&t&&e){var u='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+me(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+me(n.imageSizes)+'"]')):u+='[href="'+me(t)+'"]';var s=u;switch(e){case"style":s=jl(t);break;case"script":s=Dl(t)}ze.has(s)||(t=x({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),ze.set(s,t),l.querySelector(u)!==null||e==="style"&&l.querySelector(Ea(s))||e==="script"&&l.querySelector(Na(s))||(e=l.createElement("link"),Xt(e,"link",t),qt(e),l.head.appendChild(e)))}}function hm(t,e){We.m(t,e);var n=xl;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+me(l)+'"][href="'+me(t)+'"]',s=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Dl(t)}if(!ze.has(s)&&(t=x({rel:"modulepreload",href:t},e),ze.set(s,t),n.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Na(s)))return}l=n.createElement("link"),Xt(l,"link",t),qt(l),n.head.appendChild(l)}}}function gm(t,e,n){We.S(t,e,n);var l=xl;if(l&&t){var u=Fn(l).hoistableStyles,s=jl(t);e=e||"default";var r=u.get(s);if(!r){var h={loading:0,preload:null};if(r=l.querySelector(Ea(s)))h.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":e},n),(n=ze.get(s))&&dc(t,n);var b=r=l.createElement("link");qt(b),Xt(b,"link",t),b._p=new Promise(function(N,j){b.onload=N,b.onerror=j}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Vi(r,e,l)}r={type:"stylesheet",instance:r,count:1,state:h},u.set(s,r)}}}function mm(t,e){We.X(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=x({src:t,async:!0},e),(e=ze.get(u))&&hc(t,e),s=n.createElement("script"),qt(s),Xt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function ym(t,e){We.M(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=x({src:t,async:!0,type:"module"},e),(e=ze.get(u))&&hc(t,e),s=n.createElement("script"),qt(s),Xt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function Od(t,e,n,l){var u=(u=Ie.current)?Hi(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=jl(n.href),n=Fn(u).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=jl(n.href);var s=Fn(u).hoistableStyles,r=s.get(t);if(r||(u=u.ownerDocument||u,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,r),(s=u.querySelector(Ea(t)))&&!s._p&&(r.instance=s,r.state.loading=5),ze.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ze.set(t,n),s||pm(u,t,n,r.state))),e&&l===null)throw Error(o(528,""));return r}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Dl(n),n=Fn(u).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function jl(t){return'href="'+me(t)+'"'}function Ea(t){return'link[rel="stylesheet"]['+t+"]"}function xd(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function pm(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),Xt(e,"link",n),qt(e),t.head.appendChild(e))}function Dl(t){return'[src="'+me(t)+'"]'}function Na(t){return"script[async]"+t}function jd(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+me(n.href)+'"]');if(l)return e.instance=l,qt(l),l;var u=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),qt(l),Xt(l,"style",u),Vi(l,n.precedence,t),e.instance=l;case"stylesheet":u=jl(n.href);var s=t.querySelector(Ea(u));if(s)return e.state.loading|=4,e.instance=s,qt(s),s;l=xd(n),(u=ze.get(u))&&dc(l,u),s=(t.ownerDocument||t).createElement("link"),qt(s);var r=s;return r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Xt(s,"link",l),e.state.loading|=4,Vi(s,n.precedence,t),e.instance=s;case"script":return s=Dl(n.src),(u=t.querySelector(Na(s)))?(e.instance=u,qt(u),u):(l=n,(u=ze.get(s))&&(l=x({},n),hc(l,u)),t=t.ownerDocument||t,u=t.createElement("script"),qt(u),Xt(u,"link",l),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,Vi(l,n.precedence,t));return e.instance}function Vi(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,s=u,r=0;r title"):null)}function vm(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Md(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function bm(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=jl(l.href),s=e.querySelector(Ea(u));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Gi.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,qt(s);return}s=e.ownerDocument||e,l=xd(l),(u=ze.get(u))&&dc(l,u),s=s.createElement("link"),qt(s);var r=s;r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Xt(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Gi.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var gc=0;function Sm(t,e){return t.stylesheets&&t.count===0&&Qi(t,t.stylesheets),0gc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Gi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qi(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Xi=null;function Qi(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Xi=new Map,e.forEach(Tm,t),Xi=null,Gi.call(t))}function Tm(t,e){if(!(e.state.loading&4)){var n=Xi.get(t);if(n)var l=n.get(null);else{n=new Map,Xi.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(m)}catch(a){console.error(a)}}return m(),Tc.exports=Xm(),Tc.exports}var Km=Qm();class Zm extends W{constructor(){super("avalanche.operator.Empty",[])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posEc},{no:6,name:"run_id",kind:"scalar",T:9},{no:7,name:"workflow_selector",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.flowName="",i.inputJson="",i.contextJson="",i.inputFiles=[],i.runId="",i.workflowSelector="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:3,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"agent_field_schemas_json",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.agentFieldSchemasJson={},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:5,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"cron",kind:"scalar",T:9},{no:8,name:"next_run_at",kind:"scalar",T:1},{no:9,name:"last_run_at",kind:"scalar",T:1},{no:10,name:"workflow_id",kind:"scalar",T:9},{no:11,name:"display_name",kind:"scalar",T:9},{no:12,name:"root_alias",kind:"scalar",T:9},{no:13,name:"relative_file",kind:"scalar",T:9},{no:14,name:"builder_symbol",kind:"scalar",T:9},{no:15,name:"agent_node_ids",kind:"scalar",repeat:2,T:9},{no:16,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:17,name:"webhook_path",kind:"scalar",T:9},{no:18,name:"webhook_url",kind:"scalar",T:9},{no:19,name:"webhook_active",kind:"scalar",T:8}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.name="",i.filePath="",i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.cron="",i.nextRunAt=0,i.lastRunAt=0,i.workflowId="",i.displayName="",i.rootAlias="",i.relativeFile="",i.builderSymbol="",i.agentNodeIds=[],i.agentMetadataJson={},i.webhookPath="",i.webhookUrl="",i.webhookActive=!1,a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNc},{no:5,name:"scan_targets",kind:"message",repeat:2,T:()=>Oc},{no:6,name:"diagnostics",kind:"message",repeat:2,T:()=>Ac}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.revision="0",i.workflows=[],i.scanTargets=[],i.diagnostics=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posxc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.valueJson="",i.files=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posjc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.status="",i.revision="0",i.available=!1,i.complete=!1,i.eventCount="0",i.sizeBytes="0",i.latestEventSequence="0",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posRl},{no:8,name:"revision",kind:"scalar",T:4},{no:9,name:"event_page_token",kind:"scalar",T:9},{no:10,name:"error",kind:"scalar",opt:!0,T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeId="",i.name="",i.nodeType="",i.status="",i.startedAt=0,i.endedAt=0,i.revision="0",i.eventPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:5,name:"latest_log_sequence",kind:"scalar",T:4},{no:6,name:"log_page_token",kind:"scalar",T:9},{no:7,name:"topology",kind:"message",T:()=>wl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.nodes=[],i.latestLogSequence="0",i.logPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.logs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql},{no:6,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runId="",i.nodeId="",i.events=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:2,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:3,name:"topology",kind:"message",T:()=>wl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodes=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posRl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posPi}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posDc},{no:3,name:"run_status_changed",kind:"message",oneof:"change",T:()=>_c},{no:4,name:"node_status_changed",kind:"message",oneof:"change",T:()=>Mc},{no:5,name:"log_appended",kind:"message",oneof:"change",T:()=>wc},{no:6,name:"agent_event_appended",kind:"message",oneof:"change",T:()=>Rc},{no:7,name:"trace_finalized",kind:"message",oneof:"change",T:()=>Uc},{no:8,name:"catalog_replaced",kind:"message",oneof:"change",T:()=>Bc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.sequence="0",i.change={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posqc},{no:3,name:"reset_required",kind:"message",oneof:"payload",T:()=>Cc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.payload={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posawait this.client.getRunSnapshot({runId:g.runId,operatorInstanceId:f,asOfSequence:c}).response)),d=await this.getCatalog();if(a.operatorInstanceId!==f||d.operatorInstanceId!==f||a.revision!==d.revision||BigInt(a.asOfSequence)>BigInt(c)||BigInt(d.asOfSequence)d.nodeId===i);if(!o?.eventPageToken)return[];const f=[];let c=o.eventPageToken,v="0";do{const d=await this.client.listAgentEvents({pageToken:c,afterEventSequence:v,pageSize:100}).response;f.push(...d.events),d.events.length&&(v=d.events.at(-1).eventSequence),c=d.nextPageToken}while(c);return f}async listLogs(a){if(!a.logPageToken)return[];const i=[];let o=a.logPageToken,f="0";do{const c=await this.client.listLogs({pageToken:o,afterSequence:f,pageSize:100}).response;i.push(...c.logs),c.logs.length&&(f=c.logs.at(-1).sequence),o=c.nextPageToken}while(o);return i}async readDetail(a){const i=[];for await(const v of this.client.readDetail({bodyToken:a}).responses)i.push(v.data);const o=i.reduce((v,d)=>v+d.length,0),f=new Uint8Array(o);let c=0;for(const v of i)f.set(v,c),c+=v.length;return JSON.parse(new TextDecoder().decode(f))}async startRun(a,i){return(await this.client.startRun({flowName:"",workflowSelector:a,runId:"",inputJson:i===void 0?"":JSON.stringify(i),contextJson:"",inputFiles:[]}).response).runId}async cancelRun(a){await this.client.cancelRun({runId:a}).response}}function lp(m){return m==="success"?"✓":m==="failed"?"!":m==="running"?"●":"·"}function ap({workflow:m,runs:a,selection:i,onSelect:o}){const[f,c]=Z.useState(!0);return p.jsxs("div",{className:"workflow-branch",children:[p.jsxs("div",{className:"tree-row",children:[p.jsx("button",{type:"button",className:"tree-disclosure",onClick:()=>c(v=>!v),"aria-label":`${f?"Collapse":"Expand"} ${m.displayName}`,children:f?"⌄":"›"}),p.jsxs("button",{type:"button",className:i?.kind==="workflow"&&i.workflowId===m.workflowId?"tree-select active":"tree-select",onClick:()=>o({kind:"workflow",workflowId:m.workflowId}),children:[p.jsx("span",{className:"workflow-glyph",children:"◇"}),p.jsxs("span",{children:[p.jsx("strong",{children:m.displayName}),p.jsx("small",{children:m.relativeFile})]})]})]}),f&&p.jsxs("div",{className:"run-branches",children:[a.map(v=>{const d=v.summary;return p.jsxs("button",{type:"button",className:i?.kind==="run"&&i.runId===d.runId?"run-select active":"run-select",onClick:()=>o({kind:"run",workflowId:m.workflowId,runId:d.runId}),children:[p.jsx("span",{className:`run-dot status-${d.status}`,children:lp(d.status)}),p.jsxs("span",{children:[p.jsx("strong",{children:d.runId}),p.jsx("small",{children:d.startedAt?`Created at sequence ${d.createdSequence}`:"Awaiting start"})]})]},d.runId)}),!a.length&&p.jsx("span",{className:"no-runs",children:"No runs yet"})]})]})}function ip(m,a){return m.workflows.filter(i=>i.rootAlias===a.alias)}function up({catalog:m,runs:a,selection:i,onSelect:o}){const[f,c]=Z.useState({});if(!m)return p.jsxs("aside",{id:"operator-explorer",className:"explorer skeleton","aria-label":"Explorer",children:[p.jsx("div",{}),p.jsx("div",{}),p.jsx("div",{})]});const v=m.scanTargets.length?m.scanTargets:[{alias:"workflows",targetPath:"Configured workflows",kind:"directory"}];return p.jsxs("aside",{id:"operator-explorer",className:"explorer","aria-label":"Explorer",children:[p.jsxs("header",{children:[p.jsx("span",{className:"eyebrow",children:"Navigator"}),p.jsx("h2",{children:"Explorer"}),p.jsxs("span",{className:"catalog-revision",children:["catalog r",m.revision]})]}),m.diagnostics.length>0&&p.jsxs("details",{className:"diagnostics",open:!0,children:[p.jsxs("summary",{children:[m.diagnostics.length," reload issue",m.diagnostics.length===1?"":"s"]}),m.diagnostics.map(d=>p.jsxs("div",{children:[p.jsx("strong",{children:d.kind.replaceAll("_"," ")}),p.jsx("span",{children:d.path}),p.jsx("p",{children:d.message})]},`${d.path}-${d.kind}`))]}),p.jsx("div",{className:"target-list",children:v.map(d=>{const g=d.alias==="workflows"?m.workflows:ip(m,d),y=!!f[d.alias];return p.jsxs("section",{className:"target",children:[p.jsxs("button",{type:"button",className:"target-heading",onClick:()=>c(z=>{const x={...z};return x[d.alias]?delete x[d.alias]:x[d.alias]=!0,x}),children:[p.jsx("span",{children:y?"›":"⌄"}),p.jsx("span",{className:"target-kind",children:d.kind==="file"?"F":"D"}),p.jsxs("span",{children:[p.jsx("strong",{children:d.alias}),p.jsx("small",{title:d.targetPath,children:d.targetPath})]})]}),!y&&p.jsx("div",{className:"workflow-list",children:g.map(z=>p.jsx(ap,{workflow:z,runs:Object.values(a).filter(x=>x.summary?.workflowId===z.workflowId).sort((x,B)=>Number(B.summary.createdSequence)-Number(x.summary.createdSequence)),selection:i,onSelect:o},z.workflowId))})]},d.alias)})})]})}function An(m){return typeof m=="object"&&m!==null&&!Array.isArray(m)}function tu(m){return Array.isArray(m)?m.flatMap(a=>!An(a)||typeof a.name!="string"?[]:[{name:a.name,type:typeof a.type=="string"?a.type:void 0,description:typeof a.description=="string"?a.description:void 0}]):[]}function eh(m){if(m)try{const a=JSON.parse(m);if(!An(a))return;const i=An(a.signature)?a.signature:{};return{instructions:typeof i.instructions=="string"?i.instructions:"",inputs:tu(i.inputs),outputs:tu(i.outputs),model:a.models,runtime:a.runtime,skills:a.skills,tools:a.tools}}catch{return}}function nh(m){if(m)try{const a=JSON.parse(m);return An(a)?{inputs:tu(a.inputs),outputs:tu(a.outputs)}:void 0}catch{return}}const lh=Z.memo(({data:m})=>p.jsxs("button",{type:"button",className:`node-card ${m.status?`status-${m.status}`:"blueprint"}`,onClick:m.onOpen,"aria-label":`Inspect ${m.label}${m.identity?` ${m.identity}`:""}`,children:[p.jsx(Kd,{type:"target",position:Zd.Left,isConnectable:!1}),p.jsx("span",{className:"node-kicker",children:m.nodeType}),p.jsx("strong",{children:m.label}),m.identity&&p.jsx("span",{className:"node-identity",children:m.identity}),m.status&&p.jsx("span",{className:"node-status",children:m.status}),m.duration&&p.jsx("span",{className:"node-duration",children:m.duration}),m.error&&p.jsx("span",{className:"node-error",children:m.error}),m.declaration&&p.jsxs("span",{className:"field-grid",children:[p.jsxs("span",{children:[p.jsx("small",{children:"Inputs"}),m.declaration.inputs.map(a=>p.jsx("span",{className:"field",children:a.name},`input-${a.name}`))]}),p.jsxs("span",{children:[p.jsx("small",{children:"Outputs"}),m.declaration.outputs.map(a=>p.jsx("span",{className:"field",children:a.name},`output-${a.name}`))]})]}),p.jsx(Kd,{type:"source",position:Zd.Right,isConnectable:!1})]}));lh.displayName="WorkflowNodeCard";function sp(m){const a=Object.fromEntries(m.nodeIds.map(c=>[c,0]));for(const c of Object.values(m.graph))for(const v of c.children)a[v]=(a[v]??0)+1;const i={},o=m.nodeIds.filter(c=>a[c]===0);for(const c of o)i[c]=0;for(let c=0;cv.map((d,g)=>[d,{x:Number(c)*330,y:g*220-(v.length-1)*110}])))}function cp(m){if(!m.startedAt)return;const a=m.endedAt||Date.now()/1e3,i=Math.max(0,a-m.startedAt);return i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m`}function op(m,a){const i=m.startsWith(`${a}_`)?m.slice(a.length+1):"";return i&&/^\d+$/.test(i)?`#${i}`:m}function fp({workflow:m,runTopology:a,runNodes:i=[],onOpenNode:o}){const f=Z.useMemo(()=>{if(a)return a;if(m)return{nodeIds:m.nodeIds,graph:m.graph,nodeTypes:m.nodeTypes,displayNames:m.displayNames}},[a,m]),c=Z.useMemo(()=>{if(!f)return{nodes:[],edges:[]};const v=sp(f),d=Object.fromEntries(i.map(U=>[U.nodeId,U])),g=Object.fromEntries(f.nodeIds.map(U=>[U,f.displayNames[U]||d[U]?.name||U])),y=Object.values(g).reduce((U,H)=>({...U,[H]:(U[H]??0)+1}),{}),z=f.nodeIds.map(U=>{const H=d[U];return{id:U,type:"workflow",position:v[U],data:{label:g[U],identity:y[g[U]]>1?op(U,g[U]):void 0,nodeType:f.nodeTypes[U]||H?.nodeType||"step",status:H?.status,error:H?.error,duration:H?cp(H):void 0,declaration:a?nh(a.agentFieldSchemasJson[U]):eh(m?.agentMetadataJson[U]),onOpen:()=>o(U)}}}),x=new Set,B=[];for(const[U,H]of Object.entries(f.graph))for(const J of H.children){const et=`${U}->${J}`;x.has(et)||(x.add(et),B.push({id:et,source:U,target:J,markerEnd:{type:Mm.ArrowClosed},className:"dag-edge"}))}return{nodes:z,edges:B}},[o,i,a,f,m]);return p.jsxs(wm,{nodes:c.nodes,edges:c.edges,nodeTypes:{workflow:lh},fitView:!0,fitViewOptions:{padding:.24},minZoom:.25,maxZoom:1.8,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[p.jsx(Rm,{color:"rgba(255,255,255,.06)",gap:24,size:1}),p.jsx(Um,{showInteractive:!1})]})}function rp(m,a,i){const o=new Array(m);return new Proxy(o,{get(f,c,v){if(typeof c=="string"){const d=c.charCodeAt(0);if(d>=48&&d<=57){const g=+c;if(Number.isInteger(g)&&g>=0&&go[z]!==y))&&(o=d,f=a(...d),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(f),c=!1),f}return v.updateDeps=d=>{o=d},v}function Pd(m,a){if(m===void 0)throw new Error("Unexpected undefined");return m}const dp=(m,a)=>Math.abs(m-a)<1.01,hp=(m,a,i)=>{let o;return function(...f){m.clearTimeout(o),o=m.setTimeout(()=>a.apply(this,f),i)}};let Ma;const Hc=()=>{if(Ma!==void 0)return Ma;if(typeof navigator>"u")return Ma=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ma=!0;const m=navigator.maxTouchPoints;return Ma=navigator.platform==="MacIntel"&&m!==void 0&&m>0},th=m=>{const{offsetWidth:a,offsetHeight:i}=m;return{width:a,height:i}},gp=m=>m,mp=m=>{const a=Math.max(m.startIndex-m.overscan,0),o=Math.min(m.endIndex+m.overscan,m.count-1)-a+1,f=new Array(o);for(let c=0;c{const i=m.scrollElement;if(!i)return;const o=m.targetWindow;if(!o)return;const f=v=>{const{width:d,height:g}=v;a({width:Math.round(d),height:Math.round(g)})};if(f(th(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(v=>{const d=()=>{const g=v[0];if(g?.borderBoxSize){const y=g.borderBoxSize[0];if(y){f({width:y.inlineSize,height:y.blockSize});return}}f(th(i))};m.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},eu={passive:!0},pp=typeof window>"u"?!0:"onscrollend"in window,vp=(m,a,i)=>{const o=m.scrollElement;if(!o)return;const f=m.targetWindow;if(!f)return;const c=m.options.useScrollendEvent&&pp;let v=0;const d=c?null:hp(f,()=>a(v,!1),m.options.isScrollingResetDelay),g=x=>()=>{v=i(o),d?.(),a(v,x)},y=g(!0),z=g(!1);return o.addEventListener("scroll",y,eu),c&&o.addEventListener("scrollend",z,eu),()=>{o.removeEventListener("scroll",y),c&&o.removeEventListener("scrollend",z)}},bp=(m,a)=>vp(m,a,i=>{const{horizontal:o,isRtl:f}=m.options;return o?i.scrollLeft*(f&&-1||1):i.scrollTop}),Sp=(m,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(m),f=i.options.getItemKey(o);return i.itemSizeCache.get(f)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(m),f=i.options.getItemKey(o),c=i.itemSizeCache.get(f);if(c!==void 0)return c}return m[i.options.horizontal?"offsetWidth":"offsetHeight"]},Tp=(m,{adjustments:a=0,behavior:i},o)=>{var f,c;(c=(f=o.scrollElement)==null?void 0:f.scrollTo)==null||c.call(f,{[o.options.horizontal?"left":"top"]:m+a,behavior:i})},kp=Tp;class zp{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,f;return((f=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:f.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(f=>{f.forEach(c=>{const v=()=>{const d=c.target,g=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[y,z]of this.elementsCache)if(z===d){this.elementsCache.delete(y);break}return}this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(d,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(v):v()})}));return{disconnect:()=>{var f;(f=o())==null||f.disconnect(),i=null},observe:f=>{var c;return(c=o())==null?void 0:c.observe(f,{box:"border-box"})},unobserve:f=>{var c;return(c=o())==null?void 0:c.unobserve(f)}}})(),this.range=null,this.setOptions=i=>{var o,f;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:gp,rangeExtractor:mp,onChange:()=>{},measureElement:Sp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const B in i){const U=i[B];U!==void 0&&(c[B]=U)}const v=this.options;let d=null,g=null,y=!1;if(v!==void 0&&v.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const B=v.count,U=c.count,H=this.getMeasurements(),J=B>0?((o=H[0])==null?void 0:o.key)??v.getItemKey(0):null,et=B>0?((f=H[B-1])==null?void 0:f.key)??v.getItemKey(B-1):null;if(U!==B||B>0&&U>0&&(c.getItemKey(0)!==J||c.getItemKey(U-1)!==et)){y=!0;const tt=B>0?this.getVirtualItemForOffset(this.getScrollOffset())??H[0]:null;tt&&(d=[tt.key,this.getScrollOffset()-tt.start]);const ht=c.followOnAppend===!0?"auto":c.followOnAppend||null;ht&&U>B&&this.isAtEnd(v.scrollEndThreshold)&&(B===0||c.getItemKey(U-1)!==et)&&(g=ht)}}this.options=c,y&&(this.pendingMin=0,this.itemSizeCacheVersion++);let z=!1,x=0;if(d&&this.scrollOffset!==null){const[B,U]=d,H=this.getMeasurements(),{count:J,getItemKey:et}=this.options;let L=0;for(;L{var o,f;(f=(o=this.options).onChange)==null||f.call(o,this,i)},this.maybeNotify=Ml(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,v)=>{if(v&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=v?d===c?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Hc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",v,eu),c.addEventListener("touchend",d,eu),this.unsubs.push(()=>{c.removeEventListener("touchstart",v),c.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const f=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,f&&this.scrollElement&&this.options.enabled){const[c,v,d,g]=f;c!==null&&!d&&(Hc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?g!==0&&(this._iosDeferredAdjustment+=g):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const f=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=f,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ml(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,f,c,v,d,g,y)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:y}),{key:!1}),this.getMeasurements=Ml(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:y},z)=>{const x=this.itemSizeCache;if(!v)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const L of this.laneAssignments.keys())L>=i&&this.laneAssignments.delete(L);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(L=>{this.itemSizeCache.set(L.key,L.size)}));const B=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),d===1){const L=i*2;let Q=this._flatMeasurements;if(!Q||Q.length0&&at.set(Q.subarray(0,B*2)),Q=at,this._flatMeasurements=Q}let tt;if(B===0)tt=o+f;else{const at=B-1;tt=Q[at*2]+Q[at*2+1]+y}for(let at=B;at1){ht=tt;const Qt=H[ht],Ot=Qt!==void 0?U[Qt]:void 0;at=Ot?Ot.end+y:o+f}else if(et===d){let Qt=0,Ot=J[0],Lt=H[0];for(let Zt=1;Ztthis.options.debug}),this.calculateRange=Ml(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,f,c)=>i.length===0||o===0?(this.range=null,null):(this.range=Np(i,o,f,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ml(()=>{let i=null,o=null;const f=this.calculateRange();return f&&(i=f.startIndex,o=f.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,f,c,v)=>c===null||v===null?[]:i({startIndex:c,endIndex:v,overscan:o,count:f}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,f=i.getAttribute(o);return f?parseInt(f,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const f=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(f!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),v=Math.max(0,f-c),d=Math.min(this.options.count-1,f+c);return i>=v&&i<=d}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((v,d)=>{v.isConnected||(this.observer.unobserve(v),this.elementsCache.delete(d))});return}const o=this.indexFromElement(i),f=this.options.getItemKey(o),c=this.elementsCache.get(f);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(f,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var f,c;if(i<0||i>=this.options.count)return;let v,d,g;const y=this._flatMeasurements;if(this.options.lanes===1&&y!==null)g=this.options.getItemKey(i),d=y[i*2],v=y[i*2+1];else{const B=this.measurementsCache[i];if(!B)return;g=B.key,d=B.start,v=B.size}const z=this.itemSizeCache.get(g)??v,x=o-z;if(x!==0){const B=this.options.anchorTo==="end"&&((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,U=B?this.getTotalSize():0,H=this.getScrollOffset()+this.scrollAdjustments,et=!this.itemSizeCache.has(g)?d[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const f=[];for(let c=0,v=i.length;cthis.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const f=this._flatMeasurements,c=this.options.lanes===1&&f!=null,v=ah(0,o.length-1,c?d=>f[d*2]:d=>Pd(o[d]).start,i);return Pd(o[v])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,f=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),v=this.getScrollOffset();o==="auto"&&(o=i>=v+c?"end":"start"),o==="center"?i+=(f-c)/2:o==="end"&&(i-=c);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const f=this.getSize(),c=this.getScrollOffset(),v=this.measurementsCache[i];if(!v)return;if(o==="auto")if(v.end>=c+f-this.options.scrollPaddingEnd)o="end";else if(v.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?v.end+this.options.scrollPaddingEnd:v.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,v.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),v=this.now();this.scrollState={index:null,align:o,behavior:f,startedAt:v,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[v,d]=c,g=this.now();this.scrollState={index:i,align:d,behavior:f,startedAt:g,lastTargetOffset:v,stableFrames:0},this._scrollToOffset(v,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const f=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let f;if(o.length===0)f=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,v=this._flatMeasurements;v!=null?f=v[c*2]+v[c*2+1]:f=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let v=o.length-1;for(;v>=0&&c.some(d=>d===null);){const d=o[v];c[d.lane]===null&&(c[d.lane]=d.end),v--}f=Math.max(...c.filter(d=>d!==null))}return Math.max(f-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const f of o)f&&this.itemSizeCache.has(f.key)&&i.push({index:f.index,key:f.key,start:f.start,size:f.size,end:f.end,lane:f.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:f})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:f,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Hc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,f=o?o[0]:this.scrollState.lastTargetOffset,c=1,v=f!==this.scrollState.lastTargetOffset;if(!v&&dp(f,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==f&&this._scrollToOffset(f,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,v){const d=this.getSize()||600,g=Math.abs(f-this.getScrollOffset()),y=this.scrollState.behavior==="smooth"&&g>d;this.scrollState.lastTargetOffset=f,y||(this.scrollState.behavior="auto"),this._scrollToOffset(f,{adjustments:void 0,behavior:y?"smooth":"auto"})}this.scheduleScrollReconcile()}}const ah=(m,a,i,o)=>{for(;m<=a;){const f=(m+a)/2|0,c=i(f);if(co)a=f-1;else return f}return m>0?m-1:0};function Ep(m,a,i){let o=0;for(;o<=a;){const f=(o+a)/2|0,c=m[f*2];if(ci)a=f-1;else return f}return o>0?o-1:0}function Np(m,a,i,o,f){const c=m.length-1;if(m.length<=o)return{startIndex:0,endIndex:c};if(o===1&&f!==null){const y=Ep(f,c,i);let z=y;const x=i+a;for(;zm[y].start,i),g=d;if(o===1)for(;g1){const y=Array(o).fill(0);for(;gx=0&&z.some(x=>x>=i);){const x=m[d];z[x.lane]=x.start,d--}d=Math.max(0,d-d%o),g=Math.min(c,g+(o-1-g%o))}return{startIndex:d,endIndex:g}}const Vc=typeof document<"u"?Z.useLayoutEffect:Z.useEffect;function Ap({useFlushSync:m=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const f=Z.useReducer(z=>z+1,0)[1],c=Z.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const v=z=>{const x=c.current;if(!x.enabled||!x.container)return;const B=z.getTotalSize();if(B!==x.lastSize){x.lastSize=B;const U=z.options.horizontal?"width":"height";x.container.style[U]=`${B}px`}},d=z=>{const x=c.current;if(!x.enabled||!x.container)return;v(z);const B=!!z.options.horizontal,U=x.mode==="transform",H=B?"left":"top",J=z.options.scrollMargin,et=z.getVirtualItems();for(const L of et){const Q=L.start-J,tt=z.elementsCache.get(L.key);tt&&x.lastPositions.get(tt)!==Q&&(x.lastPositions.set(tt,Q),U?tt.style.transform=B?`translate3d(${Q}px, 0, 0)`:`translate3d(0, ${Q}px, 0)`:tt.style[H]=`${Q}px`)}},g={...o,onChange:(z,x)=>{var B;const U=c.current;let H=!0;if(U.enabled){d(z);const J=z.range,et=U.prevRange;H=!et||et.isScrolling!==z.isScrolling||et.startIndex!==J?.startIndex||et.endIndex!==J?.endIndex,H&&(U.prevRange=J?{startIndex:J.startIndex,endIndex:J.endIndex,isScrolling:z.isScrolling}:null)}H&&(m&&x?Bm.flushSync(f):f()),(B=o.onChange)==null||B.call(o,z,x)}},[y]=Z.useState(()=>{const z=new zp(g);return Object.assign(z,{containerRef:x=>{const B=c.current;if(B.container=x,B.lastSize=null,x&&B.enabled){const U=z.getTotalSize();B.lastSize=U;const H=z.options.horizontal?"width":"height";x.style[H]=`${U}px`}}})});return y.setOptions(g),Vc(()=>y._didMount(),[]),Vc(()=>(v(y),y._willUpdate())),Vc(()=>{d(y)}),y}function Op(m){return Ap({observeElementRect:yp,observeElementOffset:bp,scrollToFn:kp,...m})}function Kn({value:m,depth:a=0}){return m===null?p.jsx("span",{className:"value-null",children:"null"}):typeof m=="string"?p.jsx("span",{className:"value-string",children:m}):typeof m=="number"||typeof m=="boolean"?p.jsx("span",{className:"value-scalar",children:String(m)}):Array.isArray(m)?p.jsx("ol",{className:"value-list",children:m.map((i,o)=>p.jsx("li",{children:p.jsx(Kn,{value:i,depth:a+1})},`${a}-${o}`))}):An(m)?m.kind==="predict_rlm_file"&&typeof m.path=="string"?p.jsxs("span",{className:"file-value",title:"Reported host path; contents are not copied",children:[p.jsx("span",{"aria-hidden":"true",children:"↗"}),p.jsxs("span",{children:[p.jsx("small",{children:"PredictRLM file"}),p.jsx("code",{children:m.path})]})]}):m.kind==="unavailable"&&typeof m.reason=="string"?p.jsxs("span",{className:"value-unavailable",children:["Unavailable · ",m.reason]}):p.jsx("dl",{className:"value-object",children:Object.entries(m).map(([i,o])=>p.jsxs("div",{children:[p.jsx("dt",{children:i}),p.jsx("dd",{children:p.jsx(Kn,{value:o,depth:a+1})})]},i))}):p.jsx("span",{className:"value-unavailable",children:"Unavailable"})}const xp=[],jp=[];function Yc({value:m}){return p.jsx("pre",{className:"json-block",children:JSON.stringify(m,null,2)})}function Dp(m){if(An(m))return An(m.data)?m.data:m}function _p({api:m,workflow:a,run:i,nodeId:o,liveEvents:f=xp,liveLogs:c=jp,onClose:v}){const[d,g]=Z.useState("overview"),[y,z]=Z.useState([]),[x,B]=Z.useState([]),[U,H]=Z.useState(),[J,et]=Z.useState(),[L,Q]=Z.useState(),[tt,ht]=Z.useState(!0),at=Z.useRef(new Map),Ut=Z.useRef(null),$=i?.nodes.find(w=>w.nodeId===o),Tt=i?void 0:eh(a?.agentMetadataJson[o??""]),re=i?nh(i.topology?.agentFieldSchemasJson[o??""]):void 0;Z.useEffect(()=>{if(g("overview"),z([]),B([]),H(void 0),et(void 0),ht(!0),at.current.clear(),!i||!o)return;let w=!0;return Promise.all([m.listAgentEvents(i,o),m.listLogs(i)]).then(([Y,bt])=>{w&&(z(Y),B(bt.filter(ct=>!ct.nodeId||ct.nodeId===o)))}).catch(Y=>{w&&Q(Y instanceof Error?Y.message:"Details unavailable")}),()=>{w=!1}},[m,o,i]);const Qt=Z.useMemo(()=>{const w=new Map;for(const Y of[...y,...f])w.set(Y.eventSequence,Y);return[...w.values()].sort((Y,bt)=>Number(Y.eventSequence)-Number(bt.eventSequence))},[y,f]),Ot=Qt.filter(w=>w.eventKind==="iteration.recorded"),Lt=Z.useMemo(()=>{const w=new Map;for(const Y of[...x,...c])w.set(Y.sequence,Y);return[...w.values()].sort((Y,bt)=>Number(Y.sequence)-Number(bt.sequence))},[c,x]),Zt=Z.useMemo(()=>{const w=$?.trace?.header?.usageJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.usageJson]),de=Z.useMemo(()=>{const w=$?.trace?.header?.telemetryJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.telemetryJson]),he=d==="inputs"?re?.inputs:d==="output"?re?.outputs:void 0,_=Op({count:Ot.length,getScrollElement:()=>Ut.current,estimateSize:()=>64,overscan:6});if(Z.useEffect(()=>{!tt||!Ot.length||H(Ot.at(-1).eventSequence)},[tt,Ot]),Z.useEffect(()=>{const w=Qt.find(ct=>ct.eventSequence===U);if(!w?.bodyToken){et(void 0);return}const Y=at.current.get(w.bodyToken);if(Y!==void 0){at.current.delete(w.bodyToken),at.current.set(w.bodyToken,Y),et(Y);return}let bt=!0;return et(void 0),Q(void 0),m.readDetail(w.bodyToken).then(ct=>{if(bt){for(at.current.delete(w.bodyToken),at.current.set(w.bodyToken,ct);at.current.size>8;){const ot=at.current.keys().next().value;if(ot===void 0)break;at.current.delete(ot)}et(ct)}}).catch(ct=>{bt&&Q(ct instanceof Error?ct.message:"Detail unavailable")}),()=>{bt=!1}},[m,Qt,U]),Z.useEffect(()=>{const w=d==="inputs"?"run.started":d==="output"?"run.succeeded":void 0;if(!w)return;const Y=[...Qt].reverse().find(bt=>bt.eventKind===w);Y&&H(Y.eventSequence)},[Qt,d]),!i&&a&&o)return p.jsxs("aside",{className:"inspector","aria-label":"Node declaration",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Declaration"}),p.jsx("h2",{children:a.displayNames[o]||o})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),Tt?p.jsxs("div",{className:"inspector-body declaration",children:[p.jsxs("section",{children:[p.jsx("h3",{children:"Instructions"}),p.jsx("p",{className:"instructions",children:Tt.instructions||"No instructions"})]}),p.jsxs("section",{className:"signature-columns",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"Inputs"}),Tt.inputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]}),p.jsxs("div",{children:[p.jsx("h3",{children:"Outputs"}),Tt.outputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Runtime"}),p.jsx(Yc,{value:Tt.runtime})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Models"}),p.jsx(Yc,{value:Tt.model})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Skills & tools"}),p.jsx(Yc,{value:{skills:Tt.skills,tools:Tt.tools}})]})]}):p.jsx("p",{className:"empty-copy",children:"This node has no agent declaration metadata."})]});if(!i||!$)return null;const q=Dp(J),K=d==="inputs"?"inputs":"outputs";return p.jsxs("aside",{className:"inspector","aria-label":"Run inspector",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Historical execution"}),p.jsx("h2",{children:$.name}),p.jsx("span",{className:`status-pill status-${$.status}`,children:$.status})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),p.jsx("nav",{className:"inspector-tabs","aria-label":"Run detail views",children:["overview","inputs","output","trace","logs"].map(w=>p.jsx("button",{type:"button",className:d===w?"active":"",onClick:()=>g(w),children:w},w))}),p.jsxs("div",{className:"inspector-body",children:[L&&p.jsx("p",{className:"error-banner",children:L}),d==="overview"&&p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:"metric-grid",children:[p.jsxs("div",{children:[p.jsx("small",{children:"Status"}),p.jsx("strong",{children:$.status})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Revision"}),p.jsx("strong",{children:$.revision})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Started"}),p.jsx("strong",{children:$.startedAt?"yes":"—"})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Duration"}),p.jsx("strong",{children:$.startedAt&&$.endedAt?`${Math.max(0,$.endedAt-$.startedAt).toFixed(2)}s`:"—"})]})]}),$.error&&p.jsx("p",{className:"node-failure",children:$.error}),$.trace&&p.jsxs("section",{children:[p.jsx("h3",{children:"Trace header"}),p.jsxs("dl",{className:"trace-header",children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Status"}),p.jsx("dd",{children:$.trace.status})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Events"}),p.jsx("dd",{children:$.trace.eventCount})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Size"}),p.jsxs("dd",{children:[$.trace.sizeBytes," B"]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Complete"}),p.jsx("dd",{children:$.trace.complete?"yes":"no"})]}),$.trace.header&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Model"}),p.jsx("dd",{children:$.trace.header.model})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Iterations"}),p.jsxs("dd",{children:[$.trace.header.iterations,"/",$.trace.header.maxIterations]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Duration"}),p.jsxs("dd",{children:[$.trace.header.durationMs," ms"]})]})]})]}),Zt!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Usage"}),p.jsx(Kn,{value:Zt})]}),de!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Telemetry"}),p.jsx(Kn,{value:de})]})]})]}),(d==="inputs"||d==="output")&&p.jsxs("section",{children:[p.jsx("h3",{children:d==="inputs"?"Invocation inputs":"Terminal output"}),he?.length?p.jsxs("div",{className:"declared-fields",children:[p.jsx("small",{children:"Declared fields"}),he.map(w=>p.jsxs("span",{children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type})]},w.name))]}):null,q&&K in q?p.jsx(Kn,{value:q[K]}):p.jsxs("p",{className:"empty-copy",children:["No retained ",d," ",d==="output"?"is":"are"," available."]})]}),d==="trace"&&p.jsxs("section",{className:"trace-layout",children:[p.jsxs("div",{className:"trace-toolbar",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"RunTrace"}),p.jsxs("span",{children:[Ot.length," complete turns"]})]}),p.jsx("button",{type:"button",className:tt?"toggle active":"toggle",onClick:()=>ht(w=>!w),children:tt?"Following live":"Follow latest"})]}),p.jsx("div",{className:"turn-list",ref:Ut,children:p.jsx("div",{style:{height:_.getTotalSize(),position:"relative"},children:_.getVirtualItems().map(w=>{const Y=Ot[w.index];return p.jsxs("button",{type:"button",className:`turn-row ${U===Y.eventSequence?"active":""} ${Y.error?"failed":""}`,style:{transform:`translateY(${w.start}px)`},onClick:()=>{ht(!1),H(Y.eventSequence)},children:[p.jsxs("strong",{children:["Turn ",Y.iteration??w.index+1]}),p.jsx("span",{children:Y.durationMs?`${Y.durationMs} ms`:"—"}),p.jsxs("small",{children:[Y.toolCount," tools · ",Y.predictCount," predicts"]})]},Y.eventSequence)})})}),p.jsx("div",{className:"turn-detail",children:J!==void 0?p.jsx(Kn,{value:J}):p.jsx("p",{className:"empty-copy",children:"Select a turn."})})]}),d==="logs"&&p.jsxs("section",{children:[p.jsx("h3",{children:"Node logs"}),p.jsx("div",{className:"log-list",children:Lt.map(w=>p.jsxs("button",{type:"button",onClick:()=>{m.readDetail(w.bodyToken).then(et).catch(Y=>{Q(Y instanceof Error?Y.message:"Log unavailable")})},children:[p.jsx("span",{className:`log-level level-${w.level}`,children:w.level}),p.jsx("time",{children:new Date(w.timestamp*1e3).toLocaleTimeString()}),p.jsxs("span",{children:["#",w.sequence]})]},w.sequence))}),J!==void 0&&p.jsx(Kn,{value:J})]})]})]})}function Mp({value:m,onChange:a}){const i=Z.useRef(null);return Z.useEffect(()=>{if(!i.current)return;const o=new Da({parent:i.current,state:Lm.create({doc:m,extensions:[Hm(),Vm.of([]),Da.lineWrapping,Da.contentAttributes.of({"aria-label":"Workflow input JSON"}),Da.theme({"&":{backgroundColor:"#ffffff",color:"#17211c"},".cm-content":{caretColor:"#2563eb",minHeight:"110px"},".cm-gutters":{backgroundColor:"#f6f8f7",color:"#7b8680",border:"0"},"&.cm-focused":{outline:"1px solid #9bb6f5"}}),Da.updateListener.of(f=>{f.docChanged&&a(f.state.doc.toString())})]})});return()=>o.destroy()},[]),p.jsx("div",{className:"json-editor",ref:i})}function wp(m){const a=JSON.parse(m);if(!An(a))throw new Error("Run input must be a JSON object");return a}function Rp({workflow:m,run:a,pending:i,onStart:o,onCancel:f}){const[c,v]=Z.useState(!1),[d,g]=Z.useState("{}"),[y,z]=Z.useState(),x=a?.summary?.status==="pending"||a?.summary?.status==="running",B=async()=>{if(!m)return;z(void 0);let U;if(c)try{U=wp(d)}catch(H){z(H instanceof Error?H.message:"Run input is invalid JSON");return}try{await o(m.workflowId,U)}catch(H){z(H instanceof Error?H.message:"Operator rejected the run")}};return p.jsxs("div",{className:"run-controls",children:[m&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"run-button",disabled:i?.kind==="start",onClick:()=>{B()},children:i?.kind==="start"?"Requesting…":"Run"}),p.jsx("button",{type:"button",className:`input-toggle ${c?"active":""}`,onClick:()=>v(U=>!U),children:c?"Hide JSON input":"Add JSON input"})]}),x&&a?.summary&&p.jsx("button",{type:"button",className:"cancel-button",disabled:i?.kind==="cancel",onClick:()=>{z(void 0),f(a.summary.runId).catch(U=>{z(U instanceof Error?U.message:"Cancellation failed")})},children:i?.kind==="cancel"?"Cancelling…":"Cancel run"}),c&&m&&p.jsxs("div",{className:"input-popover",children:[p.jsxs("div",{children:[p.jsx("strong",{children:"Workflow input"}),p.jsx("span",{children:"Schema-blind JSON object"})]}),p.jsx(Mp,{value:d,onChange:g})]}),y&&p.jsx("div",{className:"action-error",children:y})]})}const ih={runs:{},liveEvents:{},liveLogs:{},operatorInstanceId:"",sequence:"0",connection:"connecting"};function Up(m,a){if(a.type==="baseline"){const g=Object.fromEntries(a.baseline.runs.filter(y=>y.summary).map(y=>[y.summary.runId,y]));return{...ih,catalog:a.baseline.catalog,runs:g,operatorInstanceId:a.baseline.catalog.operatorInstanceId,sequence:a.baseline.asOfSequence,connection:"live"}}if(a.type==="connection")return{...m,connection:a.connection,error:a.error};if(a.type==="action")return{...m,action:a.action};const{envelope:i}=a;if(i.operatorInstanceId!==m.operatorInstanceId)throw new Error("Operator epoch changed");if(i.payload.oneofKind!=="update")throw new Error("Operator requested a structural reset");const o=i.payload.update;if(BigInt(o.sequence)!==BigInt(m.sequence)+1n)throw new Error(`Operator update gap after sequence ${m.sequence}`);const f={...m,sequence:o.sequence,error:void 0},c=o.change;if(c.oneofKind==="catalogReplaced")return c.catalogReplaced.catalog&&(f.catalog=c.catalogReplaced.catalog),f;if(c.oneofKind==="runCreated"&&c.runCreated.summary){const g=c.runCreated.summary;return f.runs={...m.runs,[g.runId]:{operatorInstanceId:m.operatorInstanceId,asOfSequence:o.sequence,summary:g,nodes:c.runCreated.nodes,latestLogSequence:"0",logPageToken:"",topology:c.runCreated.topology}},f}const v=c.oneofKind==="runStatusChanged"?c.runStatusChanged.runId:c.oneofKind==="nodeStatusChanged"?c.nodeStatusChanged.runId:c.oneofKind==="logAppended"?c.logAppended.runId:c.oneofKind==="agentEventAppended"?c.agentEventAppended.runId:c.oneofKind==="traceFinalized"?c.traceFinalized.runId:"",d=m.runs[v];if(!d)throw new Error(`Operator update referenced unknown run ${v}`);if(c.oneofKind==="runStatusChanged"&&d.summary)f.runs={...m.runs,[v]:{...d,summary:{...d.summary,status:c.runStatusChanged.status,startedAt:c.runStatusChanged.startedAt,endedAt:c.runStatusChanged.endedAt,revision:c.runStatusChanged.revision}}};else if(c.oneofKind==="nodeStatusChanged"){const g=c.nodeStatusChanged;f.runs={...m.runs,[v]:{...d,nodes:d.nodes.map(y=>y.nodeId===g.nodeId?{...y,status:g.status,startedAt:g.startedAt,endedAt:g.endedAt,revision:g.revision,error:g.error}:y)}}}else if(c.oneofKind==="logAppended"&&c.logAppended.log)f.liveLogs={...m.liveLogs,[v]:[...m.liveLogs[v]??[],c.logAppended.log]};else if(c.oneofKind==="agentEventAppended"&&c.agentEventAppended.event){const g=`${v}:${c.agentEventAppended.nodeId}`;f.liveEvents={...m.liveEvents,[g]:[...m.liveEvents[g]??[],c.agentEventAppended.event]}}else c.oneofKind==="traceFinalized"&&c.traceFinalized.trace&&(f.runs={...m.runs,[v]:{...d,nodes:d.nodes.map(g=>g.nodeId===c.traceFinalized.nodeId?{...g,trace:c.traceFinalized.trace}:g)}});return f}function Bp(m){const[a,i]=Z.useReducer(Up,ih),o=Z.useRef(0),f=Z.useCallback(async()=>{const d=await m.loadBaseline();return i({type:"baseline",baseline:d}),d},[m]);Z.useEffect(()=>{const d=++o.current;let g=!1;return(async()=>{let z=250;for(;!g&&o.current===d;)try{i({type:"connection",connection:"connecting"});const x=await m.loadBaseline();if(g)return;i({type:"baseline",baseline:x}),z=250;let B=x.asOfSequence;for await(const U of m.streamUpdates(x.catalog.operatorInstanceId,B)){if(g)return;if(U.payload.oneofKind!=="update"||BigInt(U.payload.update.sequence)!==BigInt(B)+1n)break;i({type:"envelope",envelope:U}),B=U.payload.update.sequence}i({type:"connection",connection:"reconnecting"})}catch(x){if(g)return;i({type:"connection",connection:"reconnecting",error:x instanceof Error?x.message:"Operator connection failed"});const{promise:B,resolve:U}=Promise.withResolvers();window.setTimeout(U,z),await B,z=Math.min(z*2,4e3)}})(),()=>{g=!0,o.current+=1}},[m]);const c=Z.useCallback(async(d,g)=>{i({type:"action",action:{kind:"start",target:d}});try{return await m.startRun(d,g)}finally{i({type:"action",action:void 0})}},[m]),v=Z.useCallback(async d=>{i({type:"action",action:{kind:"cancel",target:d}});try{await m.cancelRun(d)}finally{i({type:"action",action:void 0})}},[m]);return{state:a,reconcile:f,startRun:c,cancelRun:v}}function qp({api:m}){const{state:a,startRun:i,cancelRun:o}=Bp(m),[f,c]=Z.useState(),[v,d]=Z.useState(),[g,y]=Z.useState(!1);Z.useEffect(()=>{const L=a.catalog?.workflows??[];if(!L.length){c(void 0);return}if(!f){c({kind:"workflow",workflowId:L[0].workflowId});return}L.some(Q=>Q.workflowId===f.workflowId)||c({kind:"workflow",workflowId:L[0].workflowId})},[f,a.catalog]);const z=a.catalog?.workflows.find(L=>L.workflowId===f?.workflowId),x=f?.kind==="run"?a.runs[f.runId]:void 0,B=Z.useMemo(()=>Object.values(a.runs).filter(L=>L.summary?.workflowId===z?.workflowId).sort((L,Q)=>Number(Q.summary.createdSequence)-Number(L.summary.createdSequence))[0],[a.runs,z?.workflowId]),U=Z.useCallback(L=>d(L),[]),H=Z.useCallback(L=>{c(L),d(void 0),y(!1)},[]),J=x??(f?.kind==="workflow"?B:void 0),et=x&&v?`${x.summary?.runId}:${v}`:"";return p.jsxs("div",{className:`app-shell ${g?"explorer-open":""}`,children:[p.jsxs("header",{className:"topbar",children:[p.jsxs("div",{className:"brand",children:[p.jsx("span",{className:"brand-mark","aria-hidden":"true",children:"A"}),p.jsxs("div",{children:[p.jsx("strong",{children:"Avalanche"}),p.jsx("span",{children:"Operator"})]})]}),p.jsxs("div",{className:"breadcrumb",children:[p.jsx("span",{children:z?.rootAlias||"Local operator"}),z&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:z.displayName})]}),x?.summary&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:x.summary.runId})]})]}),p.jsxs("div",{className:`connection connection-${a.connection}`,children:[p.jsx("span",{}),a.connection==="live"?"Live":a.connection,p.jsxs("small",{children:["seq ",a.sequence]})]}),p.jsx("button",{type:"button",className:"explorer-toggle","aria-controls":"operator-explorer","aria-expanded":g,onClick:()=>y(L=>!L),children:"Explorer"})]}),a.error&&p.jsx("div",{className:"connection-error",children:a.error}),p.jsxs("main",{className:`workspace ${v?"with-inspector":""}`,children:[p.jsx(up,{catalog:a.catalog,runs:a.runs,selection:f,onSelect:H}),p.jsxs("section",{className:"canvas-shell",children:[p.jsxs("header",{className:"view-header",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:x?"Historical run":"Current definition"}),p.jsx("h1",{children:x?.summary?.runId||z?.displayName||"Operator"}),p.jsx("p",{children:x?`Recorded topology · ${x.summary?.status??"unknown"}`:z?`${z.nodeIds.length} nodes · ${z.relativeFile}`:"Waiting for a workflow catalog"})]}),p.jsx(Rp,{workflow:x?void 0:z,run:x??J,pending:a.action,onStart:i,onCancel:o})]}),p.jsxs("div",{className:x?"canvas run-canvas":"canvas blueprint-canvas",children:[z||x?.topology?p.jsx(fp,{workflow:x?void 0:z,runTopology:x?.topology,runNodes:x?.nodes,onOpenNode:U}):p.jsxs("div",{className:"empty-state",children:[p.jsx("span",{children:"◇"}),p.jsx("h2",{children:"No workflows discovered"}),p.jsx("p",{children:"Catalog changes will appear here as the operator scans configured targets."})]}),x&&p.jsxs("div",{className:"historical-badge",children:[p.jsx("span",{children:"Immutable run snapshot"}),"Current workflow changes do not alter this canvas"]})]})]}),v&&p.jsx(_p,{api:m,workflow:z,run:x,nodeId:v,liveEvents:a.liveEvents[et],liveLogs:x?.summary?a.liveLogs[x.summary.runId]:void 0,onClose:()=>d(void 0)})]})]})}const uh=document.getElementById("root");if(!uh)throw new Error("Operator UI root element is missing");Km.createRoot(uh).render(p.jsx(Z.StrictMode,{children:p.jsx(qp,{api:new np})})); diff --git a/src/runtime/operator/web_assets/assets/index-K_C1Akn9.js b/src/runtime/operator/web_assets/assets/index-K_C1Akn9.js deleted file mode 100644 index fe26687..0000000 --- a/src/runtime/operator/web_assets/assets/index-K_C1Akn9.js +++ /dev/null @@ -1,9 +0,0 @@ -import{r as jm,a as Dm,b as J,j as p,H as Qd,P as Kd,M as Mm,i as _m,B as Rm,C as wm,c as Um}from"./graph-CoDTrhFP.js";import{S as Bm,M as W,r as F,U,W as S,s as Oe,G as qm}from"./protobuf-BR9ifi4u.js";import{E as Ii,a as Cm,j as Lm,k as Hm}from"./editor-Dh6wG2B-.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const c of f)if(c.type==="childList")for(const v of c.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function i(f){const c={};return f.integrity&&(c.integrity=f.integrity),f.referrerPolicy&&(c.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?c.credentials="include":f.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(f){if(f.ep)return;f.ep=!0;const c=i(f);fetch(f.href,c)}})();var Sc={exports:{}},Da={},Tc={exports:{}},kc={};var Zd;function Vm(){return Zd||(Zd=1,(function(y){function a(M,B){var Q=M.length;M.push(B);t:for(;0>>1,H=M[w];if(0>>1;wf(ot,Q))qtf(xe,ot)?(M[w]=xe,M[qt]=Q,w=qt):(M[w]=ot,M[ct]=Q,w=ct);else if(qtf(xe,Q))M[w]=xe,M[qt]=Q,w=qt;else break t}}return B}function f(M,B){var Q=M.sortIndex-B.sortIndex;return Q!==0?Q:M.id-B.id}if(y.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;y.unstable_now=function(){return c.now()}}else{var v=Date,d=v.now();y.unstable_now=function(){return v.now()-d}}var g=[],m=[],z=1,j=null,R=3,C=!1,Y=!1,G=!1,ut=!1,K=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,tt=typeof setImmediate<"u"?setImmediate:null;function ht(M){for(var B=i(m);B!==null;){if(B.callback===null)o(m);else if(B.startTime<=M)o(m),B.sortIndex=B.expirationTime,a(g,B);else break;B=i(m)}}function lt(M){if(G=!1,ht(M),!Y)if(i(g)!==null)Y=!0,Bt||(Bt=!0,Ht());else{var B=i(m);B!==null&&he(lt,B.startTime-M)}}var Bt=!1,$=-1,jt=5,Dt=-1;function Kt(){return ut?!0:!(y.unstable_now()-DtM&&Kt());){var w=j.callback;if(typeof w=="function"){j.callback=null,R=j.priorityLevel;var H=w(j.expirationTime<=M);if(M=y.unstable_now(),typeof H=="function"){j.callback=H,ht(M),B=!0;break e}j===i(g)&&o(g),ht(M)}else o(g);j=i(g)}if(j!==null)B=!0;else{var bt=i(m);bt!==null&&he(lt,bt.startTime-M),B=!1}}break t}finally{j=null,R=Q,C=!1}B=void 0}}finally{B?Ht():Bt=!1}}}var Ht;if(typeof tt=="function")Ht=function(){tt(At)};else if(typeof MessageChannel<"u"){var Jt=new MessageChannel,de=Jt.port2;Jt.port1.onmessage=At,Ht=function(){de.postMessage(null)}}else Ht=function(){K(At,0)};function he(M,B){$=K(function(){M(y.unstable_now())},B)}y.unstable_IdlePriority=5,y.unstable_ImmediatePriority=1,y.unstable_LowPriority=4,y.unstable_NormalPriority=3,y.unstable_Profiling=null,y.unstable_UserBlockingPriority=2,y.unstable_cancelCallback=function(M){M.callback=null},y.unstable_forceFrameRate=function(M){0>M||125w?(M.sortIndex=Q,a(m,M),i(g)===null&&M===i(m)&&(G?(Z($),$=-1):G=!0,he(lt,Q-w))):(M.sortIndex=H,a(g,M),Y||C||(Y=!0,Bt||(Bt=!0,Ht()))),M},y.unstable_shouldYield=Kt,y.unstable_wrapCallback=function(M){var B=R;return function(){var Q=R;R=B;try{return M.apply(this,arguments)}finally{R=Q}}}})(kc)),kc}var Jd;function Ym(){return Jd||(Jd=1,Tc.exports=Vm()),Tc.exports}var $d;function Gm(){if($d)return Da;$d=1;var y=Ym(),a=jm(),i=Dm();function o(t){var e="https://react.dev/errors/"+t;if(1H||(t.current=w[H],w[H]=null,H--)}function ot(t,e){H++,w[H]=t.current,t.current=e}var qt=bt(null),xe=bt(null),Ie=bt(null),_a=bt(null);function Ra(t,e){switch(ot(Ie,e),ot(xe,t),ot(qt,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?gd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=gd(e),t=md(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ct(qt),ot(qt,t)}function Zn(){ct(qt),ct(xe),ct(Ie)}function eu(t){t.memoizedState!==null&&ot(_a,t);var e=qt.current,n=md(e,t.type);e!==n&&(ot(xe,t),ot(qt,n))}function wa(t){xe.current===t&&(ct(qt),ct(xe)),_a.current===t&&(ct(_a),Aa._currentValue=Q)}var nu,Yc;function An(t){if(nu===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);nu=e&&e[1]||"",Yc=-1)":-1u||b[l]!==N[u]){var x=` -`+b[l].replace(" at new "," at ");return t.displayName&&x.includes("")&&(x=x.replace("",t.displayName)),x}while(1<=l&&0<=u);break}}}finally{lu=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?An(n):""}function uh(t,e){switch(t.tag){case 26:case 27:case 5:return An(t.type);case 16:return An("Lazy");case 13:return t.child!==e&&e!==null?An("Suspense Fallback"):An("Suspense");case 19:return An("SuspenseList");case 0:case 15:return au(t.type,!1);case 11:return au(t.type.render,!1);case 1:return au(t.type,!0);case 31:return An("Activity");default:return""}}function Gc(t){try{var e="",n=null;do e+=uh(t,n),n=t,t=t.return;while(t);return e}catch(l){return` -Error generating stack: `+l.message+` -`+l.stack}}var iu=Object.prototype.hasOwnProperty,uu=y.unstable_scheduleCallback,su=y.unstable_cancelCallback,sh=y.unstable_shouldYield,ch=y.unstable_requestPaint,ne=y.unstable_now,oh=y.unstable_getCurrentPriorityLevel,Xc=y.unstable_ImmediatePriority,Qc=y.unstable_UserBlockingPriority,Ua=y.unstable_NormalPriority,fh=y.unstable_LowPriority,Kc=y.unstable_IdlePriority,rh=y.log,dh=y.unstable_setDisableYieldValue,Cl=null,le=null;function Pe(t){if(typeof rh=="function"&&dh(t),le&&typeof le.setStrictMode=="function")try{le.setStrictMode(Cl,t)}catch{}}var ae=Math.clz32?Math.clz32:mh,hh=Math.log,gh=Math.LN2;function mh(t){return t>>>=0,t===0?32:31-(hh(t)/gh|0)|0}var Ba=256,qa=262144,Ca=4194304;function On(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function La(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var u=0,s=t.suspendedLanes,r=t.pingedLanes;t=t.warmLanes;var h=l&134217727;return h!==0?(l=h&~s,l!==0?u=On(l):(r&=h,r!==0?u=On(r):n||(n=h&~t,n!==0&&(u=On(n))))):(h=l&~s,h!==0?u=On(h):r!==0?u=On(r):n||(n=l&~t,n!==0&&(u=On(n)))),u===0?0:e!==0&&e!==u&&(e&s)===0&&(s=u&-u,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:u}function Ll(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function yh(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zc(){var t=Ca;return Ca<<=1,(Ca&62914560)===0&&(Ca=4194304),t}function cu(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Hl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ph(t,e,n,l,u,s){var r=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,b=t.expirationTimes,N=t.hiddenUpdates;for(n=r&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var zh=/[\n"\\]/g;function me(t){return t.replace(zh,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function gu(t,e,n,l,u,s,r,h){t.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.type=r:t.removeAttribute("type"),e!=null?r==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ge(e)):t.value!==""+ge(e)&&(t.value=""+ge(e)):r!=="submit"&&r!=="reset"||t.removeAttribute("value"),e!=null?mu(t,r,ge(e)):n!=null?mu(t,r,ge(n)):l!=null&&t.removeAttribute("value"),u==null&&s!=null&&(t.defaultChecked=!!s),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+ge(h):t.removeAttribute("name")}function uo(t,e,n,l,u,s,r,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){hu(t);return}n=n!=null?""+ge(n):"",e=e!=null?""+ge(e):n,h||e===t.value||(t.value=e),t.defaultValue=e}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=h?t.checked:!!l,t.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.name=r),hu(t)}function mu(t,e,n){e==="number"&&Ya(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Pn(t,e,n,l){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=!1;if(Ue)try{var Xl={};Object.defineProperty(Xl,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{Su=!1}var en=null,Tu=null,Xa=null;function go(){if(Xa)return Xa;var t,e=Tu,n=e.length,l,u="value"in en?en.value:en.textContent,s=u.length;for(t=0;t=Zl),So=" ",To=!1;function ko(t,e){switch(t){case"keyup":return Fh.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ll=!1;function Ph(t,e){switch(t){case"compositionend":return zo(e);case"keypress":return e.which!==32?null:(To=!0,So);case"textInput":return t=e.data,t===So&&To?null:t;default:return null}}function tg(t,e){if(ll)return t==="compositionend"||!Au&&ko(t,e)?(t=go(),Xa=Tu=en=null,ll=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Mo(n)}}function Ro(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ro(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function wo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ya(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ya(t.document)}return e}function ju(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var cg=Ue&&"documentMode"in document&&11>=document.documentMode,al=null,Du=null,Fl=null,Mu=!1;function Uo(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mu||al==null||al!==Ya(l)||(l=al,"selectionStart"in l&&ju(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Fl&&Wl(Fl,l)||(Fl=l,l=qi(Du,"onSelect"),0>=r,u-=r,je=1<<32-ae(e)+u|n<P?(it=L,L=null):it=L.sibling;var rt=A(k,L,E[P],D);if(rt===null){L===null&&(L=it);break}t&&L&&rt.alternate===null&&e(k,L),T=s(rt,T,P),ft===null?V=rt:ft.sibling=rt,ft=rt,L=it}if(P===E.length)return n(k,L),st&&qe(k,P),V;if(L===null){for(;PP?(it=L,L=null):it=L.sibling;var En=A(k,L,rt.value,D);if(En===null){L===null&&(L=it);break}t&&L&&En.alternate===null&&e(k,L),T=s(En,T,P),ft===null?V=En:ft.sibling=En,ft=En,L=it}if(rt.done)return n(k,L),st&&qe(k,P),V;if(L===null){for(;!rt.done;P++,rt=E.next())rt=_(k,rt.value,D),rt!==null&&(T=s(rt,T,P),ft===null?V=rt:ft.sibling=rt,ft=rt);return st&&qe(k,P),V}for(L=l(L);!rt.done;P++,rt=E.next())rt=O(L,k,P,rt.value,D),rt!==null&&(t&&rt.alternate!==null&&L.delete(rt.key===null?P:rt.key),T=s(rt,T,P),ft===null?V=rt:ft.sibling=rt,ft=rt);return t&&L.forEach(function(xm){return e(k,xm)}),st&&qe(k,P),V}function vt(k,T,E,D){if(typeof E=="object"&&E!==null&&E.type===G&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case C:t:{for(var V=E.key;T!==null;){if(T.key===V){if(V=E.type,V===G){if(T.tag===7){n(k,T.sibling),D=u(T,E.props.children),D.return=k,k=D;break t}}else if(T.elementType===V||typeof V=="object"&&V!==null&&V.$$typeof===jt&&Cn(V)===T.type){n(k,T.sibling),D=u(T,E.props),la(D,E),D.return=k,k=D;break t}n(k,T);break}else e(k,T);T=T.sibling}E.type===G?(D=Rn(E.props.children,k.mode,D,E.key),D.return=k,k=D):(D=ti(E.type,E.key,E.props,null,k.mode,D),la(D,E),D.return=k,k=D)}return r(k);case Y:t:{for(V=E.key;T!==null;){if(T.key===V)if(T.tag===4&&T.stateNode.containerInfo===E.containerInfo&&T.stateNode.implementation===E.implementation){n(k,T.sibling),D=u(T,E.children||[]),D.return=k,k=D;break t}else{n(k,T);break}else e(k,T);T=T.sibling}D=Cu(E,k.mode,D),D.return=k,k=D}return r(k);case jt:return E=Cn(E),vt(k,T,E,D)}if(he(E))return q(k,T,E,D);if(Ht(E)){if(V=Ht(E),typeof V!="function")throw Error(o(150));return E=V.call(E),X(k,T,E,D)}if(typeof E.then=="function")return vt(k,T,si(E),D);if(E.$$typeof===tt)return vt(k,T,li(k,E),D);ci(k,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,T!==null&&T.tag===6?(n(k,T.sibling),D=u(T,E),D.return=k,k=D):(n(k,T),D=qu(E,k.mode,D),D.return=k,k=D),r(k)):n(k,T)}return function(k,T,E,D){try{na=0;var V=vt(k,T,E,D);return ml=null,V}catch(L){if(L===gl||L===ii)throw L;var ft=ue(29,L,null,k.mode);return ft.lanes=D,ft.return=k,ft}}}var Hn=af(!0),uf=af(!1),sn=!1;function Wu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fu(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function on(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(dt&2)!==0){var u=l.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),l.pending=e,e=Pa(t),Yo(t,null,n),e}return Ia(t,l,e,n),Pa(t)}function aa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,$c(t,n)}}function Iu(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var u=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?u=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?u=s=e:s=s.next=e}else u=s=e;n={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Pu=!1;function ia(){if(Pu){var t=hl;if(t!==null)throw t}}function ua(t,e,n,l){Pu=!1;var u=t.updateQueue;sn=!1;var s=u.firstBaseUpdate,r=u.lastBaseUpdate,h=u.shared.pending;if(h!==null){u.shared.pending=null;var b=h,N=b.next;b.next=null,r===null?s=N:r.next=N,r=b;var x=t.alternate;x!==null&&(x=x.updateQueue,h=x.lastBaseUpdate,h!==r&&(h===null?x.firstBaseUpdate=N:h.next=N,x.lastBaseUpdate=b))}if(s!==null){var _=u.baseState;r=0,x=N=b=null,h=s;do{var A=h.lane&-536870913,O=A!==h.lane;if(O?(at&A)===A:(l&A)===A){A!==0&&A===dl&&(Pu=!0),x!==null&&(x=x.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var q=t,X=h;A=e;var vt=n;switch(X.tag){case 1:if(q=X.payload,typeof q=="function"){_=q.call(vt,_,A);break t}_=q;break t;case 3:q.flags=q.flags&-65537|128;case 0:if(q=X.payload,A=typeof q=="function"?q.call(vt,_,A):q,A==null)break t;_=j({},_,A);break t;case 2:sn=!0}}A=h.callback,A!==null&&(t.flags|=64,O&&(t.flags|=8192),O=u.callbacks,O===null?u.callbacks=[A]:O.push(A))}else O={lane:A,tag:h.tag,payload:h.payload,callback:h.callback,next:null},x===null?(N=x=O,b=_):x=x.next=O,r|=A;if(h=h.next,h===null){if(h=u.shared.pending,h===null)break;O=h,h=O.next,O.next=null,u.lastBaseUpdate=O,u.shared.pending=null}}while(!0);x===null&&(b=_),u.baseState=b,u.firstBaseUpdate=N,u.lastBaseUpdate=x,s===null&&(u.shared.lanes=0),gn|=r,t.lanes=r,t.memoizedState=_}}function sf(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function cf(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ts?s:8;var r=M.T,h={};M.T=h,vs(t,!1,e,n);try{var b=u(),N=M.S;if(N!==null&&N(h,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var x=pg(b,l);oa(t,e,x,re(t))}else oa(t,e,l,re(t))}catch(_){oa(t,e,{then:function(){},status:"rejected",reason:_},re())}finally{B.p=s,r!==null&&h.types!==null&&(r.types=h.types),M.T=r}}function zg(){}function ys(t,e,n,l){if(t.tag!==5)throw Error(o(476));var u=Hf(t).queue;Lf(t,u,e,Q,n===null?zg:function(){return Vf(t),n(l)})}function Hf(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:Q},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Vf(t){var e=Hf(t);e.next===null&&(e=t.alternate.memoizedState),oa(t,e.next.queue,{},re())}function ps(){return Gt(Aa)}function Yf(){return xt().memoizedState}function Gf(){return xt().memoizedState}function Eg(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=re();t=cn(n);var l=on(e,t,n);l!==null&&(ee(l,e,n),aa(l,e,n)),e={cache:Ku()},t.payload=e;return}e=e.return}}function Ng(t,e,n){var l=re();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},vi(t)?Qf(e,n):(n=Uu(t,e,n,l),n!==null&&(ee(n,t,l),Kf(n,e,l)))}function Xf(t,e,n){var l=re();oa(t,e,n,l)}function oa(t,e,n,l){var u={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(vi(t))Qf(e,u);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var r=e.lastRenderedState,h=s(r,n);if(u.hasEagerState=!0,u.eagerState=h,ie(h,r))return Ia(t,e,u,0),St===null&&Fa(),!1}catch{}if(n=Uu(t,e,u,l),n!==null)return ee(n,t,l),Kf(n,e,l),!0}return!1}function vs(t,e,n,l){if(l={lane:2,revertLane:Ws(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},vi(t)){if(e)throw Error(o(479))}else e=Uu(t,n,l,2),e!==null&&ee(e,t,2)}function vi(t){var e=t.alternate;return t===I||e!==null&&e===I}function Qf(t,e){pl=ri=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Kf(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,$c(t,n)}}var fa={readContext:Gt,use:gi,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};fa.useEffectEvent=Et;var Zf={readContext:Gt,use:gi,useCallback:function(t,e){return Zt().memoizedState=[t,e===void 0?null:e],t},useContext:Gt,useEffect:Df,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,yi(4194308,4,wf.bind(null,e,t),n)},useLayoutEffect:function(t,e){return yi(4194308,4,t,e)},useInsertionEffect:function(t,e){yi(4,2,t,e)},useMemo:function(t,e){var n=Zt();e=e===void 0?null:e;var l=t();if(Vn){Pe(!0);try{t()}finally{Pe(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=Zt();if(n!==void 0){var u=n(e);if(Vn){Pe(!0);try{n(e)}finally{Pe(!1)}}}else u=e;return l.memoizedState=l.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},l.queue=t,t=t.dispatch=Ng.bind(null,I,t),[l.memoizedState,t]},useRef:function(t){var e=Zt();return t={current:t},e.memoizedState=t},useState:function(t){t=rs(t);var e=t.queue,n=Xf.bind(null,I,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(t,e){var n=Zt();return ms(n,t,e)},useTransition:function(){var t=rs(!1);return t=Lf.bind(null,I,t.queue,!0,!1),Zt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=I,u=Zt();if(st){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),St===null)throw Error(o(349));(at&127)!==0||gf(l,e,n)}u.memoizedState=n;var s={value:n,getSnapshot:e};return u.queue=s,Df(yf.bind(null,l,s,t),[t]),l.flags|=2048,bl(9,{destroy:void 0},mf.bind(null,l,s,n,e),null),n},useId:function(){var t=Zt(),e=St.identifierPrefix;if(st){var n=De,l=je;n=(l&~(1<<32-ae(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=di++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(u,{is:l.is}):r.createElement(u)}}s[Vt]=e,s[$t]=l;t:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break t;for(;r.sibling===null;){if(r.return===null||r.return===e)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=s;t:switch(Qt(s,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&Ge(e)}}return kt(e),_s(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Ge(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(o(166));if(t=Ie.current,fl(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,u=Yt,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}t[Vt]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||dd(t.nodeValue,n)),t||an(e,!0)}else t=Ci(t).createTextNode(l),t[Vt]=e,e.stateNode=t}return kt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=fl(e),n!==null){if(t===null){if(!l)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Vt]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),t=!1}else n=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(ce(e),e):(ce(e),null);if((e.flags&128)!==0)throw Error(o(558))}return kt(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=fl(e),l!==null&&l.dehydrated!==null){if(t===null){if(!u)throw Error(o(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Vt]=e}else wn(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;kt(e),u=!1}else u=Yu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(ce(e),e):(ce(e),null)}return ce(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),zi(e,e.updateQueue),kt(e),null);case 4:return Zn(),t===null&&tc(e.stateNode.containerInfo),kt(e),null;case 10:return Le(e.type),kt(e),null;case 19:if(ct(Ot),l=e.memoizedState,l===null)return kt(e),null;if(u=(e.flags&128)!==0,s=l.rendering,s===null)if(u)da(l,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=fi(t),s!==null){for(e.flags|=128,da(l,!1),t=s.updateQueue,e.updateQueue=t,zi(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Go(n,t),n=n.sibling;return ot(Ot,Ot.current&1|2),st&&qe(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&ne()>xi&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304)}else{if(!u)if(t=fi(s),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,zi(e,t),da(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!st)return kt(e),null}else 2*ne()-l.renderingStartTime>xi&&n!==536870912&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304);l.isBackwards?(s.sibling=e.child,e.child=s):(t=l.last,t!==null?t.sibling=s:e.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ne(),t.sibling=null,n=Ot.current,ot(Ot,u?n&1|2:n&1),st&&qe(e,l.treeForkCount),t):(kt(e),null);case 22:case 23:return ce(e),es(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(kt(e),e.subtreeFlags&6&&(e.flags|=8192)):kt(e),n=e.updateQueue,n!==null&&zi(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&ct(qn),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Le(Mt),kt(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function Dg(t,e){switch(Hu(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Le(Mt),Zn(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return wa(e),null;case 31:if(e.memoizedState!==null){if(ce(e),e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ce(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));wn()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(Ot),null;case 4:return Zn(),null;case 10:return Le(e.type),null;case 22:case 23:return ce(e),es(),t!==null&&ct(qn),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Le(Mt),null;case 25:return null;default:return null}}function pr(t,e){switch(Hu(e),e.tag){case 3:Le(Mt),Zn();break;case 26:case 27:case 5:wa(e);break;case 4:Zn();break;case 31:e.memoizedState!==null&&ce(e);break;case 13:ce(e);break;case 19:ct(Ot);break;case 10:Le(e.type);break;case 22:case 23:ce(e),es(),t!==null&&ct(qn);break;case 24:Le(Mt)}}function ha(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var u=l.next;n=u;do{if((n.tag&t)===t){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==u)}}catch(h){mt(e,e.return,h)}}function dn(t,e,n){try{var l=e.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var s=u.next;l=s;do{if((l.tag&t)===t){var r=l.inst,h=r.destroy;if(h!==void 0){r.destroy=void 0,u=e;var b=n,N=h;try{N()}catch(x){mt(u,b,x)}}}l=l.next}while(l!==s)}}catch(x){mt(e,e.return,x)}}function vr(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{cf(e,n)}catch(l){mt(t,t.return,l)}}}function br(t,e,n){n.props=Yn(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){mt(t,e,l)}}function ga(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(u){mt(t,e,u)}}function Me(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(u){mt(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){mt(t,e,u)}else n.current=null}function Sr(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(u){mt(t,t.return,u)}}function Rs(t,e,n){try{var l=t.stateNode;Ig(l,t.type,n,e),l[$t]=e}catch(u){mt(t,t.return,u)}}function Tr(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bn(t.type)||t.tag===4}function ws(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Tr(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Us(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=we));else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Us(t,e,n),t=t.sibling;t!==null;)Us(t,e,n),t=t.sibling}function Ei(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ei(t,e,n),t=t.sibling;t!==null;)Ei(t,e,n),t=t.sibling}function kr(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);Qt(e,l,n),e[Vt]=t,e[$t]=n}catch(s){mt(t,t.return,s)}}var Xe=!1,wt=!1,Bs=!1,zr=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function Mg(t,e){if(t=t.containerInfo,lc=Qi,t=wo(t),ju(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var u=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var r=0,h=-1,b=-1,N=0,x=0,_=t,A=null;e:for(;;){for(var O;_!==n||u!==0&&_.nodeType!==3||(h=r+u),_!==s||l!==0&&_.nodeType!==3||(b=r+l),_.nodeType===3&&(r+=_.nodeValue.length),(O=_.firstChild)!==null;)A=_,_=O;for(;;){if(_===t)break e;if(A===n&&++N===u&&(h=r),A===s&&++x===l&&(b=r),(O=_.nextSibling)!==null)break;_=A,A=_.parentNode}_=O}n=h===-1||b===-1?null:{start:h,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(ac={focusedElem:t,selectionRange:n},Qi=!1,Lt=e;Lt!==null;)if(e=Lt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Lt=t;else for(;Lt!==null;){switch(e=Lt,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),Qt(s,l,n),s[Vt]=t,Ct(s),l=s;break t;case"link":var r=jd("link","href",u).get(l+(n.href||""));if(r){for(var h=0;hvt&&(r=vt,vt=X,X=r);var k=_o(h,X),T=_o(h,vt);if(k&&T&&(O.rangeCount!==1||O.anchorNode!==k.node||O.anchorOffset!==k.offset||O.focusNode!==T.node||O.focusOffset!==T.offset)){var E=_.createRange();E.setStart(k.node,k.offset),O.removeAllRanges(),X>vt?(O.addRange(E),O.extend(T.node,T.offset)):(E.setEnd(T.node,T.offset),O.addRange(E))}}}}for(_=[],O=h;O=O.parentNode;)O.nodeType===1&&_.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<_.length;h++){var D=_[h];D.element.scrollLeft=D.left,D.element.scrollTop=D.top}}Qi=!!lc,ac=lc=null}finally{dt=u,B.p=l,M.T=n}}t.current=e,Ut=2}}function Wr(){if(Ut===2){Ut=0;var t=yn,e=El,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=M.T,M.T=null;var l=B.p;B.p=2;var u=dt;dt|=4;try{Er(t,e.alternate,e)}finally{dt=u,B.p=l,M.T=n}}Ut=3}}function Fr(){if(Ut===4||Ut===3){Ut=0,ch();var t=yn,e=El,n=$e,l=qr;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?Ut=5:(Ut=0,El=yn=null,Ir(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(mn=null),fu(n),e=e.stateNode,le&&typeof le.onCommitFiberRoot=="function")try{le.onCommitFiberRoot(Cl,e,void 0,(e.current.flags&128)===128)}catch{}if(l!==null){e=M.T,u=B.p,B.p=2,M.T=null;try{for(var s=t.onRecoverableError,r=0;rn?32:n,M.T=null,n=Gs,Gs=null;var s=yn,r=$e;if(Ut=0,El=yn=null,$e=0,(dt&6)!==0)throw Error(o(331));var h=dt;if(dt|=4,wr(s.current),Mr(s,s.current,r,n),dt=h,Sa(0,!1),le&&typeof le.onPostCommitFiberRoot=="function")try{le.onPostCommitFiberRoot(Cl,s)}catch{}return!0}finally{B.p=u,M.T=l,Ir(t,e)}}function td(t,e,n){e=pe(n,e),e=ks(t.stateNode,e,2),t=on(t,e,2),t!==null&&(Hl(t,2),_e(t))}function mt(t,e,n){if(t.tag===3)td(t,t,n);else for(;e!==null;){if(e.tag===3){td(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(mn===null||!mn.has(l))){t=pe(n,t),n=er(2),l=on(e,n,2),l!==null&&(nr(n,l,e,t),Hl(l,2),_e(l));break}}e=e.return}}function Zs(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new wg;var u=new Set;l.set(e,u)}else u=l.get(e),u===void 0&&(u=new Set,l.set(e,u));u.has(n)||(Ls=!0,u.add(n),t=Lg.bind(null,t,e,n),e.then(t,t))}function Lg(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,St===t&&(at&n)===n&&(Nt===4||Nt===3&&(at&62914560)===at&&300>ne()-Oi?(dt&2)===0&&Nl(t,0):Hs|=n,zl===at&&(zl=0)),_e(t)}function ed(t,e){e===0&&(e=Zc()),t=_n(t,e),t!==null&&(Hl(t,e),_e(t))}function Hg(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),ed(t,n)}function Vg(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(e),ed(t,n)}function Yg(t,e){return uu(t,e)}var wi=null,Ol=null,Js=!1,Ui=!1,$s=!1,vn=0;function _e(t){t!==Ol&&t.next===null&&(Ol===null?wi=Ol=t:Ol=Ol.next=t),Ui=!0,Js||(Js=!0,Xg())}function Sa(t,e){if(!$s&&Ui){$s=!0;do for(var n=!1,l=wi;l!==null;){if(t!==0){var u=l.pendingLanes;if(u===0)var s=0;else{var r=l.suspendedLanes,h=l.pingedLanes;s=(1<<31-ae(42|t)+1)-1,s&=u&~(r&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,id(l,s))}else s=at,s=La(l,l===St?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Ll(l,s)||(n=!0,id(l,s));l=l.next}while(n);$s=!1}}function Gg(){nd()}function nd(){Ui=Js=!1;var t=0;vn!==0&&tm()&&(t=vn);for(var e=ne(),n=null,l=wi;l!==null;){var u=l.next,s=ld(l,e);s===0?(l.next=null,n===null?wi=u:n.next=u,u===null&&(Ol=n)):(n=l,(t!==0||(s&3)!==0)&&(Ui=!0)),l=u}Ut!==0&&Ut!==5||Sa(t),vn!==0&&(vn=0)}function ld(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,u=t.expirationTimes,s=t.pendingLanes&-62914561;0h)break;var x=b.transferSize,_=b.initiatorType;x&&hd(_)&&(b=b.responseEnd,r+=x*(b"u"?null:document;function Nd(t,e,n){var l=xl;if(l&&typeof e=="string"&&e){var u=me(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Ed.has(u)||(Ed.add(u),t={rel:t,crossOrigin:n,href:e},l.querySelector(u)===null&&(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function om(t){We.D(t),Nd("dns-prefetch",t,null)}function fm(t,e){We.C(t,e),Nd("preconnect",t,e)}function rm(t,e,n){We.L(t,e,n);var l=xl;if(l&&t&&e){var u='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+me(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+me(n.imageSizes)+'"]')):u+='[href="'+me(t)+'"]';var s=u;switch(e){case"style":s=jl(t);break;case"script":s=Dl(t)}ze.has(s)||(t=j({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),ze.set(s,t),l.querySelector(u)!==null||e==="style"&&l.querySelector(Ea(s))||e==="script"&&l.querySelector(Na(s))||(e=l.createElement("link"),Qt(e,"link",t),Ct(e),l.head.appendChild(e)))}}function dm(t,e){We.m(t,e);var n=xl;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+me(l)+'"][href="'+me(t)+'"]',s=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Dl(t)}if(!ze.has(s)&&(t=j({rel:"modulepreload",href:t},e),ze.set(s,t),n.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Na(s)))return}l=n.createElement("link"),Qt(l,"link",t),Ct(l),n.head.appendChild(l)}}}function hm(t,e,n){We.S(t,e,n);var l=xl;if(l&&t){var u=Fn(l).hoistableStyles,s=jl(t);e=e||"default";var r=u.get(s);if(!r){var h={loading:0,preload:null};if(r=l.querySelector(Ea(s)))h.loading=5;else{t=j({rel:"stylesheet",href:t,"data-precedence":e},n),(n=ze.get(s))&&rc(t,n);var b=r=l.createElement("link");Ct(b),Qt(b,"link",t),b._p=new Promise(function(N,x){b.onload=N,b.onerror=x}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Hi(r,e,l)}r={type:"stylesheet",instance:r,count:1,state:h},u.set(s,r)}}}function gm(t,e){We.X(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function mm(t,e){We.M(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=j({src:t,async:!0,type:"module"},e),(e=ze.get(u))&&dc(t,e),s=n.createElement("script"),Ct(s),Qt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function Ad(t,e,n,l){var u=(u=Ie.current)?Li(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=jl(n.href),n=Fn(u).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=jl(n.href);var s=Fn(u).hoistableStyles,r=s.get(t);if(r||(u=u.ownerDocument||u,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,r),(s=u.querySelector(Ea(t)))&&!s._p&&(r.instance=s,r.state.loading=5),ze.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ze.set(t,n),s||ym(u,t,n,r.state))),e&&l===null)throw Error(o(528,""));return r}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Dl(n),n=Fn(u).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function jl(t){return'href="'+me(t)+'"'}function Ea(t){return'link[rel="stylesheet"]['+t+"]"}function Od(t){return j({},t,{"data-precedence":t.precedence,precedence:null})}function ym(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),Qt(e,"link",n),Ct(e),t.head.appendChild(e))}function Dl(t){return'[src="'+me(t)+'"]'}function Na(t){return"script[async]"+t}function xd(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+me(n.href)+'"]');if(l)return e.instance=l,Ct(l),l;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ct(l),Qt(l,"style",u),Hi(l,n.precedence,t),e.instance=l;case"stylesheet":u=jl(n.href);var s=t.querySelector(Ea(u));if(s)return e.state.loading|=4,e.instance=s,Ct(s),s;l=Od(n),(u=ze.get(u))&&rc(l,u),s=(t.ownerDocument||t).createElement("link"),Ct(s);var r=s;return r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),e.state.loading|=4,Hi(s,n.precedence,t),e.instance=s;case"script":return s=Dl(n.src),(u=t.querySelector(Na(s)))?(e.instance=u,Ct(u),u):(l=n,(u=ze.get(s))&&(l=j({},n),dc(l,u)),t=t.ownerDocument||t,u=t.createElement("script"),Ct(u),Qt(u,"link",l),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,Hi(l,n.precedence,t));return e.instance}function Hi(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,s=u,r=0;r title"):null)}function pm(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Md(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function vm(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=jl(l.href),s=e.querySelector(Ea(u));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Yi.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,Ct(s);return}s=e.ownerDocument||e,l=Od(l),(u=ze.get(u))&&rc(l,u),s=s.createElement("link"),Ct(s);var r=s;r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Qt(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Yi.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var hc=0;function bm(t,e){return t.stylesheets&&t.count===0&&Xi(t,t.stylesheets),0hc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Yi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xi(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Gi=null;function Xi(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gi=new Map,e.forEach(Sm,t),Gi=null,Yi.call(t))}function Sm(t,e){if(!(e.state.loading&4)){var n=Gi.get(t);if(n)var l=n.get(null);else{n=new Map,Gi.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y)}catch(a){console.error(a)}}return y(),Sc.exports=Gm(),Sc.exports}var Qm=Xm();class Km extends W{constructor(){super("avalanche.operator.Empty",[])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poszc},{no:6,name:"run_id",kind:"scalar",T:9},{no:7,name:"workflow_selector",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.flowName="",i.inputJson="",i.contextJson="",i.inputFiles=[],i.runId="",i.workflowSelector="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:3,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.agentMetadataJson={},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:5,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"cron",kind:"scalar",T:9},{no:8,name:"next_run_at",kind:"scalar",T:1},{no:9,name:"last_run_at",kind:"scalar",T:1},{no:10,name:"workflow_id",kind:"scalar",T:9},{no:11,name:"display_name",kind:"scalar",T:9},{no:12,name:"root_alias",kind:"scalar",T:9},{no:13,name:"relative_file",kind:"scalar",T:9},{no:14,name:"builder_symbol",kind:"scalar",T:9},{no:15,name:"agent_node_ids",kind:"scalar",repeat:2,T:9},{no:16,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:17,name:"webhook_path",kind:"scalar",T:9},{no:18,name:"webhook_url",kind:"scalar",T:9},{no:19,name:"webhook_active",kind:"scalar",T:8}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.name="",i.filePath="",i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.cron="",i.nextRunAt=0,i.lastRunAt=0,i.workflowId="",i.displayName="",i.rootAlias="",i.relativeFile="",i.builderSymbol="",i.agentNodeIds=[],i.agentMetadataJson={},i.webhookPath="",i.webhookUrl="",i.webhookActive=!1,a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posEc},{no:5,name:"scan_targets",kind:"message",repeat:2,T:()=>Ac},{no:6,name:"diagnostics",kind:"message",repeat:2,T:()=>Nc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.revision="0",i.workflows=[],i.scanTargets=[],i.diagnostics=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posOc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.valueJson="",i.files=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posxc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.status="",i.revision="0",i.available=!1,i.complete=!1,i.eventCount="0",i.sizeBytes="0",i.latestEventSequence="0",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl},{no:8,name:"revision",kind:"scalar",T:4},{no:9,name:"event_page_token",kind:"scalar",T:9},{no:10,name:"error",kind:"scalar",opt:!0,T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeId="",i.name="",i.nodeType="",i.status="",i.startedAt=0,i.endedAt=0,i.revision="0",i.eventPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:5,name:"latest_log_sequence",kind:"scalar",T:4},{no:6,name:"log_page_token",kind:"scalar",T:9},{no:7,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.nodes=[],i.latestLogSequence="0",i.logPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.logs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql},{no:6,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runId="",i.nodeId="",i.events=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:2,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:3,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodes=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posPi}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posjc},{no:3,name:"run_status_changed",kind:"message",oneof:"change",T:()=>Dc},{no:4,name:"node_status_changed",kind:"message",oneof:"change",T:()=>Mc},{no:5,name:"log_appended",kind:"message",oneof:"change",T:()=>_c},{no:6,name:"agent_event_appended",kind:"message",oneof:"change",T:()=>Rc},{no:7,name:"trace_finalized",kind:"message",oneof:"change",T:()=>wc},{no:8,name:"catalog_replaced",kind:"message",oneof:"change",T:()=>Uc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.sequence="0",i.change={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBc},{no:3,name:"reset_required",kind:"message",oneof:"payload",T:()=>qc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.payload={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posawait this.client.getRunSnapshot({runId:g.runId,operatorInstanceId:f,asOfSequence:c}).response)),d=await this.getCatalog();if(a.operatorInstanceId!==f||d.operatorInstanceId!==f||a.revision!==d.revision||BigInt(a.asOfSequence)>BigInt(c)||BigInt(d.asOfSequence)d.nodeId===i);if(!o?.eventPageToken)return[];const f=[];let c=o.eventPageToken,v="0";do{const d=await this.client.listAgentEvents({pageToken:c,afterEventSequence:v,pageSize:100}).response;f.push(...d.events),d.events.length&&(v=d.events.at(-1).eventSequence),c=d.nextPageToken}while(c);return f}async listLogs(a){if(!a.logPageToken)return[];const i=[];let o=a.logPageToken,f="0";do{const c=await this.client.listLogs({pageToken:o,afterSequence:f,pageSize:100}).response;i.push(...c.logs),c.logs.length&&(f=c.logs.at(-1).sequence),o=c.nextPageToken}while(o);return i}async readDetail(a){const i=[];for await(const v of this.client.readDetail({bodyToken:a}).responses)i.push(v.data);const o=i.reduce((v,d)=>v+d.length,0),f=new Uint8Array(o);let c=0;for(const v of i)f.set(v,c),c+=v.length;return JSON.parse(new TextDecoder().decode(f))}async startRun(a,i){return(await this.client.startRun({flowName:"",workflowSelector:a,runId:"",inputJson:i===void 0?"":JSON.stringify(i),contextJson:"",inputFiles:[]}).response).runId}async cancelRun(a){await this.client.cancelRun({runId:a}).response}}function np(y){return y==="success"?"✓":y==="failed"?"!":y==="running"?"●":"·"}function lp({workflow:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState(!0);return p.jsxs("div",{className:"workflow-branch",children:[p.jsxs("div",{className:"tree-row",children:[p.jsx("button",{type:"button",className:"tree-disclosure",onClick:()=>c(v=>!v),"aria-label":`${f?"Collapse":"Expand"} ${y.displayName}`,children:f?"⌄":"›"}),p.jsxs("button",{type:"button",className:i?.kind==="workflow"&&i.workflowId===y.workflowId?"tree-select active":"tree-select",onClick:()=>o({kind:"workflow",workflowId:y.workflowId}),children:[p.jsx("span",{className:"workflow-glyph",children:"◇"}),p.jsxs("span",{children:[p.jsx("strong",{children:y.displayName}),p.jsx("small",{children:y.relativeFile})]})]})]}),f&&p.jsxs("div",{className:"run-branches",children:[a.map(v=>{const d=v.summary;return p.jsxs("button",{type:"button",className:i?.kind==="run"&&i.runId===d.runId?"run-select active":"run-select",onClick:()=>o({kind:"run",workflowId:y.workflowId,runId:d.runId}),children:[p.jsx("span",{className:`run-dot status-${d.status}`,children:np(d.status)}),p.jsxs("span",{children:[p.jsx("strong",{children:d.runId}),p.jsx("small",{children:d.startedAt?`Created at sequence ${d.createdSequence}`:"Awaiting start"})]})]},d.runId)}),!a.length&&p.jsx("span",{className:"no-runs",children:"No runs yet"})]})]})}function ap(y,a){return y.workflows.filter(i=>i.rootAlias===a.alias)}function ip({catalog:y,runs:a,selection:i,onSelect:o}){const[f,c]=J.useState({});if(!y)return p.jsxs("aside",{className:"explorer skeleton","aria-label":"Explorer",children:[p.jsx("div",{}),p.jsx("div",{}),p.jsx("div",{})]});const v=y.scanTargets.length?y.scanTargets:[{alias:"workflows",targetPath:"Configured workflows",kind:"directory"}];return p.jsxs("aside",{className:"explorer","aria-label":"Explorer",children:[p.jsxs("header",{children:[p.jsx("span",{className:"eyebrow",children:"Navigator"}),p.jsx("h2",{children:"Explorer"}),p.jsxs("span",{className:"catalog-revision",children:["catalog r",y.revision]})]}),y.diagnostics.length>0&&p.jsxs("details",{className:"diagnostics",open:!0,children:[p.jsxs("summary",{children:[y.diagnostics.length," reload issue",y.diagnostics.length===1?"":"s"]}),y.diagnostics.map(d=>p.jsxs("div",{children:[p.jsx("strong",{children:d.kind.replaceAll("_"," ")}),p.jsx("span",{children:d.path}),p.jsx("p",{children:d.message})]},`${d.path}-${d.kind}`))]}),p.jsx("div",{className:"target-list",children:v.map(d=>{const g=d.alias==="workflows"?y.workflows:ap(y,d),m=!!f[d.alias];return p.jsxs("section",{className:"target",children:[p.jsxs("button",{type:"button",className:"target-heading",onClick:()=>c(z=>{const j={...z};return j[d.alias]?delete j[d.alias]:j[d.alias]=!0,j}),children:[p.jsx("span",{children:m?"›":"⌄"}),p.jsx("span",{className:"target-kind",children:d.kind==="file"?"F":"D"}),p.jsxs("span",{children:[p.jsx("strong",{children:d.alias}),p.jsx("small",{title:d.targetPath,children:d.targetPath})]})]}),!m&&p.jsx("div",{className:"workflow-list",children:g.map(z=>p.jsx(lp,{workflow:z,runs:Object.values(a).filter(j=>j.summary?.workflowId===z.workflowId).sort((j,R)=>Number(R.summary.createdSequence)-Number(j.summary.createdSequence)),selection:i,onSelect:o},z.workflowId))})]},d.alias)})})]})}function Kn(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function Id(y){return Array.isArray(y)?y.flatMap(a=>!Kn(a)||typeof a.name!="string"?[]:[{name:a.name,type:typeof a.type=="string"?a.type:void 0,description:typeof a.description=="string"?a.description:void 0}]):[]}function eh(y){if(y)try{const a=JSON.parse(y);if(!Kn(a))return;const i=Kn(a.signature)?a.signature:{};return{instructions:typeof i.instructions=="string"?i.instructions:"",inputs:Id(i.inputs),outputs:Id(i.outputs),model:a.models,runtime:a.runtime,skills:a.skills,tools:a.tools}}catch{return}}const nh=J.memo(({data:y})=>p.jsxs("button",{type:"button",className:`node-card ${y.status?`status-${y.status}`:"blueprint"}`,onClick:y.onOpen,"aria-label":`Inspect ${y.label}`,children:[p.jsx(Qd,{type:"target",position:Kd.Left,isConnectable:!1}),p.jsx("span",{className:"node-kicker",children:y.nodeType}),p.jsx("strong",{children:y.label}),y.status&&p.jsx("span",{className:"node-status",children:y.status}),y.duration&&p.jsx("span",{className:"node-duration",children:y.duration}),y.error&&p.jsx("span",{className:"node-error",children:y.error}),y.declaration&&p.jsxs("span",{className:"field-grid",children:[p.jsxs("span",{children:[p.jsx("small",{children:"Inputs"}),y.declaration.inputs.map(a=>p.jsx("span",{className:"field",children:a.name},`input-${a.name}`))]}),p.jsxs("span",{children:[p.jsx("small",{children:"Outputs"}),y.declaration.outputs.map(a=>p.jsx("span",{className:"field",children:a.name},`output-${a.name}`))]})]}),p.jsx(Qd,{type:"source",position:Kd.Right,isConnectable:!1})]}));nh.displayName="WorkflowNodeCard";function up(y){const a=Object.fromEntries(y.nodeIds.map(c=>[c,0]));for(const c of Object.values(y.graph))for(const v of c.children)a[v]=(a[v]??0)+1;const i={},o=y.nodeIds.filter(c=>a[c]===0);for(const c of o)i[c]=0;for(let c=0;cv.map((d,g)=>[d,{x:Number(c)*330,y:g*220-(v.length-1)*110}])))}function sp(y){if(!y.startedAt)return;const a=y.endedAt||Date.now()/1e3,i=Math.max(0,a-y.startedAt);return i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m`}function cp({workflow:y,runTopology:a,runNodes:i=[],onOpenNode:o}){const f=J.useMemo(()=>{if(a)return a;if(y)return{nodeIds:y.nodeIds,graph:y.graph,nodeTypes:y.nodeTypes,displayNames:y.displayNames,agentMetadataJson:y.agentMetadataJson}},[a,y]),c=J.useMemo(()=>{if(!f)return{nodes:[],edges:[]};const v=up(f),d=Object.fromEntries(i.map(j=>[j.nodeId,j])),g=f.nodeIds.map(j=>{const R=d[j];return{id:j,type:"workflow",position:v[j],data:{label:f.displayNames[j]||R?.name||j,nodeType:f.nodeTypes[j]||R?.nodeType||"step",status:R?.status,error:R?.error,duration:R?sp(R):void 0,declaration:eh(a?a.agentMetadataJson[j]:y?.agentMetadataJson[j]),onOpen:()=>o(j)}}}),m=new Set,z=[];for(const[j,R]of Object.entries(f.graph))for(const C of R.children){const Y=`${j}->${C}`;m.has(Y)||(m.add(Y),z.push({id:Y,source:j,target:C,markerEnd:{type:Mm.ArrowClosed},className:"dag-edge"}))}return{nodes:g,edges:z}},[o,i,a,f,y]);return p.jsxs(_m,{nodes:c.nodes,edges:c.edges,nodeTypes:{workflow:nh},fitView:!0,fitViewOptions:{padding:.24},minZoom:.25,maxZoom:1.8,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[p.jsx(Rm,{color:"rgba(255,255,255,.06)",gap:24,size:1}),p.jsx(wm,{showInteractive:!1})]})}function op(y,a,i){const o=new Array(y);return new Proxy(o,{get(f,c,v){if(typeof c=="string"){const d=c.charCodeAt(0);if(d>=48&&d<=57){const g=+c;if(Number.isInteger(g)&&g>=0&&go[z]!==m))&&(o=d,f=a(...d),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(f),c=!1),f}return v.updateDeps=d=>{o=d},v}function Pd(y,a){if(y===void 0)throw new Error("Unexpected undefined");return y}const fp=(y,a)=>Math.abs(y-a)<1.01,rp=(y,a,i)=>{let o;return function(...f){y.clearTimeout(o),o=y.setTimeout(()=>a.apply(this,f),i)}};let Ma;const Lc=()=>{if(Ma!==void 0)return Ma;if(typeof navigator>"u")return Ma=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ma=!0;const y=navigator.maxTouchPoints;return Ma=navigator.platform==="MacIntel"&&y!==void 0&&y>0},th=y=>{const{offsetWidth:a,offsetHeight:i}=y;return{width:a,height:i}},dp=y=>y,hp=y=>{const a=Math.max(y.startIndex-y.overscan,0),o=Math.min(y.endIndex+y.overscan,y.count-1)-a+1,f=new Array(o);for(let c=0;c{const i=y.scrollElement;if(!i)return;const o=y.targetWindow;if(!o)return;const f=v=>{const{width:d,height:g}=v;a({width:Math.round(d),height:Math.round(g)})};if(f(th(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(v=>{const d=()=>{const g=v[0];if(g?.borderBoxSize){const m=g.borderBoxSize[0];if(m){f({width:m.inlineSize,height:m.blockSize});return}}f(th(i))};y.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},tu={passive:!0},mp=typeof window>"u"?!0:"onscrollend"in window,yp=(y,a,i)=>{const o=y.scrollElement;if(!o)return;const f=y.targetWindow;if(!f)return;const c=y.options.useScrollendEvent&∓let v=0;const d=c?null:rp(f,()=>a(v,!1),y.options.isScrollingResetDelay),g=j=>()=>{v=i(o),d?.(),a(v,j)},m=g(!0),z=g(!1);return o.addEventListener("scroll",m,tu),c&&o.addEventListener("scrollend",z,tu),()=>{o.removeEventListener("scroll",m),c&&o.removeEventListener("scrollend",z)}},pp=(y,a)=>yp(y,a,i=>{const{horizontal:o,isRtl:f}=y.options;return o?i.scrollLeft*(f&&-1||1):i.scrollTop}),vp=(y,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(y),f=i.options.getItemKey(o);return i.itemSizeCache.get(f)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(y),f=i.options.getItemKey(o),c=i.itemSizeCache.get(f);if(c!==void 0)return c}return y[i.options.horizontal?"offsetWidth":"offsetHeight"]},bp=(y,{adjustments:a=0,behavior:i},o)=>{var f,c;(c=(f=o.scrollElement)==null?void 0:f.scrollTo)==null||c.call(f,{[o.options.horizontal?"left":"top"]:y+a,behavior:i})},Sp=bp;class Tp{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,f;return((f=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:f.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(f=>{f.forEach(c=>{const v=()=>{const d=c.target,g=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,z]of this.elementsCache)if(z===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(d,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(v):v()})}));return{disconnect:()=>{var f;(f=o())==null||f.disconnect(),i=null},observe:f=>{var c;return(c=o())==null?void 0:c.observe(f,{box:"border-box"})},unobserve:f=>{var c;return(c=o())==null?void 0:c.unobserve(f)}}})(),this.range=null,this.setOptions=i=>{var o,f;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:dp,rangeExtractor:hp,onChange:()=>{},measureElement:vp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const R in i){const C=i[R];C!==void 0&&(c[R]=C)}const v=this.options;let d=null,g=null,m=!1;if(v!==void 0&&v.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const R=v.count,C=c.count,Y=this.getMeasurements(),G=R>0?((o=Y[0])==null?void 0:o.key)??v.getItemKey(0):null,ut=R>0?((f=Y[R-1])==null?void 0:f.key)??v.getItemKey(R-1):null;if(C!==R||R>0&&C>0&&(c.getItemKey(0)!==G||c.getItemKey(C-1)!==ut)){m=!0;const tt=R>0?this.getVirtualItemForOffset(this.getScrollOffset())??Y[0]:null;tt&&(d=[tt.key,this.getScrollOffset()-tt.start]);const ht=c.followOnAppend===!0?"auto":c.followOnAppend||null;ht&&C>R&&this.isAtEnd(v.scrollEndThreshold)&&(R===0||c.getItemKey(C-1)!==ut)&&(g=ht)}}this.options=c,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let z=!1,j=0;if(d&&this.scrollOffset!==null){const[R,C]=d,Y=this.getMeasurements(),{count:G,getItemKey:ut}=this.options;let K=0;for(;K{var o,f;(f=(o=this.options).onChange)==null||f.call(o,this,i)},this.maybeNotify=_l(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,v)=>{if(v&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=v?d===c?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Lc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",v,tu),c.addEventListener("touchend",d,tu),this.unsubs.push(()=>{c.removeEventListener("touchstart",v),c.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const f=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,f&&this.scrollElement&&this.options.enabled){const[c,v,d,g]=f;c!==null&&!d&&(Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?g!==0&&(this._iosDeferredAdjustment+=g):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const f=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=f,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=_l(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,f,c,v,d,g,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m}),{key:!1}),this.getMeasurements=_l(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:m},z)=>{const j=this.itemSizeCache;if(!v)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const K of this.laneAssignments.keys())K>=i&&this.laneAssignments.delete(K);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(K=>{this.itemSizeCache.set(K.key,K.size)}));const R=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),d===1){const K=i*2;let Z=this._flatMeasurements;if(!Z||Z.length0&<.set(Z.subarray(0,R*2)),Z=lt,this._flatMeasurements=Z}let tt;if(R===0)tt=o+f;else{const lt=R-1;tt=Z[lt*2]+Z[lt*2+1]+m}for(let lt=R;lt1){ht=tt;const Kt=Y[ht],At=Kt!==void 0?C[Kt]:void 0;lt=At?At.end+m:o+f}else if(ut===d){let Kt=0,At=G[0],Ht=Y[0];for(let Jt=1;Jtthis.options.debug}),this.calculateRange=_l(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,f,c)=>i.length===0||o===0?(this.range=null,null):(this.range=zp(i,o,f,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=_l(()=>{let i=null,o=null;const f=this.calculateRange();return f&&(i=f.startIndex,o=f.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,f,c,v)=>c===null||v===null?[]:i({startIndex:c,endIndex:v,overscan:o,count:f}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,f=i.getAttribute(o);return f?parseInt(f,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const f=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(f!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),v=Math.max(0,f-c),d=Math.min(this.options.count-1,f+c);return i>=v&&i<=d}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((v,d)=>{v.isConnected||(this.observer.unobserve(v),this.elementsCache.delete(d))});return}const o=this.indexFromElement(i),f=this.options.getItemKey(o),c=this.elementsCache.get(f);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(f,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var f,c;if(i<0||i>=this.options.count)return;let v,d,g;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)g=this.options.getItemKey(i),d=m[i*2],v=m[i*2+1];else{const R=this.measurementsCache[i];if(!R)return;g=R.key,d=R.start,v=R.size}const z=this.itemSizeCache.get(g)??v,j=o-z;if(j!==0){const R=this.options.anchorTo==="end"&&((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,C=R?this.getTotalSize():0,Y=this.getScrollOffset()+this.scrollAdjustments,ut=!this.itemSizeCache.has(g)?d[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const f=[];for(let c=0,v=i.length;cthis.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const f=this._flatMeasurements,c=this.options.lanes===1&&f!=null,v=lh(0,o.length-1,c?d=>f[d*2]:d=>Pd(o[d]).start,i);return Pd(o[v])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,f=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),v=this.getScrollOffset();o==="auto"&&(o=i>=v+c?"end":"start"),o==="center"?i+=(f-c)/2:o==="end"&&(i-=c);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const f=this.getSize(),c=this.getScrollOffset(),v=this.measurementsCache[i];if(!v)return;if(o==="auto")if(v.end>=c+f-this.options.scrollPaddingEnd)o="end";else if(v.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?v.end+this.options.scrollPaddingEnd:v.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,v.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),v=this.now();this.scrollState={index:null,align:o,behavior:f,startedAt:v,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[v,d]=c,g=this.now();this.scrollState={index:i,align:d,behavior:f,startedAt:g,lastTargetOffset:v,stableFrames:0},this._scrollToOffset(v,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const f=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let f;if(o.length===0)f=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,v=this._flatMeasurements;v!=null?f=v[c*2]+v[c*2+1]:f=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let v=o.length-1;for(;v>=0&&c.some(d=>d===null);){const d=o[v];c[d.lane]===null&&(c[d.lane]=d.end),v--}f=Math.max(...c.filter(d=>d!==null))}return Math.max(f-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const f of o)f&&this.itemSizeCache.has(f.key)&&i.push({index:f.index,key:f.key,start:f.start,size:f.size,end:f.end,lane:f.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:f})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:f,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Lc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,f=o?o[0]:this.scrollState.lastTargetOffset,c=1,v=f!==this.scrollState.lastTargetOffset;if(!v&&fp(f,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==f&&this._scrollToOffset(f,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,v){const d=this.getSize()||600,g=Math.abs(f-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&g>d;this.scrollState.lastTargetOffset=f,m||(this.scrollState.behavior="auto"),this._scrollToOffset(f,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const lh=(y,a,i,o)=>{for(;y<=a;){const f=(y+a)/2|0,c=i(f);if(co)a=f-1;else return f}return y>0?y-1:0};function kp(y,a,i){let o=0;for(;o<=a;){const f=(o+a)/2|0,c=y[f*2];if(ci)a=f-1;else return f}return o>0?o-1:0}function zp(y,a,i,o,f){const c=y.length-1;if(y.length<=o)return{startIndex:0,endIndex:c};if(o===1&&f!==null){const m=kp(f,c,i);let z=m;const j=i+a;for(;zy[m].start,i),g=d;if(o===1)for(;g1){const m=Array(o).fill(0);for(;gj=0&&z.some(j=>j>=i);){const j=y[d];z[j.lane]=j.start,d--}d=Math.max(0,d-d%o),g=Math.min(c,g+(o-1-g%o))}return{startIndex:d,endIndex:g}}const Hc=typeof document<"u"?J.useLayoutEffect:J.useEffect;function Ep({useFlushSync:y=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const f=J.useReducer(z=>z+1,0)[1],c=J.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const v=z=>{const j=c.current;if(!j.enabled||!j.container)return;const R=z.getTotalSize();if(R!==j.lastSize){j.lastSize=R;const C=z.options.horizontal?"width":"height";j.container.style[C]=`${R}px`}},d=z=>{const j=c.current;if(!j.enabled||!j.container)return;v(z);const R=!!z.options.horizontal,C=j.mode==="transform",Y=R?"left":"top",G=z.options.scrollMargin,ut=z.getVirtualItems();for(const K of ut){const Z=K.start-G,tt=z.elementsCache.get(K.key);tt&&j.lastPositions.get(tt)!==Z&&(j.lastPositions.set(tt,Z),C?tt.style.transform=R?`translate3d(${Z}px, 0, 0)`:`translate3d(0, ${Z}px, 0)`:tt.style[Y]=`${Z}px`)}},g={...o,onChange:(z,j)=>{var R;const C=c.current;let Y=!0;if(C.enabled){d(z);const G=z.range,ut=C.prevRange;Y=!ut||ut.isScrolling!==z.isScrolling||ut.startIndex!==G?.startIndex||ut.endIndex!==G?.endIndex,Y&&(C.prevRange=G?{startIndex:G.startIndex,endIndex:G.endIndex,isScrolling:z.isScrolling}:null)}Y&&(y&&j?Um.flushSync(f):f()),(R=o.onChange)==null||R.call(o,z,j)}},[m]=J.useState(()=>{const z=new Tp(g);return Object.assign(z,{containerRef:j=>{const R=c.current;if(R.container=j,R.lastSize=null,j&&R.enabled){const C=z.getTotalSize();R.lastSize=C;const Y=z.options.horizontal?"width":"height";j.style[Y]=`${C}px`}}})});return m.setOptions(g),Hc(()=>m._didMount(),[]),Hc(()=>(v(m),m._willUpdate())),Hc(()=>{d(m)}),m}function Np(y){return Ep({observeElementRect:gp,observeElementOffset:pp,scrollToFn:Sp,...y})}function Qn({value:y,depth:a=0}){return y===null?p.jsx("span",{className:"value-null",children:"null"}):typeof y=="string"?p.jsx("span",{className:"value-string",children:y}):typeof y=="number"||typeof y=="boolean"?p.jsx("span",{className:"value-scalar",children:String(y)}):Array.isArray(y)?p.jsx("ol",{className:"value-list",children:y.map((i,o)=>p.jsx("li",{children:p.jsx(Qn,{value:i,depth:a+1})},`${a}-${o}`))}):Kn(y)?y.kind==="predict_rlm_file"&&typeof y.path=="string"?p.jsxs("span",{className:"file-value",title:"Reported host path; contents are not copied",children:[p.jsx("span",{"aria-hidden":"true",children:"↗"}),p.jsxs("span",{children:[p.jsx("small",{children:"PredictRLM file"}),p.jsx("code",{children:y.path})]})]}):y.kind==="unavailable"&&typeof y.reason=="string"?p.jsxs("span",{className:"value-unavailable",children:["Unavailable · ",y.reason]}):p.jsx("dl",{className:"value-object",children:Object.entries(y).map(([i,o])=>p.jsxs("div",{children:[p.jsx("dt",{children:i}),p.jsx("dd",{children:p.jsx(Qn,{value:o,depth:a+1})})]},i))}):p.jsx("span",{className:"value-unavailable",children:"Unavailable"})}const Ap=[],Op=[];function Vc({value:y}){return p.jsx("pre",{className:"json-block",children:JSON.stringify(y,null,2)})}function xp(y){if(Kn(y))return Kn(y.data)?y.data:y}function jp({api:y,workflow:a,run:i,nodeId:o,liveEvents:f=Ap,liveLogs:c=Op,onClose:v}){const[d,g]=J.useState("overview"),[m,z]=J.useState([]),[j,R]=J.useState([]),[C,Y]=J.useState(),[G,ut]=J.useState(),[K,Z]=J.useState(),[tt,ht]=J.useState(!0),lt=J.useRef(new Map),Bt=J.useRef(null),$=i?.nodes.find(w=>w.nodeId===o),jt=i?i.topology?.agentMetadataJson[o??""]:a?.agentMetadataJson[o??""],Dt=jt?eh(jt):void 0;J.useEffect(()=>{if(g("overview"),z([]),R([]),Y(void 0),ut(void 0),ht(!0),lt.current.clear(),!i||!o)return;let w=!0;return Promise.all([y.listAgentEvents(i,o),y.listLogs(i)]).then(([H,bt])=>{w&&(z(H),R(bt.filter(ct=>!ct.nodeId||ct.nodeId===o)))}).catch(H=>{w&&Z(H instanceof Error?H.message:"Details unavailable")}),()=>{w=!1}},[y,o,i]);const Kt=J.useMemo(()=>{const w=new Map;for(const H of[...m,...f])w.set(H.eventSequence,H);return[...w.values()].sort((H,bt)=>Number(H.eventSequence)-Number(bt.eventSequence))},[m,f]),At=Kt.filter(w=>w.eventKind==="iteration.recorded"),Ht=J.useMemo(()=>{const w=new Map;for(const H of[...j,...c])w.set(H.sequence,H);return[...w.values()].sort((H,bt)=>Number(H.sequence)-Number(bt.sequence))},[c,j]),Jt=J.useMemo(()=>{const w=$?.trace?.header?.usageJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.usageJson]),de=J.useMemo(()=>{const w=$?.trace?.header?.telemetryJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.telemetryJson]),he=d==="inputs"?Dt?.inputs:d==="output"?Dt?.outputs:void 0,M=Np({count:At.length,getScrollElement:()=>Bt.current,estimateSize:()=>64,overscan:6});if(J.useEffect(()=>{!tt||!At.length||Y(At.at(-1).eventSequence)},[tt,At]),J.useEffect(()=>{const w=Kt.find(ct=>ct.eventSequence===C);if(!w?.bodyToken){ut(void 0);return}const H=lt.current.get(w.bodyToken);if(H!==void 0){lt.current.delete(w.bodyToken),lt.current.set(w.bodyToken,H),ut(H);return}let bt=!0;return ut(void 0),Z(void 0),y.readDetail(w.bodyToken).then(ct=>{if(bt){for(lt.current.delete(w.bodyToken),lt.current.set(w.bodyToken,ct);lt.current.size>8;){const ot=lt.current.keys().next().value;if(ot===void 0)break;lt.current.delete(ot)}ut(ct)}}).catch(ct=>{bt&&Z(ct instanceof Error?ct.message:"Detail unavailable")}),()=>{bt=!1}},[y,Kt,C]),J.useEffect(()=>{const w=d==="inputs"?"run.started":d==="output"?"run.succeeded":void 0;if(!w)return;const H=[...Kt].reverse().find(bt=>bt.eventKind===w);H&&Y(H.eventSequence)},[Kt,d]),!i&&a&&o)return p.jsxs("aside",{className:"inspector","aria-label":"Node declaration",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Declaration"}),p.jsx("h2",{children:a.displayNames[o]||o})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),Dt?p.jsxs("div",{className:"inspector-body declaration",children:[p.jsxs("section",{children:[p.jsx("h3",{children:"Instructions"}),p.jsx("p",{className:"instructions",children:Dt.instructions||"No instructions"})]}),p.jsxs("section",{className:"signature-columns",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"Inputs"}),Dt.inputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]}),p.jsxs("div",{children:[p.jsx("h3",{children:"Outputs"}),Dt.outputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Runtime"}),p.jsx(Vc,{value:Dt.runtime})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Models"}),p.jsx(Vc,{value:Dt.model})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Skills & tools"}),p.jsx(Vc,{value:{skills:Dt.skills,tools:Dt.tools}})]})]}):p.jsx("p",{className:"empty-copy",children:"This node has no agent declaration metadata."})]});if(!i||!$)return null;const B=xp(G),Q=d==="inputs"?"inputs":"outputs";return p.jsxs("aside",{className:"inspector","aria-label":"Run inspector",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Historical execution"}),p.jsx("h2",{children:$.name}),p.jsx("span",{className:`status-pill status-${$.status}`,children:$.status})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),p.jsx("nav",{className:"inspector-tabs","aria-label":"Run detail views",children:["overview","inputs","output","trace","logs"].map(w=>p.jsx("button",{type:"button",className:d===w?"active":"",onClick:()=>g(w),children:w},w))}),p.jsxs("div",{className:"inspector-body",children:[K&&p.jsx("p",{className:"error-banner",children:K}),d==="overview"&&p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:"metric-grid",children:[p.jsxs("div",{children:[p.jsx("small",{children:"Status"}),p.jsx("strong",{children:$.status})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Revision"}),p.jsx("strong",{children:$.revision})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Started"}),p.jsx("strong",{children:$.startedAt?"yes":"—"})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Duration"}),p.jsx("strong",{children:$.startedAt&&$.endedAt?`${Math.max(0,$.endedAt-$.startedAt).toFixed(2)}s`:"—"})]})]}),$.error&&p.jsx("p",{className:"node-failure",children:$.error}),$.trace&&p.jsxs("section",{children:[p.jsx("h3",{children:"Trace header"}),p.jsxs("dl",{className:"trace-header",children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Status"}),p.jsx("dd",{children:$.trace.status})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Events"}),p.jsx("dd",{children:$.trace.eventCount})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Size"}),p.jsxs("dd",{children:[$.trace.sizeBytes," B"]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Complete"}),p.jsx("dd",{children:$.trace.complete?"yes":"no"})]}),$.trace.header&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Model"}),p.jsx("dd",{children:$.trace.header.model})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Iterations"}),p.jsxs("dd",{children:[$.trace.header.iterations,"/",$.trace.header.maxIterations]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Duration"}),p.jsxs("dd",{children:[$.trace.header.durationMs," ms"]})]})]})]}),Jt!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Usage"}),p.jsx(Qn,{value:Jt})]}),de!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Telemetry"}),p.jsx(Qn,{value:de})]})]})]}),(d==="inputs"||d==="output")&&p.jsxs("section",{children:[p.jsx("h3",{children:d==="inputs"?"Invocation inputs":"Terminal output"}),he?.length?p.jsxs("div",{className:"declared-fields",children:[p.jsx("small",{children:"Declared fields"}),he.map(w=>p.jsxs("span",{children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type})]},w.name))]}):null,B&&Q in B?p.jsx(Qn,{value:B[Q]}):p.jsxs("p",{className:"empty-copy",children:["No retained ",d," are available."]})]}),d==="trace"&&p.jsxs("section",{className:"trace-layout",children:[p.jsxs("div",{className:"trace-toolbar",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"RunTrace"}),p.jsxs("span",{children:[At.length," complete turns"]})]}),p.jsx("button",{type:"button",className:tt?"toggle active":"toggle",onClick:()=>ht(w=>!w),children:tt?"Following live":"Follow latest"})]}),p.jsx("div",{className:"turn-list",ref:Bt,children:p.jsx("div",{style:{height:M.getTotalSize(),position:"relative"},children:M.getVirtualItems().map(w=>{const H=At[w.index];return p.jsxs("button",{type:"button",className:`turn-row ${C===H.eventSequence?"active":""} ${H.error?"failed":""}`,style:{transform:`translateY(${w.start}px)`},onClick:()=>{ht(!1),Y(H.eventSequence)},children:[p.jsxs("strong",{children:["Turn ",H.iteration??w.index+1]}),p.jsx("span",{children:H.durationMs?`${H.durationMs} ms`:"—"}),p.jsxs("small",{children:[H.toolCount," tools · ",H.predictCount," predicts"]})]},H.eventSequence)})})}),p.jsx("div",{className:"turn-detail",children:G!==void 0?p.jsx(Qn,{value:G}):p.jsx("p",{className:"empty-copy",children:"Select a turn."})})]}),d==="logs"&&p.jsxs("section",{children:[p.jsx("h3",{children:"Node logs"}),p.jsx("div",{className:"log-list",children:Ht.map(w=>p.jsxs("button",{type:"button",onClick:()=>{y.readDetail(w.bodyToken).then(ut).catch(H=>{Z(H instanceof Error?H.message:"Log unavailable")})},children:[p.jsx("span",{className:`log-level level-${w.level}`,children:w.level}),p.jsx("time",{children:new Date(w.timestamp*1e3).toLocaleTimeString()}),p.jsxs("span",{children:["#",w.sequence]})]},w.sequence))}),G!==void 0&&p.jsx(Qn,{value:G})]})]})]})}function Dp({value:y,onChange:a}){const i=J.useRef(null);return J.useEffect(()=>{if(!i.current)return;const o=new Ii({parent:i.current,state:Cm.create({doc:y,extensions:[Lm(),Hm.of([]),Ii.lineWrapping,Ii.theme({"&":{backgroundColor:"#ffffff",color:"#17211c"},".cm-content":{caretColor:"#2563eb",minHeight:"110px"},".cm-gutters":{backgroundColor:"#f6f8f7",color:"#7b8680",border:"0"},"&.cm-focused":{outline:"1px solid #9bb6f5"}}),Ii.updateListener.of(f=>{f.docChanged&&a(f.state.doc.toString())})]})});return()=>o.destroy()},[]),p.jsx("div",{className:"json-editor",ref:i})}function Mp(y){const a=JSON.parse(y);if(!Kn(a))throw new Error("Run input must be a JSON object");return a}function _p({workflow:y,run:a,pending:i,onStart:o,onCancel:f}){const[c,v]=J.useState(!1),[d,g]=J.useState("{}"),[m,z]=J.useState(),j=a?.summary?.status==="pending"||a?.summary?.status==="running",R=async()=>{if(!y)return;z(void 0);let C;if(c)try{C=Mp(d)}catch(Y){z(Y instanceof Error?Y.message:"Run input is invalid JSON");return}try{await o(y.workflowId,C)}catch(Y){z(Y instanceof Error?Y.message:"Operator rejected the run")}};return p.jsxs("div",{className:"run-controls",children:[y&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"run-button",disabled:i?.kind==="start",onClick:()=>{R()},children:i?.kind==="start"?"Requesting…":"Run"}),p.jsx("button",{type:"button",className:`input-toggle ${c?"active":""}`,onClick:()=>v(C=>!C),children:c?"Hide JSON input":"Add JSON input"})]}),j&&a?.summary&&p.jsx("button",{type:"button",className:"cancel-button",disabled:i?.kind==="cancel",onClick:()=>{z(void 0),f(a.summary.runId).catch(C=>{z(C instanceof Error?C.message:"Cancellation failed")})},children:i?.kind==="cancel"?"Cancelling…":"Cancel run"}),c&&y&&p.jsxs("div",{className:"input-popover",children:[p.jsxs("div",{children:[p.jsx("strong",{children:"Workflow input"}),p.jsx("span",{children:"Schema-blind JSON object"})]}),p.jsx(Dp,{value:d,onChange:g})]}),m&&p.jsx("div",{className:"action-error",children:m})]})}const ah={runs:{},liveEvents:{},liveLogs:{},operatorInstanceId:"",sequence:"0",connection:"connecting"};function Rp(y,a){if(a.type==="baseline"){const g=Object.fromEntries(a.baseline.runs.filter(m=>m.summary).map(m=>[m.summary.runId,m]));return{...ah,catalog:a.baseline.catalog,runs:g,operatorInstanceId:a.baseline.catalog.operatorInstanceId,sequence:a.baseline.asOfSequence,connection:"live"}}if(a.type==="connection")return{...y,connection:a.connection,error:a.error};if(a.type==="action")return{...y,action:a.action};const{envelope:i}=a;if(i.operatorInstanceId!==y.operatorInstanceId)throw new Error("Operator epoch changed");if(i.payload.oneofKind!=="update")throw new Error("Operator requested a structural reset");const o=i.payload.update;if(BigInt(o.sequence)!==BigInt(y.sequence)+1n)throw new Error(`Operator update gap after sequence ${y.sequence}`);const f={...y,sequence:o.sequence,error:void 0},c=o.change;if(c.oneofKind==="catalogReplaced")return c.catalogReplaced.catalog&&(f.catalog=c.catalogReplaced.catalog),f;if(c.oneofKind==="runCreated"&&c.runCreated.summary){const g=c.runCreated.summary;return f.runs={...y.runs,[g.runId]:{operatorInstanceId:y.operatorInstanceId,asOfSequence:o.sequence,summary:g,nodes:c.runCreated.nodes,latestLogSequence:"0",logPageToken:"",topology:c.runCreated.topology}},f}const v=c.oneofKind==="runStatusChanged"?c.runStatusChanged.runId:c.oneofKind==="nodeStatusChanged"?c.nodeStatusChanged.runId:c.oneofKind==="logAppended"?c.logAppended.runId:c.oneofKind==="agentEventAppended"?c.agentEventAppended.runId:c.oneofKind==="traceFinalized"?c.traceFinalized.runId:"",d=y.runs[v];if(!d)throw new Error(`Operator update referenced unknown run ${v}`);if(c.oneofKind==="runStatusChanged"&&d.summary)f.runs={...y.runs,[v]:{...d,summary:{...d.summary,status:c.runStatusChanged.status,startedAt:c.runStatusChanged.startedAt,endedAt:c.runStatusChanged.endedAt,revision:c.runStatusChanged.revision}}};else if(c.oneofKind==="nodeStatusChanged"){const g=c.nodeStatusChanged;f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(m=>m.nodeId===g.nodeId?{...m,status:g.status,startedAt:g.startedAt,endedAt:g.endedAt,revision:g.revision,error:g.error}:m)}}}else if(c.oneofKind==="logAppended"&&c.logAppended.log)f.liveLogs={...y.liveLogs,[v]:[...y.liveLogs[v]??[],c.logAppended.log]};else if(c.oneofKind==="agentEventAppended"&&c.agentEventAppended.event){const g=`${v}:${c.agentEventAppended.nodeId}`;f.liveEvents={...y.liveEvents,[g]:[...y.liveEvents[g]??[],c.agentEventAppended.event]}}else c.oneofKind==="traceFinalized"&&c.traceFinalized.trace&&(f.runs={...y.runs,[v]:{...d,nodes:d.nodes.map(g=>g.nodeId===c.traceFinalized.nodeId?{...g,trace:c.traceFinalized.trace}:g)}});return f}function wp(y){const[a,i]=J.useReducer(Rp,ah),o=J.useRef(0),f=J.useCallback(async()=>{const d=await y.loadBaseline();return i({type:"baseline",baseline:d}),d},[y]);J.useEffect(()=>{const d=++o.current;let g=!1;return(async()=>{let z=250;for(;!g&&o.current===d;)try{i({type:"connection",connection:"connecting"});const j=await y.loadBaseline();if(g)return;i({type:"baseline",baseline:j}),z=250;let R=j.asOfSequence;for await(const C of y.streamUpdates(j.catalog.operatorInstanceId,R)){if(g)return;if(C.payload.oneofKind!=="update"||BigInt(C.payload.update.sequence)!==BigInt(R)+1n)break;i({type:"envelope",envelope:C}),R=C.payload.update.sequence}i({type:"connection",connection:"reconnecting"})}catch(j){if(g)return;i({type:"connection",connection:"reconnecting",error:j instanceof Error?j.message:"Operator connection failed"});const{promise:R,resolve:C}=Promise.withResolvers();window.setTimeout(C,z),await R,z=Math.min(z*2,4e3)}})(),()=>{g=!0,o.current+=1}},[y]);const c=J.useCallback(async(d,g)=>{i({type:"action",action:{kind:"start",target:d}});try{return await y.startRun(d,g)}finally{i({type:"action",action:void 0})}},[y]),v=J.useCallback(async d=>{i({type:"action",action:{kind:"cancel",target:d}});try{await y.cancelRun(d)}finally{i({type:"action",action:void 0})}},[y]);return{state:a,reconcile:f,startRun:c,cancelRun:v}}function Up({api:y}){const{state:a,startRun:i,cancelRun:o}=wp(y),[f,c]=J.useState(),[v,d]=J.useState();J.useEffect(()=>{const G=a.catalog?.workflows??[];if(!G.length){c(void 0);return}if(!f){c({kind:"workflow",workflowId:G[0].workflowId});return}G.some(ut=>ut.workflowId===f.workflowId)||c({kind:"workflow",workflowId:G[0].workflowId})},[f,a.catalog]);const g=a.catalog?.workflows.find(G=>G.workflowId===f?.workflowId),m=f?.kind==="run"?a.runs[f.runId]:void 0,z=J.useMemo(()=>Object.values(a.runs).filter(G=>G.summary?.workflowId===g?.workflowId).sort((G,ut)=>Number(ut.summary.createdSequence)-Number(G.summary.createdSequence))[0],[a.runs,g?.workflowId]),j=J.useCallback(G=>d(G),[]),R=J.useCallback(G=>{c(G),d(void 0)},[]),C=m??(f?.kind==="workflow"?z:void 0),Y=m&&v?`${m.summary?.runId}:${v}`:"";return p.jsxs("div",{className:"app-shell",children:[p.jsxs("header",{className:"topbar",children:[p.jsxs("div",{className:"brand",children:[p.jsx("span",{className:"brand-mark","aria-hidden":"true",children:"A"}),p.jsxs("div",{children:[p.jsx("strong",{children:"Avalanche"}),p.jsx("span",{children:"Operator"})]})]}),p.jsxs("div",{className:"breadcrumb",children:[p.jsx("span",{children:g?.rootAlias||"Local operator"}),g&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:g.displayName})]}),m?.summary&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:m.summary.runId})]})]}),p.jsxs("div",{className:`connection connection-${a.connection}`,children:[p.jsx("span",{}),a.connection==="live"?"Live":a.connection,p.jsxs("small",{children:["seq ",a.sequence]})]})]}),a.error&&p.jsx("div",{className:"connection-error",children:a.error}),p.jsxs("main",{className:`workspace ${v?"with-inspector":""}`,children:[p.jsx(ip,{catalog:a.catalog,runs:a.runs,selection:f,onSelect:R}),p.jsxs("section",{className:"canvas-shell",children:[p.jsxs("header",{className:"view-header",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:m?"Historical run":"Current definition"}),p.jsx("h1",{children:m?.summary?.runId||g?.displayName||"Operator"}),p.jsx("p",{children:m?`Recorded topology · ${m.summary?.status??"unknown"}`:g?`${g.nodeIds.length} nodes · ${g.relativeFile}`:"Waiting for a workflow catalog"})]}),p.jsx(_p,{workflow:m?void 0:g,run:m??C,pending:a.action,onStart:i,onCancel:o})]}),p.jsxs("div",{className:m?"canvas run-canvas":"canvas blueprint-canvas",children:[g||m?.topology?p.jsx(cp,{workflow:m?void 0:g,runTopology:m?.topology,runNodes:m?.nodes,onOpenNode:j}):p.jsxs("div",{className:"empty-state",children:[p.jsx("span",{children:"◇"}),p.jsx("h2",{children:"No workflows discovered"}),p.jsx("p",{children:"Catalog changes will appear here as the operator scans configured targets."})]}),m&&p.jsxs("div",{className:"historical-badge",children:[p.jsx("span",{children:"Immutable run snapshot"}),"Current workflow changes do not alter this canvas"]})]})]}),v&&p.jsx(jp,{api:y,workflow:g,run:m,nodeId:v,liveEvents:a.liveEvents[Y],liveLogs:m?.summary?a.liveLogs[m.summary.runId]:void 0,onClose:()=>d(void 0)})]})]})}const ih=document.getElementById("root");if(!ih)throw new Error("Operator UI root element is missing");Qm.createRoot(ih).render(p.jsx(J.StrictMode,{children:p.jsx(Up,{api:new ep})})); diff --git a/src/runtime/operator/web_assets/assets/index-BNQSyDYz.css b/src/runtime/operator/web_assets/assets/index-bpf7CcuO.css similarity index 75% rename from src/runtime/operator/web_assets/assets/index-BNQSyDYz.css rename to src/runtime/operator/web_assets/assets/index-bpf7CcuO.css index 212bf12..63cf600 100644 --- a/src/runtime/operator/web_assets/assets/index-BNQSyDYz.css +++ b/src/runtime/operator/web_assets/assets/index-bpf7CcuO.css @@ -1 +1 @@ -.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}:root{color:#17211c;background:#f6f8f7;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-synthesis:none;--panel: #ffffff;--panel-raised: #ffffff;--line: #dfe4e1;--muted: #68746e;--acid: #2563eb;--mint: #16805d;--amber: #a15c00;--red: #c43d36}*{box-sizing:border-box}html,body,#root{width:100%;height:100%;margin:0;overflow:hidden}button,input{font:inherit}button{color:inherit}code,pre,.eyebrow,small{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.app-shell{height:100%;display:grid;grid-template-rows:58px auto 1fr}.topbar{display:grid;grid-template-columns:260px 1fr auto;align-items:center;padding:0 20px;border-bottom:1px solid var(--line);background:#fff;z-index:10;box-shadow:0 1px 2px #141f1a0a}.brand{display:flex;align-items:center;gap:11px}.brand-mark{width:30px;height:30px;display:grid;place-items:center;color:#fff;background:var(--acid);font-weight:750;border-radius:8px}.brand div{display:flex;align-items:baseline;gap:7px}.brand strong{font-size:15px;letter-spacing:-.02em}.brand span:last-child{color:var(--muted);font:11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase}.breadcrumb{display:flex;justify-content:center;gap:9px;color:var(--muted);font-size:12px}.breadcrumb i{opacity:.4}.breadcrumb strong{color:#26322c;font-weight:600}.connection{display:flex;align-items:center;gap:8px;font:11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:capitalize}.connection>span{width:7px;height:7px;border-radius:50%;background:var(--amber)}.connection-live>span{background:var(--mint)}.connection small{color:#87918c;margin-left:5px}.connection-error,.action-error,.error-banner{background:#fff1f0;color:#9d2923;padding:8px 18px;font-size:12px;border-bottom:1px solid #efb9b5}.workspace{min-height:0;display:grid;grid-template-columns:280px minmax(0,1fr)}.workspace.with-inspector{grid-template-columns:280px minmax(0,1fr) 410px}.explorer{background:var(--panel);border-right:1px solid var(--line);overflow:auto;min-width:0}.explorer>header{padding:22px 18px 14px;position:relative}.eyebrow{display:block;color:var(--acid);font-size:9px;letter-spacing:.16em;text-transform:uppercase}h1,h2,h3,p{margin-top:0}.explorer h2{margin:5px 0 0;font-size:17px}.catalog-revision{position:absolute;right:18px;bottom:17px;color:#7b8680;font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.target-list{padding:4px 10px 30px}.target{border-top:1px solid var(--line);padding-top:7px;margin-top:4px}.target-heading,.tree-row,.tree-select,.run-select{width:100%;min-width:0}.target-heading,.tree-select,.run-select,.tree-disclosure{background:none;border:0;cursor:pointer;text-align:left}.target-heading{display:grid;grid-template-columns:12px 22px minmax(0,1fr);gap:5px;align-items:center;padding:8px 5px}.target-heading>span:first-child{color:#7a8580}.target-kind{width:20px;height:20px;border:1px solid #cbd2ce;border-radius:5px;display:grid;place-items:center;font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#55615b;background:#f7f9f8}.target-heading strong,.target-heading small,.tree-select strong,.tree-select small,.run-select strong,.run-select small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.target-heading strong{font-size:11px;font-weight:600}.target-heading small{color:#7b8680;font-size:8px;margin-top:2px}.workflow-list{border-left:1px solid #e2e7e4;margin-left:16px;padding-left:7px}.tree-row{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:stretch}.tree-disclosure{color:#75807b;text-align:center;padding:0}.tree-select{display:grid;grid-template-columns:23px minmax(0,1fr);gap:4px;padding:8px;border-radius:7px}.tree-select:hover,.run-select:hover,.tree-select.active,.run-select.active{background:#f1f4f2}.tree-select.active{box-shadow:inset 2px 0 var(--acid)}.workflow-glyph{color:var(--acid);font-size:16px}.tree-select strong{font-size:11px;font-weight:600}.tree-select small,.run-select small{color:#7b8680;font-size:8px;margin-top:3px}.run-branches{margin-left:28px;border-left:1px dashed #d9dfdc;padding:3px 0 6px 8px}.run-select{display:grid;grid-template-columns:20px minmax(0,1fr);gap:5px;align-items:center;padding:7px;border-radius:7px}.run-select strong{font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.run-dot{width:16px;height:16px;border-radius:50%;display:grid;place-items:center;font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#eef2f0;color:var(--muted)}.run-dot.status-success{color:var(--mint)}.run-dot.status-failed{color:var(--red)}.run-dot.status-running{color:var(--acid)}.no-runs{display:block;color:#8a948f;padding:7px;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.diagnostics{margin:0 12px 12px;padding:9px;background:#fff8eb;border:1px solid #ead1a2;border-radius:8px;font-size:10px}.diagnostics summary{color:var(--amber);cursor:pointer}.diagnostics div{margin-top:9px;border-top:1px solid #ead1a2;padding-top:8px}.diagnostics strong,.diagnostics span{display:block}.diagnostics span{color:#8b7655;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow:hidden;text-overflow:ellipsis}.diagnostics p{color:#735b37;margin:4px 0 0}.skeleton{padding:20px}.skeleton div{height:38px;background:#edf1ef;margin-bottom:9px;border-radius:7px;animation:pulse 1.2s infinite alternate}@keyframes pulse{to{opacity:.45}}.canvas-shell{min-width:0;min-height:0;display:grid;grid-template-rows:auto 1fr;background:#f7f9f8}.view-header{min-height:92px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 24px;border-bottom:1px solid var(--line)}.view-header h1{margin:4px 0 2px;font-size:22px;letter-spacing:-.035em}.view-header p{margin:0;color:var(--muted);font-size:11px}.canvas{position:relative;min-height:0}.blueprint-canvas{background:radial-gradient(circle,#dce3df 1px,transparent 1px),#f7f9f8;background-size:24px 24px}.run-canvas{background:radial-gradient(circle,#e1e4df 1px,transparent 1px),#fafaf8;background-size:24px 24px}.react-flow__controls{background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 14px #141f1a14;overflow:hidden}.react-flow__controls-button{background:#fff;border-bottom-color:var(--line);fill:#55615b}.react-flow__controls-button:hover{background:#f1f4f2}.react-flow__edge-path{stroke:#87938d;stroke-width:1.4}.react-flow__arrowhead polyline{stroke:#87938d;fill:#87938d}.node-card{width:248px;min-height:102px;position:relative;display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:15px;text-align:left;background:#fff;border:1px solid #d3dad6;border-radius:10px;box-shadow:0 8px 24px #19272014;cursor:pointer}.node-card:hover{border-color:var(--acid);transform:translateY(-1px);box-shadow:0 10px 28px #1927201f}.node-card.blueprint{background:#fff}.node-card strong{font-size:13px}.node-kicker{color:#77827c;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.12em;text-transform:uppercase}.node-status{position:absolute;right:12px;top:12px;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;color:var(--muted)}.node-duration{color:var(--muted);font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.node-error{color:#9d2923;background:#fff1f0;padding:5px;border-radius:5px;font-size:9px;max-height:42px;overflow:hidden}.node-card.status-success{border-color:#7ebda4}.node-card.status-failed{border-color:#df8d87}.node-card.status-running{border-color:#7ca2f6;box-shadow:0 0 0 2px #2563eb14,0 8px 24px #19272014}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:4px;border-top:1px solid var(--line);padding-top:8px}.field-grid>span{min-width:0}.field-grid small{display:block;color:#78837d;font-size:7px;text-transform:uppercase;margin-bottom:3px}.field{display:block;color:#36423c;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow:hidden;text-overflow:ellipsis}.react-flow__handle{width:7px;height:7px;background:var(--acid);border:1px solid #ffffff}.historical-badge{position:absolute;right:18px;bottom:18px;z-index:5;padding:9px 12px;background:#fffcf5f5;border:1px solid #dfc99e;color:#766548;font-size:9px;border-radius:8px;box-shadow:0 4px 14px #362c1914}.historical-badge span{display:block;color:var(--amber);font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;margin-bottom:3px}.empty-state{height:100%;display:grid;place-content:center;text-align:center;color:#6d7872}.empty-state>span{color:var(--acid);font-size:40px}.empty-state h2{color:#27332d;margin:8px 0}.empty-state p{max-width:390px;font-size:12px}.inspector{min-width:0;background:var(--panel-raised);border-left:1px solid var(--line);overflow:hidden;display:grid;grid-template-rows:auto auto 1fr}.inspector>header{display:flex;justify-content:space-between;align-items:start;padding:19px 20px 14px;border-bottom:1px solid var(--line)}.inspector h2{margin:4px 0 5px;font-size:18px}.icon-button{width:30px;height:30px;background:#fff;border:1px solid var(--line);border-radius:7px;cursor:pointer;font-size:19px}.icon-button:hover{border-color:#9da7a2;background:#f7f9f8}.status-pill{display:inline-flex;padding:3px 7px;border:1px solid #cbd2ce;border-radius:20px;color:var(--muted);font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;background:#f7f9f8}.status-pill.status-failed{color:var(--red);border-color:#e5aaa5;background:#fff5f4}.status-pill.status-success{color:var(--mint);border-color:#a6d1c0;background:#f2fbf7}.inspector-tabs{display:flex;overflow-x:auto;padding:0 10px;border-bottom:1px solid var(--line)}.inspector-tabs button{padding:11px 9px 9px;background:none;border:0;border-bottom:2px solid transparent;color:#6e7973;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;cursor:pointer}.inspector-tabs button.active{color:var(--acid);border-bottom-color:var(--acid)}.inspector-body{overflow:auto;padding:18px 20px 30px}.inspector-body section{margin-bottom:23px}.inspector-body h3{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#56615b}.instructions{color:#36423c;white-space:pre-wrap;font-size:12px;line-height:1.65}.signature-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px}.field-detail{border-top:1px solid var(--line);padding:8px 0}.field-detail strong,.field-detail code{display:block;font-size:10px}.field-detail code{color:#68746e;font-size:8px;margin-top:2px}.field-detail p{color:#737e78;font-size:9px;margin:4px 0 0}.declared-fields{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:10px}.declared-fields>small{width:100%;color:#717c76;font-size:8px;text-transform:uppercase}.declared-fields>span{display:inline-flex;gap:5px;padding:4px 6px;border:1px solid var(--line);background:#f7f9f8;border-radius:5px;font-size:9px}.declared-fields code{color:#5d6963}.json-block{padding:11px;background:#f6f8f7;border:1px solid var(--line);border-radius:7px;overflow:auto;color:#35413b;font-size:9px;white-space:pre-wrap}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.metric-grid>div{background:#f7f9f8;border:1px solid var(--line);border-radius:7px;padding:10px}.metric-grid small,.metric-grid strong{display:block}.metric-grid small{color:#717c76;font-size:7px;text-transform:uppercase}.metric-grid strong{margin-top:5px;font-size:11px}.node-failure{padding:10px;background:#fff1f0;border:1px solid #efb9b5;border-radius:7px;color:#9d2923;font-size:10px}.trace-header,.value-object{margin:0}.trace-header>div,.value-object>div{display:grid;grid-template-columns:105px minmax(0,1fr);gap:10px;border-top:1px solid var(--line);padding:7px 0}.trace-header dt,.value-object dt{color:#6f7a74;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.trace-header dd,.value-object dd{margin:0;font-size:10px;min-width:0}.empty-copy{color:#76817b;font-size:11px}.trace-layout{display:grid;grid-template-rows:auto 220px auto;gap:12px}.trace-toolbar{display:flex;justify-content:space-between;align-items:center}.trace-toolbar h3{margin:0 0 3px}.trace-toolbar span{color:#717c76;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.toggle{background:#fff;border:1px solid #cbd2ce;color:#647069;border-radius:20px;padding:5px 8px;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}.toggle.active{color:var(--acid);border-color:#9bb6f5;background:#f4f7ff}.turn-list{height:220px;overflow:auto;border:1px solid var(--line);background:#fff;border-radius:7px}.turn-row{position:absolute;left:0;top:0;width:100%;height:60px;display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px;background:transparent;border:0;border-bottom:1px solid var(--line);text-align:left;cursor:pointer}.turn-row:hover,.turn-row.active{background:#f1f4f2}.turn-row.active{box-shadow:inset 2px 0 var(--acid)}.turn-row.failed{box-shadow:inset 2px 0 var(--red)}.turn-row strong{font-size:10px}.turn-row span,.turn-row small{color:#748079;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.turn-row small{grid-column:1 / -1}.turn-detail{border-top:1px solid var(--line);padding-top:12px}.value-object .value-object{border-left:1px solid #dfe4e1;padding-left:8px}.value-string{color:#42722d;white-space:pre-wrap;overflow-wrap:anywhere}.value-scalar{color:#16697a}.value-null{color:#76817b}.value-unavailable{color:var(--amber);font-size:9px}.value-list{margin:0;padding-left:20px}.value-list li{margin:5px 0}.file-value{display:flex;gap:9px;padding:9px;border:1px solid #c3d2f5;background:#f5f8ff;border-radius:7px;color:#1d4ed8}.file-value small,.file-value code{display:block}.file-value small{color:#687aa2;font-size:7px;text-transform:uppercase}.file-value code{margin-top:3px;font-size:9px;overflow-wrap:anywhere}.log-list{margin-bottom:12px}.log-list button{width:100%;display:grid;grid-template-columns:48px 1fr auto;gap:7px;padding:7px 4px;border:0;border-bottom:1px solid var(--line);background:none;color:#59655f;text-align:left;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}.log-list button:hover{background:#f1f4f2}.log-level{text-transform:uppercase}.level-error{color:var(--red)}.level-warning{color:var(--amber)}.run-controls{display:flex;align-items:center;gap:7px;position:relative}.run-button,.cancel-button,.input-toggle{border-radius:7px;padding:8px 13px;cursor:pointer;font-size:10px}.run-button{background:var(--acid);border:1px solid var(--acid);color:#fff;font-weight:700}.run-button:hover{background:#1d4ed8;border-color:#1d4ed8}.cancel-button{background:#fff;border:1px solid #e0a6a1;color:#a92f29}.cancel-button:hover{background:#fff3f2}.input-toggle{background:#fff;border:1px solid #cbd2ce;color:#5e6a64}.input-toggle.active{color:var(--acid);border-color:#9bb6f5;background:#f4f7ff}.run-controls button:disabled{opacity:.5;cursor:wait}.input-popover{position:absolute;z-index:20;right:0;top:43px;width:390px;padding:13px;background:#fff;border:1px solid #cbd2ce;border-radius:9px;box-shadow:0 18px 50px #141f1a29}.input-popover>div:first-child{display:flex;justify-content:space-between;margin-bottom:9px}.input-popover strong{font-size:11px}.input-popover span{color:#6d7872;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.json-editor{border:1px solid var(--line);border-radius:7px;overflow:hidden;font-size:10px}.action-error{position:absolute;z-index:21;right:0;top:44px;width:390px;border:1px solid #efb9b5;border-radius:7px}.input-popover+.action-error{top:205px}@media(max-width:1000px){.workspace,.workspace.with-inspector{grid-template-columns:230px minmax(0,1fr)}.inspector{position:fixed;z-index:30;right:0;top:58px;bottom:0;width:min(420px,calc(100vw - 230px));box-shadow:-20px 0 50px #141f1a24}.topbar{grid-template-columns:210px 1fr auto}}@media(max-width:700px){.workspace,.workspace.with-inspector{grid-template-columns:1fr}.explorer,.breadcrumb{display:none}.topbar{grid-template-columns:1fr auto}.view-header{align-items:flex-start;padding:13px 16px}.inspector{width:100vw;top:58px}.input-popover,.action-error{width:calc(100vw - 32px)}} +.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}:root{color:#17211c;background:#f6f8f7;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-synthesis:none;--panel: #ffffff;--panel-raised: #ffffff;--line: #dfe4e1;--muted: #68746e;--acid: #2563eb;--mint: #16805d;--amber: #a15c00;--red: #c43d36;--secondary: #55615b}*{box-sizing:border-box}html,body,#root{width:100%;height:100%;margin:0;overflow:hidden}button,input{font:inherit}button{color:inherit}code,pre,.eyebrow,small{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.app-shell{height:100%;display:flex;flex-direction:column}.topbar{min-height:58px;display:grid;grid-template-columns:260px 1fr auto auto;align-items:center;padding:0 20px;border-bottom:1px solid var(--line);background:#fff;z-index:10;box-shadow:0 1px 2px #141f1a0a}.brand{display:flex;align-items:center;gap:11px}.brand-mark{width:30px;height:30px;display:grid;place-items:center;color:#fff;background:var(--acid);font-weight:750;border-radius:8px}.brand div{display:flex;align-items:baseline;gap:7px}.brand strong{font-size:15px;letter-spacing:-.02em}.brand span:last-child{color:var(--muted);font:11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase}.breadcrumb{display:flex;justify-content:center;gap:9px;color:var(--muted);font-size:12px}.breadcrumb i{opacity:.4}.breadcrumb strong{color:#26322c;font-weight:600}.connection{display:flex;align-items:center;gap:8px;font:11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:capitalize}.connection>span{width:7px;height:7px;border-radius:50%;background:var(--amber)}.connection-live>span{background:var(--mint)}.connection small{color:var(--secondary);margin-left:5px}.connection-error,.action-error,.error-banner{background:#fff1f0;color:#9d2923;padding:8px 18px;font-size:12px;border-bottom:1px solid #efb9b5}.explorer-toggle{display:none;background:#fff;border:1px solid #cbd2ce;border-radius:7px;padding:7px 9px;cursor:pointer;font-size:10px}.workspace{flex:1;width:100%;min-height:0;overflow:hidden;display:grid;grid-template-columns:280px minmax(0,1fr)}.workspace.with-inspector{grid-template-columns:280px minmax(0,1fr) 410px}.explorer{background:var(--panel);border-right:1px solid var(--line);overflow:auto;min-width:0}.explorer>header{padding:22px 18px 14px;position:relative}.eyebrow{display:block;color:var(--acid);font-size:9px;letter-spacing:.16em;text-transform:uppercase}h1,h2,h3,p{margin-top:0}.explorer h2{margin:5px 0 0;font-size:17px}.catalog-revision{position:absolute;right:18px;bottom:17px;color:var(--secondary);font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.target-list{padding:4px 10px 30px}.target{border-top:1px solid var(--line);padding-top:7px;margin-top:4px}.target-heading,.tree-row,.tree-select,.run-select{width:100%;min-width:0}.target-heading,.tree-select,.run-select,.tree-disclosure{background:none;border:0;cursor:pointer;text-align:left}.target-heading{display:grid;grid-template-columns:12px 22px minmax(0,1fr);gap:5px;align-items:center;padding:8px 5px}.target-heading>span:first-child{color:var(--secondary)}.target-kind{width:20px;height:20px;border:1px solid #cbd2ce;border-radius:5px;display:grid;place-items:center;font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#55615b;background:#f7f9f8}.target-heading strong,.target-heading small,.tree-select strong,.tree-select small,.run-select strong,.run-select small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.target-heading strong{font-size:11px;font-weight:600}.target-heading small{color:var(--secondary);font-size:8px;margin-top:2px}.workflow-list{border-left:1px solid #e2e7e4;margin-left:16px;padding-left:7px}.tree-row{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:stretch}.tree-disclosure{color:var(--secondary);text-align:center;padding:0}.tree-select{display:grid;grid-template-columns:23px minmax(0,1fr);gap:4px;padding:8px;border-radius:7px}.tree-select:hover,.run-select:hover,.tree-select.active,.run-select.active{background:#f1f4f2}.tree-select.active{box-shadow:inset 2px 0 var(--acid)}.workflow-glyph{color:var(--acid);font-size:16px}.tree-select strong{font-size:11px;font-weight:600}.tree-select small,.run-select small{color:var(--secondary);font-size:8px;margin-top:3px}.run-branches{margin-left:28px;border-left:1px dashed #d9dfdc;padding:3px 0 6px 8px}.run-select{display:grid;grid-template-columns:20px minmax(0,1fr);gap:5px;align-items:center;padding:7px;border-radius:7px}.run-select strong{font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.run-dot{width:16px;height:16px;border-radius:50%;display:grid;place-items:center;font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#eef2f0;color:var(--muted)}.run-dot.status-success{color:var(--mint)}.run-dot.status-failed{color:var(--red)}.run-dot.status-running{color:var(--acid)}.no-runs{display:block;color:var(--secondary);padding:7px;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.diagnostics{margin:0 12px 12px;padding:9px;background:#fff8eb;border:1px solid #ead1a2;border-radius:8px;font-size:10px}.diagnostics summary{color:var(--amber);cursor:pointer}.diagnostics div{margin-top:9px;border-top:1px solid #ead1a2;padding-top:8px}.diagnostics strong,.diagnostics span{display:block}.diagnostics span{color:#8b7655;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow:hidden;text-overflow:ellipsis}.diagnostics p{color:#735b37;margin:4px 0 0}.skeleton{padding:20px}.skeleton div{height:38px;background:#edf1ef;margin-bottom:9px;border-radius:7px;animation:pulse 1.2s infinite alternate}@keyframes pulse{to{opacity:.45}}.canvas-shell{width:100%;min-width:0;min-height:0;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr);background:#f7f9f8}.view-header{min-height:92px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 24px;border-bottom:1px solid var(--line)}.view-header h1{margin:4px 0 2px;font-size:22px;letter-spacing:-.035em}.view-header p{margin:0;color:var(--muted);font-size:11px}.canvas{position:relative;width:100%;min-width:0;min-height:0;overflow:hidden}.blueprint-canvas{background:radial-gradient(circle,#dce3df 1px,transparent 1px),#f7f9f8;background-size:24px 24px}.run-canvas{background:radial-gradient(circle,#e1e4df 1px,transparent 1px),#fafaf8;background-size:24px 24px}.react-flow__controls{background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 14px #141f1a14;overflow:hidden}.react-flow__controls-button{background:#fff;border-bottom-color:var(--line);fill:#55615b}.react-flow__controls-button:hover{background:#f1f4f2}.react-flow__edge-path{stroke:#87938d;stroke-width:1.4}.react-flow__arrowhead polyline{stroke:#87938d;fill:#87938d}.node-card{width:248px;min-height:102px;position:relative;display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:15px;text-align:left;background:#fff;border:1px solid #d3dad6;border-radius:10px;box-shadow:0 8px 24px #19272014;cursor:pointer}.node-card:hover{border-color:var(--acid);transform:translateY(-1px);box-shadow:0 10px 28px #1927201f}.node-card.blueprint{background:#fff}.node-card strong{font-size:13px}.node-kicker{color:var(--secondary);font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.12em;text-transform:uppercase}.node-identity{color:var(--secondary);font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.node-status{position:absolute;right:12px;top:12px;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;color:var(--muted)}.node-duration{color:var(--muted);font:9px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.node-error{color:#9d2923;background:#fff1f0;padding:5px;border-radius:5px;font-size:9px;max-height:42px;overflow:hidden}.node-card.status-success{border-color:#7ebda4}.node-card.status-failed{border-color:#df8d87}.node-card.status-running{border-color:#7ca2f6;box-shadow:0 0 0 2px #2563eb14,0 8px 24px #19272014}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:4px;border-top:1px solid var(--line);padding-top:8px}.field-grid>span{min-width:0}.field-grid small{display:block;color:#78837d;font-size:7px;text-transform:uppercase;margin-bottom:3px}.field{display:block;color:#36423c;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow:hidden;text-overflow:ellipsis}.react-flow__handle{width:7px;height:7px;background:var(--acid);border:1px solid #ffffff}.historical-badge{position:absolute;right:18px;bottom:18px;z-index:5;padding:9px 12px;background:#fffcf5f5;border:1px solid #dfc99e;color:#766548;font-size:9px;border-radius:8px;box-shadow:0 4px 14px #362c1914}.historical-badge span{display:block;color:var(--amber);font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;margin-bottom:3px}.empty-state{height:100%;display:grid;place-content:center;text-align:center;color:#6d7872}.empty-state>span{color:var(--acid);font-size:40px}.empty-state h2{color:#27332d;margin:8px 0}.empty-state p{max-width:390px;font-size:12px}.inspector{min-width:0;background:var(--panel-raised);border-left:1px solid var(--line);overflow:hidden;display:grid;grid-template-rows:auto auto 1fr}.inspector>header{display:flex;justify-content:space-between;align-items:start;padding:19px 20px 14px;border-bottom:1px solid var(--line)}.inspector h2{margin:4px 0 5px;font-size:18px}.icon-button{width:30px;height:30px;background:#fff;border:1px solid var(--line);border-radius:7px;cursor:pointer;font-size:19px}.icon-button:hover{border-color:#9da7a2;background:#f7f9f8}.status-pill{display:inline-flex;padding:3px 7px;border:1px solid #cbd2ce;border-radius:20px;color:var(--muted);font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;background:#f7f9f8}.status-pill.status-failed{color:var(--red);border-color:#e5aaa5;background:#fff5f4}.status-pill.status-success{color:var(--mint);border-color:#a6d1c0;background:#f2fbf7}.inspector-tabs{display:flex;overflow-x:auto;padding:0 10px;border-bottom:1px solid var(--line)}.inspector-tabs button{padding:11px 9px 9px;background:none;border:0;border-bottom:2px solid transparent;color:#6e7973;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-transform:uppercase;cursor:pointer}.inspector-tabs button.active{color:var(--acid);border-bottom-color:var(--acid)}.inspector-body{overflow:auto;padding:18px 20px 30px}.inspector-body section{margin-bottom:23px}.inspector-body h3{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#56615b}.instructions{color:#36423c;white-space:pre-wrap;font-size:12px;line-height:1.65}.signature-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px}.field-detail{border-top:1px solid var(--line);padding:8px 0}.field-detail strong,.field-detail code{display:block;font-size:10px}.field-detail code{color:#68746e;font-size:8px;margin-top:2px}.field-detail p{color:#737e78;font-size:9px;margin:4px 0 0}.declared-fields{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:10px}.declared-fields>small{width:100%;color:#717c76;font-size:8px;text-transform:uppercase}.declared-fields>span{display:inline-flex;gap:5px;padding:4px 6px;border:1px solid var(--line);background:#f7f9f8;border-radius:5px;font-size:9px}.declared-fields code{color:#5d6963}.json-block{padding:11px;background:#f6f8f7;border:1px solid var(--line);border-radius:7px;overflow:auto;color:#35413b;font-size:9px;white-space:pre-wrap}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.metric-grid>div{background:#f7f9f8;border:1px solid var(--line);border-radius:7px;padding:10px}.metric-grid small,.metric-grid strong{display:block}.metric-grid small{color:#717c76;font-size:7px;text-transform:uppercase}.metric-grid strong{margin-top:5px;font-size:11px}.node-failure{padding:10px;background:#fff1f0;border:1px solid #efb9b5;border-radius:7px;color:#9d2923;font-size:10px}.trace-header,.value-object{margin:0}.trace-header>div,.value-object>div{display:grid;grid-template-columns:105px minmax(0,1fr);gap:10px;border-top:1px solid var(--line);padding:7px 0}.trace-header dt,.value-object dt{color:#6f7a74;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.trace-header dd,.value-object dd{margin:0;font-size:10px;min-width:0}.empty-copy{color:#76817b;font-size:11px}.trace-layout{display:grid;grid-template-rows:auto 220px auto;gap:12px}.trace-toolbar{display:flex;justify-content:space-between;align-items:center}.trace-toolbar h3{margin:0 0 3px}.trace-toolbar span{color:#717c76;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.toggle{background:#fff;border:1px solid #cbd2ce;color:#647069;border-radius:20px;padding:5px 8px;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}.toggle.active{color:var(--acid);border-color:#9bb6f5;background:#f4f7ff}.turn-list{height:220px;overflow:auto;border:1px solid var(--line);background:#fff;border-radius:7px}.turn-row{position:absolute;left:0;top:0;width:100%;height:60px;display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px;background:transparent;border:0;border-bottom:1px solid var(--line);text-align:left;cursor:pointer}.turn-row:hover,.turn-row.active{background:#f1f4f2}.turn-row.active{box-shadow:inset 2px 0 var(--acid)}.turn-row.failed{box-shadow:inset 2px 0 var(--red)}.turn-row strong{font-size:10px}.turn-row span,.turn-row small{color:#748079;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.turn-row small{grid-column:1 / -1}.turn-detail{border-top:1px solid var(--line);padding-top:12px}.value-object .value-object{border-left:1px solid #dfe4e1;padding-left:8px}.value-string{color:#42722d;white-space:pre-wrap;overflow-wrap:anywhere}.value-scalar{color:#16697a}.value-null{color:#76817b}.value-unavailable{color:var(--amber);font-size:9px}.value-list{margin:0;padding-left:20px}.value-list li{margin:5px 0}.file-value{display:flex;gap:9px;padding:9px;border:1px solid #c3d2f5;background:#f5f8ff;border-radius:7px;color:#1d4ed8}.file-value small,.file-value code{display:block}.file-value small{color:#687aa2;font-size:7px;text-transform:uppercase}.file-value code{margin-top:3px;font-size:9px;overflow-wrap:anywhere}.log-list{margin-bottom:12px}.log-list button{width:100%;display:grid;grid-template-columns:48px 1fr auto;gap:7px;padding:7px 4px;border:0;border-bottom:1px solid var(--line);background:none;color:#59655f;text-align:left;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}.log-list button:hover{background:#f1f4f2}.log-level{text-transform:uppercase}.level-error{color:var(--red)}.level-warning{color:var(--amber)}.run-controls{display:flex;align-items:center;gap:7px;position:relative}.run-button,.cancel-button,.input-toggle{border-radius:7px;padding:8px 13px;cursor:pointer;font-size:10px}.run-button{background:var(--acid);border:1px solid var(--acid);color:#fff;font-weight:700}.run-button:hover{background:#1d4ed8;border-color:#1d4ed8}.cancel-button{background:#fff;border:1px solid #e0a6a1;color:#a92f29}.cancel-button:hover{background:#fff3f2}.input-toggle{background:#fff;border:1px solid #cbd2ce;color:#5e6a64}.input-toggle.active{color:var(--acid);border-color:#9bb6f5;background:#f4f7ff}.run-controls button:disabled{opacity:.5;cursor:wait}.input-popover{position:absolute;z-index:20;right:0;top:43px;width:390px;padding:13px;background:#fff;border:1px solid #cbd2ce;border-radius:9px;box-shadow:0 18px 50px #141f1a29}.input-popover>div:first-child{display:flex;justify-content:space-between;margin-bottom:9px}.input-popover strong{font-size:11px}.input-popover span{color:#6d7872;font:8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.json-editor{border:1px solid var(--line);border-radius:7px;overflow:hidden;font-size:10px}.action-error{position:absolute;z-index:21;right:0;top:44px;width:390px;border:1px solid #efb9b5;border-radius:7px}.input-popover+.action-error{top:205px}@media(max-width:1000px){.workspace,.workspace.with-inspector{grid-template-columns:230px minmax(0,1fr)}.inspector{position:fixed;z-index:30;right:0;top:58px;bottom:0;width:min(420px,calc(100vw - 230px));box-shadow:-20px 0 50px #141f1a24}.topbar{grid-template-columns:210px 1fr auto auto}}@media(max-width:700px){.workspace,.workspace.with-inspector{grid-template-columns:minmax(0,1fr)}.explorer{display:none;position:fixed;z-index:31;left:0;top:58px;bottom:0;width:min(320px,100vw);border-right:1px solid var(--line);box-shadow:18px 0 45px #141f1a29}.explorer-open .explorer,.explorer-toggle{display:block}.breadcrumb{display:none}.topbar{grid-template-columns:auto minmax(0,1fr) auto;gap:8px;padding:0 10px}.connection{justify-self:end}.view-header{min-width:0;align-items:stretch;flex-direction:column;gap:10px;padding:13px 16px}.view-header>div{min-width:0}.view-header h1{overflow-wrap:anywhere}.run-controls{flex-wrap:wrap}.inspector{width:100vw;top:58px}.input-popover,.action-error{width:calc(100vw - 32px)}} diff --git a/src/runtime/operator/web_assets/index.html b/src/runtime/operator/web_assets/index.html index 802ce13..46acef9 100644 --- a/src/runtime/operator/web_assets/index.html +++ b/src/runtime/operator/web_assets/index.html @@ -5,11 +5,11 @@ Avalanche Operator - + - +
diff --git a/test/operator_tests/test_operator.py b/test/operator_tests/test_operator.py index 2d3469a..22ebcfe 100644 --- a/test/operator_tests/test_operator.py +++ b/test/operator_tests/test_operator.py @@ -196,6 +196,30 @@ def test_list_runs_filters_by_workflow(self): runs = op.list_runs("nonexistent") assert len(runs) == 0 + def test_refresh_unchanged_catalog_does_not_publish_update(self, tmp_path): + workflow_file = tmp_path / "flow.py" + workflow_file.write_text( + "import avalanche as ava\n" + "@ava.workflow\n" + "def unchanged():\n" + " return None\n" + ) + operator = Operator( + workflow_paths=[str(workflow_file)], + schedule=False, + watch=False, + ) + try: + initial = operator.get_catalog() + + operator._refresh_workflows() + + current = operator.get_catalog() + assert current.revision == initial.revision + assert current.as_of_sequence == initial.as_of_sequence + finally: + operator.close() + def test_refresh_invalid_file_retains_descriptor_and_schedule(self, tmp_path): workflow_file = tmp_path / "scheduled.py" workflow_file.write_text( @@ -902,7 +926,10 @@ def test_prepared_run_retains_immutable_topology_after_source_metadata_changes() "graph": {"source_1": ["step_1"], "step_1": []}, "node_types": {"source_1": "source", "step_1": "step"}, "display_names": {"source_1": "Source", "step_1": "Step"}, - "agent_metadata_json": {"step_1": '{"signature":{"name":"Analyze"}}'}, + "agent_field_schemas_json": { + "step_1": '{"inputs":[{"name":"question","type":"str","description":""}],' + '"outputs":[]}' + }, } run = Operator._run_from_prepared( @@ -915,11 +942,13 @@ def test_prepared_run_retains_immutable_topology_after_source_metadata_changes() prepared["node_ids"].append("new_1") prepared["graph"]["source_1"] = ["new_1"] prepared["display_names"]["step_1"] = "Changed" - prepared["agent_metadata_json"]["step_1"] = '{"signature":{"name":"Changed"}}' + prepared["agent_field_schemas_json"]["step_1"] = '{"inputs":[],"outputs":[]}' assert run.topology.node_ids == ("source_1", "step_1") assert run.topology.graph == (("source_1", ("step_1",)), ("step_1", ())) assert dict(run.topology.display_names) == {"source_1": "Source", "step_1": "Step"} - assert dict(run.topology.agent_metadata_json) == { - "step_1": '{"signature":{"name":"Analyze"}}' + assert dict(run.topology.agent_field_schemas_json) == { + "step_1": ( + '{"inputs":[{"name":"question","type":"str","description":""}],"outputs":[]}' + ) } diff --git a/test/operator_tests/test_operator_dev_reload.py b/test/operator_tests/test_operator_dev_reload.py index f1c6945..67dc18d 100644 --- a/test/operator_tests/test_operator_dev_reload.py +++ b/test/operator_tests/test_operator_dev_reload.py @@ -417,6 +417,33 @@ def Process(self, **kwargs): # noqa: N802 - mirrors multiprocessing context operator.close() +def test_preparation_event_accepts_only_agent_invocation_field_schemas(): + field_schemas = ( + '{"inputs":[{"name":"question","type":"str","description":"Question"}],' + '"outputs":[{"name":"answer","type":"str","description":"Answer"}]}' + ) + event = { + "type": "prepared", + "node_ids": ["agent_1"], + "graph": {"agent_1": []}, + "node_types": {"agent_1": "step"}, + "display_names": {"agent_1": "Agent"}, + "display_name": "Flow", + "agent_field_schemas_json": {"agent_1": field_schemas}, + } + + assert operator_module._validate_preparation_event(event) == "prepared" + + event["agent_field_schemas_json"]["agent_1"] = ( + '{"inputs":[],"outputs":[],"instructions":"must not be retained"}' + ) + with pytest.raises( + operator_module._CoordinatorProtocolError, + match="must contain only input and output schemas", + ): + operator_module._validate_preparation_event(event) + + @pytest.mark.parametrize( "event", [ diff --git a/test/operator_tests/test_protocol_contract.py b/test/operator_tests/test_protocol_contract.py index b89af93..b0e092c 100644 --- a/test/operator_tests/test_protocol_contract.py +++ b/test/operator_tests/test_protocol_contract.py @@ -113,7 +113,10 @@ def test_snapshot_detail_cursor_and_descriptor_roundtrip(): graph=(("agent_1", ()),), node_types=(("agent_1", "step"),), display_names=(("agent_1", "Agent"),), - agent_metadata_json=(("agent_1", '{"signature":{"name":"Analyze"}}'),), + agent_field_schemas_json=( + ("agent_1", '{"inputs":[],"outputs":[{"name":"answer","type":"str",' + '"description":""}]}'), + ), ), ) diff --git a/test/operator_tests/test_registry.py b/test/operator_tests/test_registry.py index e53e42f..8efdd23 100644 --- a/test/operator_tests/test_registry.py +++ b/test/operator_tests/test_registry.py @@ -18,6 +18,7 @@ workflow_to_info, ) from runtime.operator.discovery import configure_roots +from runtime.operator.registry import agent_field_schemas_for_workflow FIXTURES_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), "fixtures") @@ -274,6 +275,22 @@ def test_two_roots_with_same_package_are_discovered_and_runnable_independently( assert registry.get_builder(descriptors[0].workflow_id)().name == "left_build" assert registry.get_builder(descriptors[1].workflow_id)().name == "right_build" + def test_rescan_of_unchanged_catalog_preserves_revision_and_view(self, tmp_path): + workflow_file = tmp_path / "flow.py" + workflow_file.write_text( + "import avalanche as ava\n" + "@ava.workflow\n" + "def unchanged():\n" + " return None\n" + ) + registry = WorkflowRegistry() + initial = registry.scan([str(workflow_file)]) + + rescanned = registry.rescan() + + assert rescanned is initial + assert rescanned.revision == initial.revision + def test_refresh_invalid_file_retains_current_descriptor(self, tmp_path): workflow_file = tmp_path / "flow.py" workflow_file.write_text( @@ -328,7 +345,7 @@ def test_discovery_stdout_and_delayed_background_output_do_not_corrupt_result( " print('builder noise')\n" ) - registry = WorkflowRegistry(discovery_timeout=2.0) + registry = WorkflowRegistry(discovery_timeout=10.0) registry.scan([str(workflow_file)]) assert [item.workflow_id for item in registry.descriptors()] == ["flow.py::noisy"] @@ -348,7 +365,7 @@ def test_successful_discovery_terminates_import_spawned_descendant(self, tmp_pat " return None\n" ) - registry = WorkflowRegistry(discovery_timeout=2.0) + registry = WorkflowRegistry(discovery_timeout=10.0) registry.scan([str(workflow_file)]) assert registry.resolve("spawned") @@ -617,6 +634,13 @@ def agent_flow(): metadata = json.loads(info.agent_metadata_json["analyze_1"]) assert metadata["signature"]["name"] == "Analyze" assert metadata["runtime"]["max_iterations"] == 4 + field_schemas = json.loads( + agent_field_schemas_for_workflow(workflow, ["analyze_1"])["analyze_1"] + ) + assert field_schemas == { + "inputs": [{"name": "text", "type": "str", "description": "text to analyze"}], + "outputs": [{"name": "result", "type": "str", "description": "analysis"}], + } spec = workflow.nodes["analyze_1"].node.fn.__agent_step__ diff --git a/web/operator/src/App.test.tsx b/web/operator/src/App.test.tsx new file mode 100644 index 0000000..86d0d1e --- /dev/null +++ b/web/operator/src/App.test.tsx @@ -0,0 +1,71 @@ +import { fireEvent, render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; + +vi.mock("./GraphCanvas", () => ({ + GraphCanvas: () =>
Workflow graph
, +})); +vi.mock("./state", () => ({ + useOperatorProjection: () => ({ + state: { + catalog: { + operatorInstanceId: "operator-1", + asOfSequence: "1", + revision: "1", + workflows: [ + { + workflowId: "flow.py::demo", + displayName: "demo", + rootAlias: "examples", + relativeFile: "flow.py", + nodeIds: [], + graph: {}, + nodeTypes: {}, + displayNames: {}, + agentNodeIds: [], + agentMetadataJson: {}, + }, + ], + scanTargets: [ + { + alias: "examples", + targetPath: "/workspace/examples", + kind: "directory", + }, + ], + diagnostics: [], + }, + runs: {}, + liveEvents: {}, + liveLogs: {}, + operatorInstanceId: "operator-1", + sequence: "1", + connection: "live", + }, + startRun: vi.fn(async () => "run-1"), + cancelRun: vi.fn(async () => undefined), + }), +})); + +import { App } from "./App"; +import { GrpcWebOperatorApi } from "./api"; + +describe("App", () => { + it("keeps Explorer available through the compact navigation toggle", () => { + const { container } = render( + , + ); + const toggle = screen.getByRole("button", { name: "Explorer" }); + + expect(toggle).toHaveAttribute("aria-controls", "operator-explorer"); + expect(toggle).toHaveAttribute("aria-expanded", "false"); + expect(screen.getByRole("complementary", { name: "Explorer" })).toHaveAttribute( + "id", + "operator-explorer", + ); + + fireEvent.click(toggle); + + expect(toggle).toHaveAttribute("aria-expanded", "true"); + expect(container.querySelector(".app-shell")).toHaveClass("explorer-open"); + }); +}); diff --git a/web/operator/src/App.tsx b/web/operator/src/App.tsx index 8bdcce7..8f08659 100644 --- a/web/operator/src/App.tsx +++ b/web/operator/src/App.tsx @@ -11,6 +11,7 @@ export function App({ api }: { api: OperatorApi }) { const { state, startRun, cancelRun } = useOperatorProjection(api); const [selection, setSelection] = useState(); const [inspectedNode, setInspectedNode] = useState(); + const [explorerOpen, setExplorerOpen] = useState(false); useEffect(() => { const workflows = state.catalog?.workflows ?? []; @@ -45,13 +46,14 @@ export function App({ api }: { api: OperatorApi }) { const select = useCallback((next: Selection) => { setSelection(next); setInspectedNode(undefined); + setExplorerOpen(false); }, []); const selectedRun = run ?? (selection?.kind === "workflow" ? latestRun : undefined); const liveEventKey = run && inspectedNode ? `${run.summary?.runId}:${inspectedNode}` : ""; return ( -
+
+
{state.error &&
{state.error}
}
diff --git a/web/operator/src/Explorer.tsx b/web/operator/src/Explorer.tsx index 1520746..88d1e3d 100644 --- a/web/operator/src/Explorer.tsx +++ b/web/operator/src/Explorer.tsx @@ -111,7 +111,7 @@ export function Explorer({ catalog, runs, selection, onSelect }: ExplorerProps) const [collapsedTargets, setCollapsedTargets] = useState>({}); if (!catalog) { return ( -
)} diff --git a/web/operator/src/RunControls.test.tsx b/web/operator/src/RunControls.test.tsx index c86f727..a5a04ab 100644 --- a/web/operator/src/RunControls.test.tsx +++ b/web/operator/src/RunControls.test.tsx @@ -53,6 +53,9 @@ describe("RunControls", () => { expect(screen.queryByText("Schema-blind JSON object")).not.toBeInTheDocument(); fireEvent.click(screen.getByRole("button", { name: "Add JSON input" })); expect(screen.getByText("Schema-blind JSON object")).toBeInTheDocument(); + expect( + screen.getByRole("textbox", { name: "Workflow input JSON" }), + ).toBeInTheDocument(); }); it("accepts an explicit JSON object and rejects non-object run input", () => { diff --git a/web/operator/src/RunControls.tsx b/web/operator/src/RunControls.tsx index 614bfb3..5d016b2 100644 --- a/web/operator/src/RunControls.tsx +++ b/web/operator/src/RunControls.tsx @@ -23,6 +23,9 @@ function JsonEditor({ value, onChange }: JsonEditorProps) { json(), keymap.of([]), EditorView.lineWrapping, + EditorView.contentAttributes.of({ + "aria-label": "Workflow input JSON", + }), EditorView.theme({ "&": { backgroundColor: "#ffffff", color: "#17211c" }, ".cm-content": { caretColor: "#2563eb", minHeight: "110px" }, diff --git a/web/operator/src/generated/operator.ts b/web/operator/src/generated/operator.ts index 31048d8..094bd95 100644 --- a/web/operator/src/generated/operator.ts +++ b/web/operator/src/generated/operator.ts @@ -260,9 +260,9 @@ export interface WorkflowTopologyMsg { [key: string]: string; }; /** - * @generated from protobuf field: map agent_metadata_json = 5 + * @generated from protobuf field: map agent_field_schemas_json = 5 */ - agentMetadataJson: { + agentFieldSchemasJson: { [key: string]: string; }; } @@ -1889,7 +1889,7 @@ class WorkflowTopologyMsg$Type extends MessageType { { no: 2, name: "graph", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => NodeEdges } }, { no: 3, name: "node_types", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }, { no: 4, name: "display_names", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }, - { no: 5, name: "agent_metadata_json", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } } + { no: 5, name: "agent_field_schemas_json", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } } ]); } create(value?: PartialMessage): WorkflowTopologyMsg { @@ -1898,7 +1898,7 @@ class WorkflowTopologyMsg$Type extends MessageType { message.graph = {}; message.nodeTypes = {}; message.displayNames = {}; - message.agentMetadataJson = {}; + message.agentFieldSchemasJson = {}; if (value !== undefined) reflectionMergePartial(this, message, value); return message; @@ -1920,8 +1920,8 @@ class WorkflowTopologyMsg$Type extends MessageType { case /* map display_names */ 4: this.binaryReadMap4(message.displayNames, reader, options); break; - case /* map agent_metadata_json */ 5: - this.binaryReadMap5(message.agentMetadataJson, reader, options); + case /* map agent_field_schemas_json */ 5: + this.binaryReadMap5(message.agentFieldSchemasJson, reader, options); break; default: let u = options.readUnknownField; @@ -1982,8 +1982,8 @@ class WorkflowTopologyMsg$Type extends MessageType { } map[key ?? ""] = val ?? ""; } - private binaryReadMap5(map: WorkflowTopologyMsg["agentMetadataJson"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof WorkflowTopologyMsg["agentMetadataJson"] | undefined, val: WorkflowTopologyMsg["agentMetadataJson"][any] | undefined; + private binaryReadMap5(map: WorkflowTopologyMsg["agentFieldSchemasJson"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof WorkflowTopologyMsg["agentFieldSchemasJson"] | undefined, val: WorkflowTopologyMsg["agentFieldSchemasJson"][any] | undefined; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -1993,7 +1993,7 @@ class WorkflowTopologyMsg$Type extends MessageType { case 2: val = reader.string(); break; - default: throw new globalThis.Error("unknown map entry field for avalanche.operator.WorkflowTopologyMsg.agent_metadata_json"); + default: throw new globalThis.Error("unknown map entry field for avalanche.operator.WorkflowTopologyMsg.agent_field_schemas_json"); } } map[key ?? ""] = val ?? ""; @@ -2015,9 +2015,9 @@ class WorkflowTopologyMsg$Type extends MessageType { /* map display_names = 4; */ for (let k of globalThis.Object.keys(message.displayNames)) writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.displayNames[k]).join(); - /* map agent_metadata_json = 5; */ - for (let k of globalThis.Object.keys(message.agentMetadataJson)) - writer.tag(5, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.agentMetadataJson[k]).join(); + /* map agent_field_schemas_json = 5; */ + for (let k of globalThis.Object.keys(message.agentFieldSchemasJson)) + writer.tag(5, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.agentFieldSchemasJson[k]).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); diff --git a/web/operator/src/styles.css b/web/operator/src/styles.css index 5effa7d..961a1aa 100644 --- a/web/operator/src/styles.css +++ b/web/operator/src/styles.css @@ -11,6 +11,7 @@ --mint: #16805d; --amber: #a15c00; --red: #c43d36; + --secondary: #55615b; } * { box-sizing: border-box; } @@ -19,10 +20,10 @@ button, input { font: inherit; } button { color: inherit; } code, pre, .eyebrow, small { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } -.app-shell { height: 100%; display: grid; grid-template-rows: 58px auto 1fr; } +.app-shell { height: 100%; display: flex; flex-direction: column; } .topbar { - display: grid; grid-template-columns: 260px 1fr auto; align-items: center; - padding: 0 20px; border-bottom: 1px solid var(--line); background: #ffffff; + min-height: 58px; display: grid; grid-template-columns: 260px 1fr auto auto; + align-items: center; padding: 0 20px; border-bottom: 1px solid var(--line); background: #ffffff; z-index: 10; box-shadow: 0 1px 2px rgba(20, 31, 26, .04); } .brand { display: flex; align-items: center; gap: 11px; } @@ -39,20 +40,24 @@ code, pre, .eyebrow, small { font-family: ui-monospace, SFMono-Regular, Menlo, C .connection { display: flex; align-items: center; gap: 8px; font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: capitalize; } .connection > span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); } .connection-live > span { background: var(--mint); } -.connection small { color: #87918c; margin-left: 5px; } +.connection small { color: var(--secondary); margin-left: 5px; } .connection-error, .action-error, .error-banner { background: #fff1f0; color: #9d2923; padding: 8px 18px; font-size: 12px; border-bottom: 1px solid #efb9b5; } +.explorer-toggle { + display: none; background: #ffffff; border: 1px solid #cbd2ce; border-radius: 7px; + padding: 7px 9px; cursor: pointer; font-size: 10px; +} -.workspace { min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr); } +.workspace { flex: 1; width: 100%; min-height: 0; overflow: hidden; display: grid; grid-template-columns: 280px minmax(0, 1fr); } .workspace.with-inspector { grid-template-columns: 280px minmax(0, 1fr) 410px; } .explorer { background: var(--panel); border-right: 1px solid var(--line); overflow: auto; min-width: 0; } .explorer > header { padding: 22px 18px 14px; position: relative; } .eyebrow { display: block; color: var(--acid); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; } h1, h2, h3, p { margin-top: 0; } .explorer h2 { margin: 5px 0 0; font-size: 17px; } -.catalog-revision { position: absolute; right: 18px; bottom: 17px; color: #7b8680; font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } +.catalog-revision { position: absolute; right: 18px; bottom: 17px; color: var(--secondary); font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .target-list { padding: 4px 10px 30px; } .target { border-top: 1px solid var(--line); padding-top: 7px; margin-top: 4px; } .target-heading, .tree-row, .tree-select, .run-select { width: 100%; min-width: 0; } @@ -60,20 +65,20 @@ h1, h2, h3, p { margin-top: 0; } background: none; border: 0; cursor: pointer; text-align: left; } .target-heading { display: grid; grid-template-columns: 12px 22px minmax(0,1fr); gap: 5px; align-items: center; padding: 8px 5px; } -.target-heading > span:first-child { color: #7a8580; } +.target-heading > span:first-child { color: var(--secondary); } .target-kind { width: 20px; height: 20px; border: 1px solid #cbd2ce; border-radius: 5px; display: grid; place-items: center; font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #55615b; background: #f7f9f8; } .target-heading strong, .target-heading small, .tree-select strong, .tree-select small, .run-select strong, .run-select small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .target-heading strong { font-size: 11px; font-weight: 600; } -.target-heading small { color: #7b8680; font-size: 8px; margin-top: 2px; } +.target-heading small { color: var(--secondary); font-size: 8px; margin-top: 2px; } .workflow-list { border-left: 1px solid #e2e7e4; margin-left: 16px; padding-left: 7px; } .tree-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: stretch; } -.tree-disclosure { color: #75807b; text-align: center; padding: 0; } +.tree-disclosure { color: var(--secondary); text-align: center; padding: 0; } .tree-select { display: grid; grid-template-columns: 23px minmax(0, 1fr); gap: 4px; padding: 8px; border-radius: 7px; } .tree-select:hover, .run-select:hover, .tree-select.active, .run-select.active { background: #f1f4f2; } .tree-select.active { box-shadow: inset 2px 0 var(--acid); } .workflow-glyph { color: var(--acid); font-size: 16px; } .tree-select strong { font-size: 11px; font-weight: 600; } -.tree-select small, .run-select small { color: #7b8680; font-size: 8px; margin-top: 3px; } +.tree-select small, .run-select small { color: var(--secondary); font-size: 8px; margin-top: 3px; } .run-branches { margin-left: 28px; border-left: 1px dashed #d9dfdc; padding: 3px 0 6px 8px; } .run-select { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 5px; align-items: center; padding: 7px; border-radius: 7px; } .run-select strong { font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } @@ -81,7 +86,7 @@ h1, h2, h3, p { margin-top: 0; } .run-dot.status-success { color: var(--mint); } .run-dot.status-failed { color: var(--red); } .run-dot.status-running { color: var(--acid); } -.no-runs { display: block; color: #8a948f; padding: 7px; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } +.no-runs { display: block; color: var(--secondary); padding: 7px; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .diagnostics { margin: 0 12px 12px; padding: 9px; background: #fff8eb; border: 1px solid #ead1a2; border-radius: 8px; font-size: 10px; } .diagnostics summary { color: var(--amber); cursor: pointer; } .diagnostics div { margin-top: 9px; border-top: 1px solid #ead1a2; padding-top: 8px; } @@ -92,11 +97,11 @@ h1, h2, h3, p { margin-top: 0; } .skeleton div { height: 38px; background: #edf1ef; margin-bottom: 9px; border-radius: 7px; animation: pulse 1.2s infinite alternate; } @keyframes pulse { to { opacity: .45; } } -.canvas-shell { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr; background: #f7f9f8; } +.canvas-shell { width: 100%; min-width: 0; min-height: 0; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); background: #f7f9f8; } .view-header { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; border-bottom: 1px solid var(--line); } .view-header h1 { margin: 4px 0 2px; font-size: 22px; letter-spacing: -.035em; } .view-header p { margin: 0; color: var(--muted); font-size: 11px; } -.canvas { position: relative; min-height: 0; } +.canvas { position: relative; width: 100%; min-width: 0; min-height: 0; overflow: hidden; } .blueprint-canvas { background: radial-gradient(circle, #dce3df 1px, transparent 1px), #f7f9f8; background-size: 24px 24px; } .run-canvas { background: radial-gradient(circle, #e1e4df 1px, transparent 1px), #fafaf8; background-size: 24px 24px; } .react-flow__controls { background: #ffffff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(20, 31, 26, .08); overflow: hidden; } @@ -108,7 +113,8 @@ h1, h2, h3, p { margin-top: 0; } .node-card:hover { border-color: var(--acid); transform: translateY(-1px); box-shadow: 0 10px 28px rgba(25, 39, 32, .12); } .node-card.blueprint { background: #ffffff; } .node-card strong { font-size: 13px; } -.node-kicker { color: #77827c; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; } +.node-kicker { color: var(--secondary); font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; } +.node-identity { color: var(--secondary); font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .node-status { position: absolute; right: 12px; top: 12px; font: 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; color: var(--muted); } .node-duration { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .node-error { color: #9d2923; background: #fff1f0; padding: 5px; border-radius: 5px; font-size: 9px; max-height: 42px; overflow: hidden; } @@ -216,15 +222,28 @@ h1, h2, h3, p { margin-top: 0; } @media (max-width: 1000px) { .workspace, .workspace.with-inspector { grid-template-columns: 230px minmax(0, 1fr); } .inspector { position: fixed; z-index: 30; right: 0; top: 58px; bottom: 0; width: min(420px, calc(100vw - 230px)); box-shadow: -20px 0 50px rgba(20,31,26,.14); } - .topbar { grid-template-columns: 210px 1fr auto; } + .topbar { grid-template-columns: 210px 1fr auto auto; } } @media (max-width: 700px) { - .workspace, .workspace.with-inspector { grid-template-columns: 1fr; } - .explorer { display: none; } + .workspace, .workspace.with-inspector { grid-template-columns: minmax(0, 1fr); } + .explorer { + display: none; position: fixed; z-index: 31; left: 0; top: 58px; bottom: 0; + width: min(320px, 100vw); border-right: 1px solid var(--line); + box-shadow: 18px 0 45px rgba(20, 31, 26, .16); + } + .explorer-open .explorer { display: block; } + .explorer-toggle { display: block; } .breadcrumb { display: none; } - .topbar { grid-template-columns: 1fr auto; } - .view-header { align-items: flex-start; padding: 13px 16px; } + .topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 0 10px; } + .connection { justify-self: end; } + .view-header { + min-width: 0; align-items: stretch; flex-direction: column; gap: 10px; + padding: 13px 16px; + } + .view-header > div { min-width: 0; } + .view-header h1 { overflow-wrap: anywhere; } + .run-controls { flex-wrap: wrap; } .inspector { width: 100vw; top: 58px; } .input-popover, .action-error { width: calc(100vw - 32px); } } From 0679a89959d47bb8fe6d85f6473b5a0f0ceb0e16 Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Mon, 3 Aug 2026 17:02:34 +0000 Subject: [PATCH 12/25] perf(operator): define bounded browser hydration contract --- .../design.md | 28 +++ .../proposal.md | 1 + .../specs/operator-web-ui/spec.md | 53 +++++ .../tasks.md | 13 ++ src/runtime/operator/proto/operator.proto | 27 ++- src/runtime/operator/proto/operator_pb2.py | 182 +++++++++--------- src/runtime/operator/proto/operator_pb2.pyi | 34 +++- .../operator/proto/operator_pb2_grpc.py | 43 +++++ .../web_assets/assets/index-BuH1gsyY.js | 9 - .../web_assets/assets/index-C_A082W7.js | 9 + src/runtime/operator/web_assets/index.html | 2 +- web/operator/src/api.ts | 7 + web/operator/src/generated/operator.client.ts | 22 ++- web/operator/src/generated/operator.ts | 160 ++++++++++++++- 14 files changed, 472 insertions(+), 118 deletions(-) delete mode 100644 src/runtime/operator/web_assets/assets/index-BuH1gsyY.js create mode 100644 src/runtime/operator/web_assets/assets/index-C_A082W7.js diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/design.md b/openspec/changes/add-operator-web-ui-and-hot-reload/design.md index 5dac72c..74e5814 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/design.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/design.md @@ -132,6 +132,34 @@ Extend `AgentEventDescriptor` with the summary fields needed to build a navigato The browser virtualizes descriptor rows and keeps a small bounded LRU of hydrated bodies. Following the live turn is the default; selecting another turn pauses following. Inputs and terminal outputs remain separate views. The web client does not call monolithic `ReadTrace`; migrate the TUI to the same descriptor/detail path so complete trace bodies are not duplicated solely for compatibility. +### Preserve paging through the browser boundary + +Keep exact `GetRunSnapshot` retrieval for retained structural baselines and Python/TUI +reconciliation. Add a separate latest-run snapshot operation for browser selection so one +atomic response supplies the selected run's topology, node state, descriptor watermarks, and +fresh page tokens without hydrating other runs. + +Log and agent-event requests retain forward lower-bound cursors for incremental Python/TUI +hydration and add newest-first upper-bound cursors for interactive inspection. Log pages may +bind an exact node filter. Opaque continuation and body tokens bind their operator instance, +run, optional node, structural sequence, direction, filter, high-water mark, and cursor. +Continuation fields are immutable: conflicting request fields fail instead of silently +restarting a page walk. + +### Bound browser projections and rendering work + +The browser baseline retains the catalog and paged run summaries, then demand-loads at most +the selected run snapshot. Ordered update envelopes enter a bounded queue and are reduced in +contiguous frame-sized batches. Queue overflow, epoch change, sequence gaps, or server reset +all trigger authoritative reconciliation; the browser never drops an arbitrary structural +update and continues. + +Live log and event descriptors use bounded run/node tails with repair watermarks. Crossing a +discarded range refreshes the selected snapshot before paging. Inspector tab state is +generation-scoped and cancellable. Only the active tab requests or renders detail. Trace and +log navigators are virtualized, parsed detail caching is bounded by entries and bytes, and +nested values expand in bounded groups rather than recursively mounting the complete body. + ## Risks / Trade-offs - Full catalog replacements make reload behavior simple and correct but transmit more data than diffs. Local workflow catalogs are expected to be small; a later scale constraint can justify an explicitly versioned diff protocol. diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/proposal.md b/openspec/changes/add-operator-web-ui-and-hot-reload/proposal.md index 4ed53a2..6ffffbf 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/proposal.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/proposal.md @@ -10,6 +10,7 @@ The operator can rescan workflow source, but it does not expose catalog changes - Preserve existing runs across workflow reloads; reloads affect catalog/current-workflow views and future runs, never rewrite a run's recorded topology. - Preserve bounded agent invocation inputs and outputs as structured evidence, including typed PredictRLM file values whose host paths receive file-specific presentation without copying or storing the files. - Define browser-facing transport and asset-serving behavior while retaining the operator's local-first, loopback-default security posture. +- Keep large-run browser transport, live projections, inspector hydration, and rendering bounded so the web UI remains responsive under long agent traces and log histories. ## Capabilities diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md index d671843..f08aaf6 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/specs/operator-web-ui/spec.md @@ -183,3 +183,56 @@ declared function or agent. #### Scenario: A workflow invokes the same declaration more than once - **WHEN** two or more nodes have the same display name - **THEN** each node card remains distinguishable by a stable invocation identity in both its visible label and accessible name + +### Requirement: Bound large-run browser hydration + +The web UI SHALL preserve operator pagination instead of draining descriptor pages or +hydrating every retained run snapshot. It SHALL load a run snapshot only for the selected +run, request log and agent-event pages only for the active inspector tab, cancel superseded +requests, and retain bounded descriptor and detail projections. + +#### Scenario: User opens a historical run +- **WHEN** a user selects one retained run from a catalog containing many runs +- **THEN** the browser requests one current snapshot for that run without requesting snapshots for the other retained runs + +#### Scenario: User opens a node overview +- **WHEN** a user opens a run node and leaves the inspector on Overview +- **THEN** the browser does not request log pages, agent-event pages, or detail bodies + +#### Scenario: User inspects a large log or trace history +- **WHEN** the selected node has more descriptors than one page +- **THEN** the active tab requests and renders one bounded page at a time and retrieves older pages only as the user navigates toward them + +### Requirement: Keep live browser projections bounded + +The web UI SHALL apply operator updates in exact sequence while bounding pending browser +work and retained live descriptor tails. If it cannot preserve the ordered stream within +those bounds, it SHALL discard the ephemeral projection and reconcile from an authoritative +operator baseline rather than dropping arbitrary structural updates. + +#### Scenario: Live updates exceed the browser queue bound +- **WHEN** ordered updates arrive faster than the browser can apply its bounded batches +- **THEN** the browser stops the stale stream and reloads authoritative state before resuming + +#### Scenario: Live descriptors exceed a retained tail +- **WHEN** a selected run or node publishes more live descriptors than the browser tail retains +- **THEN** the browser records a repair watermark and refreshes authoritative snapshot tokens before paging across the discarded range + +### Requirement: Keep inspector rendering responsive + +The run inspector SHALL virtualize large descriptor navigators, render only its active tab, +distinguish loading from empty and error states, decode log bodies as text, decode structured +agent-event bodies as JSON, and render nested values through explicit bounded expansion. +Trace following SHALL affect only the Trace tab. + +#### Scenario: User changes tabs during hydration +- **WHEN** an earlier tab request completes after the user changes tab, node, or run +- **THEN** the stale result does not replace the current inspector state + +#### Scenario: User views plain-text logs +- **WHEN** a selected log body is not JSON +- **THEN** the Logs tab presents its exact decoded text without reporting a JSON parse error + +#### Scenario: Retained value contains a large collection +- **WHEN** an input, output, or trace detail contains a large nested collection +- **THEN** the value starts collapsed and renders bounded child groups only after explicit expansion diff --git a/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md b/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md index d017090..a8c61ec 100644 --- a/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md +++ b/openspec/changes/add-operator-web-ui-and-hot-reload/tasks.md @@ -53,3 +53,16 @@ - [x] 6.6 Give repeated node invocations distinct visible labels and accessible names derived from stable node identity. - [x] 6.7 Correct the retained-output empty-state grammar. - [x] 6.8 Add browser regression coverage for desktop sizing, narrow navigation and canvas bounds, repeated invocation identity, accessible input naming, empty-state copy, and automated contrast checks. + +## 7. Large-run performance remediation + +- [ ] 7.1 Add an atomic latest selected-run snapshot RPC and immutable forward/newest-first log and agent-event pagination contracts, including node-filtered logs and epoch-correct detail tokens. +- [ ] 7.2 Implement operator, native gRPC, gRPC-Web, and Python-client support for the new snapshot and paging contracts without changing exact retained-baseline semantics. +- [ ] 7.3 Replace browser page-draining APIs with cancellable single-page methods, summary-only baseline hydration, one demand-loaded selected snapshot, and distinct JSON/text detail readers. +- [ ] 7.4 Bound ordered browser update batching, pending queues, live descriptor tails, and repair watermarks while preserving reset and exact sequence reconciliation. +- [ ] 7.5 Migrate App and Explorer to summary-backed navigation and cancellable selected-run snapshot loading without browser-owned lifecycle state. +- [ ] 7.6 Make inspector hydration active-tab-only, generation-scoped, cancellable, incrementally paged, node-filtered, and virtualized; isolate Trace following from Inputs, Output, and Logs. +- [ ] 7.7 Make parsed detail caching byte-bounded and render large nested values through accessible collapsed, depth-limited, and chunked expansion. +- [ ] 7.8 Contain Explorer and graph rerenders so unrelated log, event, and detail updates do not rebuild navigation or graph layout. +- [ ] 7.9 Add deterministic high-volume protocol, state, inspector, DOM-bound, cancellation, decoding, and browser performance regression coverage. +- [ ] 7.10 Run focused and aggregate Python, TUI, browser build/test/benchmark, smoke, and real-browser large-run verification. diff --git a/src/runtime/operator/proto/operator.proto b/src/runtime/operator/proto/operator.proto index dee20ee..2e9b26f 100644 --- a/src/runtime/operator/proto/operator.proto +++ b/src/runtime/operator/proto/operator.proto @@ -15,6 +15,7 @@ service OperatorService { rpc GetRunResult(GetRunRequest) returns (RunResultMsg); rpc ListRunSummaries(ListRunSummariesRequest) returns (RunSummaryPage); rpc GetRunSnapshot(GetRunSnapshotRequest) returns (RunSnapshotMsg); + rpc GetLatestRunSnapshot(GetLatestRunSnapshotRequest) returns (RunSnapshotMsg); rpc ListLogs(ListLogsRequest) returns (LogPage); rpc ListAgentEvents(ListAgentEventsRequest) returns (AgentEventPage); rpc ReadTrace(ReadTraceRequest) returns (stream TraceChunk); @@ -68,23 +69,41 @@ message GetRunSnapshotRequest { uint64 as_of_sequence = 3; } +message GetLatestRunSnapshotRequest { + string run_id = 1; + string operator_instance_id = 2; +} + +enum DescriptorPageOrder { + DESCRIPTOR_PAGE_ORDER_FORWARD = 0; + DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST = 1; +} + // Page tokens are opaque bearer references issued by GetRunSnapshot. The current // loopback transport does not sign them; authenticated deployments must sign or // tenant-bind tokens and reauthorize the referenced run on every use. message ListLogsRequest { - // Required snapshot-issued token. after_sequence is relative to this snapshot. + // Required snapshot-issued token. Cursors and filters are relative to this snapshot. string page_token = 1; - // Exclusive log cursor within the snapshot identified by page_token. + // Exclusive lower log bound for forward and incremental hydration. uint64 after_sequence = 2; uint32 page_size = 3; + // Exclusive upper log bound for newest-first hydration; zero starts at the snapshot end. + uint64 before_sequence = 4; + // Optional exact node filter. Continuation tokens bind this filter. + string node_id = 5; + DescriptorPageOrder order = 6; } message ListAgentEventsRequest { - // Required snapshot-issued token. after_event_sequence is relative to this snapshot. + // Required snapshot-issued token. Cursors are relative to this snapshot. string page_token = 1; - // Exclusive event cursor within the snapshot identified by page_token. + // Exclusive lower event bound for forward and incremental hydration. uint64 after_event_sequence = 2; uint32 page_size = 3; + // Exclusive upper event bound for newest-first hydration; zero starts at the snapshot end. + uint64 before_event_sequence = 4; + DescriptorPageOrder order = 5; } message ReadTraceRequest { diff --git a/src/runtime/operator/proto/operator_pb2.py b/src/runtime/operator/proto/operator_pb2.py index f815967..670465f 100644 --- a/src/runtime/operator/proto/operator_pb2.py +++ b/src/runtime/operator/proto/operator_pb2.py @@ -24,7 +24,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eoperator.proto\x12\x12\x61valanche.operator\"\x07\n\x05\x45mpty\"\xb2\x01\n\x0fStartRunRequest\x12\x11\n\tflow_name\x18\x01 \x01(\t\x12\x12\n\ninput_json\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_json\x18\x03 \x01(\t\x12\x37\n\x0binput_files\x18\x04 \x03(\x0b\x32\".avalanche.operator.FileAttachment\x12\x0e\n\x06run_id\x18\x06 \x01(\t\x12\x19\n\x11workflow_selector\x18\x07 \x01(\t\"i\n\x0e\x46ileAttachment\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x04 \x01(\t\x12\x0e\n\x06sha256\x18\x05 \x01(\t\"\"\n\x10StartRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\"\n\x10\x43\x61ncelRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"[\n\x17ListRunSummariesRequest\x12\x19\n\x11workflow_selector\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x12\n\npage_token\x18\x03 \x01(\t\"]\n\x15GetRunSnapshotRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x1c\n\x14operator_instance_id\x18\x02 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x03 \x01(\x04\"P\n\x0fListLogsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"]\n\x16ListAgentEventsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x1c\n\x14\x61\x66ter_event_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\"c\n\x10ReadTraceRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x1c\n\x14operator_instance_id\x18\x04 \x01(\t\"\'\n\x11ReadDetailRequest\x12\x12\n\nbody_token\x18\x01 \x01(\t\"T\n\x1cStreamOperatorUpdatesRequest\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\"\x1d\n\tNodeEdges\x12\x10\n\x08\x63hildren\x18\x01 \x03(\t\"\xe0\x04\n\x13WorkflowTopologyMsg\x12\x10\n\x08node_ids\x18\x01 \x03(\t\x12\x41\n\x05graph\x18\x02 \x03(\x0b\x32\x32.avalanche.operator.WorkflowTopologyMsg.GraphEntry\x12J\n\nnode_types\x18\x03 \x03(\x0b\x32\x36.avalanche.operator.WorkflowTopologyMsg.NodeTypesEntry\x12P\n\rdisplay_names\x18\x04 \x03(\x0b\x32\x39.avalanche.operator.WorkflowTopologyMsg.DisplayNamesEntry\x12\x64\n\x18\x61gent_field_schemas_json\x18\x05 \x03(\x0b\x32\x42.avalanche.operator.WorkflowTopologyMsg.AgentFieldSchemasJsonEntry\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a<\n\x1a\x41gentFieldSchemasJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcd\x06\n\x0b\x46lowInfoMsg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x10\n\x08node_ids\x18\x03 \x03(\t\x12\x39\n\x05graph\x18\x04 \x03(\x0b\x32*.avalanche.operator.FlowInfoMsg.GraphEntry\x12\x42\n\nnode_types\x18\x05 \x03(\x0b\x32..avalanche.operator.FlowInfoMsg.NodeTypesEntry\x12H\n\rdisplay_names\x18\x06 \x03(\x0b\x32\x31.avalanche.operator.FlowInfoMsg.DisplayNamesEntry\x12\x0c\n\x04\x63ron\x18\x07 \x01(\t\x12\x13\n\x0bnext_run_at\x18\x08 \x01(\x01\x12\x13\n\x0blast_run_at\x18\t \x01(\x01\x12\x13\n\x0bworkflow_id\x18\n \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x12\x12\n\nroot_alias\x18\x0c \x01(\t\x12\x15\n\rrelative_file\x18\r \x01(\t\x12\x16\n\x0e\x62uilder_symbol\x18\x0e \x01(\t\x12\x16\n\x0e\x61gent_node_ids\x18\x0f \x03(\t\x12S\n\x13\x61gent_metadata_json\x18\x10 \x03(\x0b\x32\x36.avalanche.operator.FlowInfoMsg.AgentMetadataJsonEntry\x12\x14\n\x0cwebhook_path\x18\x11 \x01(\t\x12\x13\n\x0bwebhook_url\x18\x12 \x01(\t\x12\x16\n\x0ewebhook_active\x18\x13 \x01(\x08\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x16\x44iscoveryDiagnosticMsg\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\"A\n\rScanTargetMsg\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12\x13\n\x0btarget_path\x18\x02 \x01(\t\x12\x0c\n\x04kind\x18\x03 \x01(\t\"\x8a\x02\n\x12\x43\x61talogSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x32\n\tworkflows\x18\x04 \x03(\x0b\x32\x1f.avalanche.operator.FlowInfoMsg\x12\x37\n\x0cscan_targets\x18\x05 \x03(\x0b\x32!.avalanche.operator.ScanTargetMsg\x12?\n\x0b\x64iagnostics\x18\x06 \x03(\x0b\x32*.avalanche.operator.DiscoveryDiagnosticMsg\"\x92\x01\n\x14ResultFileAttachment\x12\x15\n\rattachment_id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x17\n\nmedia_type\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06sha256\x18\x05 \x01(\tB\x07\n\x05_nameB\r\n\x0b_media_type\"[\n\x0cRunResultMsg\x12\x12\n\nvalue_json\x18\x01 \x01(\t\x12\x37\n\x05\x66iles\x18\x02 \x03(\x0b\x32(.avalanche.operator.ResultFileAttachment\"\xde\x01\n\rRunSummaryMsg\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x11\n\tflow_name\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x14\n\x0ctriggered_by\x18\x06 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12\x1d\n\x15workflow_display_name\x18\x08 \x01(\t\x12\x18\n\x10\x63reated_sequence\x18\t \x01(\x04\x12\x10\n\x08revision\x18\n \x01(\x04\"\xda\x01\n\x0eTraceHeaderMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x16\n\tsub_model\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\niterations\x18\x04 \x01(\x04\x12\x16\n\x0emax_iterations\x18\x05 \x01(\x04\x12\x13\n\x0b\x64uration_ms\x18\x06 \x01(\x04\x12\x12\n\nusage_json\x18\x07 \x01(\t\x12\x1b\n\x0etelemetry_json\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\x0c\n\n_sub_modelB\x11\n\x0f_telemetry_json\"\xd7\x01\n\x12TraceDescriptorMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\x04\x12\x11\n\tavailable\x18\x03 \x01(\x08\x12\x10\n\x08\x63omplete\x18\x04 \x01(\x08\x12\x13\n\x0b\x65vent_count\x18\x05 \x01(\x04\x12\x12\n\nsize_bytes\x18\x06 \x01(\x04\x12\x1d\n\x15latest_event_sequence\x18\x07 \x01(\x04\x12\x32\n\x06header\x18\x08 \x01(\x0b\x32\".avalanche.operator.TraceHeaderMsg\"\xfa\x01\n\x0fNodeSnapshotMsg\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tnode_type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12\x12\n\nstarted_at\x18\x05 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x06 \x01(\x01\x12\x35\n\x05trace\x18\x07 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\x12\x10\n\x08revision\x18\x08 \x01(\x04\x12\x18\n\x10\x65vent_page_token\x18\t \x01(\t\x12\x12\n\x05\x65rror\x18\n \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x9e\x02\n\x0eRunSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x32\n\x07summary\x18\x03 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x04 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x1b\n\x13latest_log_sequence\x18\x05 \x01(\x04\x12\x16\n\x0elog_page_token\x18\x06 \x01(\t\x12\x39\n\x08topology\x18\x07 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"\x90\x01\n\x0eRunSummaryPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12/\n\x04runs\x18\x03 \x03(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x85\x01\n\x16LogRecordDescriptorMsg\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x02 \x01(\x01\x12\r\n\x05level\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12\x12\n\nsize_bytes\x18\x05 \x01(\x04\x12\x12\n\nbody_token\x18\x06 \x01(\t\"\x92\x01\n\x07LogPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x38\n\x04logs\x18\x03 \x03(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x8e\x02\n\x17\x41gentEventDescriptorMsg\x12\x16\n\x0e\x65vent_sequence\x18\x01 \x01(\x04\x12\x12\n\nsize_bytes\x18\x02 \x01(\x04\x12\x12\n\nbody_token\x18\x03 \x01(\t\x12\x15\n\rinvocation_id\x18\x04 \x01(\t\x12\x12\n\nevent_kind\x18\x05 \x01(\t\x12\x16\n\titeration\x18\x06 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64uration_ms\x18\x07 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x65rror\x18\x08 \x01(\x08\x12\x12\n\ntool_count\x18\t \x01(\r\x12\x15\n\rpredict_count\x18\n \x01(\rB\x0c\n\n_iterationB\x0e\n\x0c_duration_ms\"\xbd\x01\n\x0e\x41gentEventPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12;\n\x06\x65vents\x18\x05 \x03(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\"N\n\nTraceChunk\x12\x10\n\x08revision\x18\x01 \x01(\x04\x12\x13\n\x0b\x63hunk_index\x18\x02 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x04 \x01(\x08\"=\n\x0b\x44\x65tailChunk\x12\x13\n\x0b\x63hunk_index\x18\x01 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x03 \x01(\x08\"\xaf\x01\n\nRunCreated\x12\x32\n\x07summary\x18\x01 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x02 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x39\n\x08topology\x18\x03 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"j\n\x10RunStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nstarted_at\x18\x03 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x04 \x01(\x01\x12\x10\n\x08revision\x18\x05 \x01(\x04\"\x9a\x01\n\x11NodeStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x10\n\x08revision\x18\x06 \x01(\x04\x12\x12\n\x05\x65rror\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"V\n\x0bLogAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x37\n\x03log\x18\x02 \x01(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\"q\n\x12\x41gentEventAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12:\n\x05\x65vent\x18\x03 \x01(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\"h\n\x0eTraceFinalized\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x35\n\x05trace\x18\x03 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\"J\n\x0f\x43\x61talogReplaced\x12\x37\n\x07\x63\x61talog\x18\x01 \x01(\x0b\x32&.avalanche.operator.CatalogSnapshotMsg\"\xee\x03\n\x0eOperatorUpdate\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x35\n\x0brun_created\x18\x02 \x01(\x0b\x32\x1e.avalanche.operator.RunCreatedH\x00\x12\x42\n\x12run_status_changed\x18\x03 \x01(\x0b\x32$.avalanche.operator.RunStatusChangedH\x00\x12\x44\n\x13node_status_changed\x18\x04 \x01(\x0b\x32%.avalanche.operator.NodeStatusChangedH\x00\x12\x37\n\x0clog_appended\x18\x05 \x01(\x0b\x32\x1f.avalanche.operator.LogAppendedH\x00\x12\x46\n\x14\x61gent_event_appended\x18\x06 \x01(\x0b\x32&.avalanche.operator.AgentEventAppendedH\x00\x12=\n\x0ftrace_finalized\x18\x07 \x01(\x0b\x32\".avalanche.operator.TraceFinalizedH\x00\x12?\n\x10\x63\x61talog_replaced\x18\x08 \x01(\x0b\x32#.avalanche.operator.CatalogReplacedH\x00\x42\x08\n\x06\x63hange\"?\n\rResetRequired\x12\x15\n\rhistory_floor\x18\x01 \x01(\x04\x12\x17\n\x0flatest_sequence\x18\x02 \x01(\x04\"\xb4\x01\n\x16OperatorUpdateEnvelope\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x34\n\x06update\x18\x02 \x01(\x0b\x32\".avalanche.operator.OperatorUpdateH\x00\x12;\n\x0ereset_required\x18\x03 \x01(\x0b\x32!.avalanche.operator.ResetRequiredH\x00\x42\t\n\x07payload2\xf9\x07\n\x0fOperatorService\x12O\n\nGetCatalog\x12\x19.avalanche.operator.Empty\x1a&.avalanche.operator.CatalogSnapshotMsg\x12U\n\x08StartRun\x12#.avalanche.operator.StartRunRequest\x1a$.avalanche.operator.StartRunResponse\x12L\n\tCancelRun\x12$.avalanche.operator.CancelRunRequest\x1a\x19.avalanche.operator.Empty\x12S\n\x0cGetRunResult\x12!.avalanche.operator.GetRunRequest\x1a .avalanche.operator.RunResultMsg\x12\x63\n\x10ListRunSummaries\x12+.avalanche.operator.ListRunSummariesRequest\x1a\".avalanche.operator.RunSummaryPage\x12_\n\x0eGetRunSnapshot\x12).avalanche.operator.GetRunSnapshotRequest\x1a\".avalanche.operator.RunSnapshotMsg\x12L\n\x08ListLogs\x12#.avalanche.operator.ListLogsRequest\x1a\x1b.avalanche.operator.LogPage\x12\x61\n\x0fListAgentEvents\x12*.avalanche.operator.ListAgentEventsRequest\x1a\".avalanche.operator.AgentEventPage\x12S\n\tReadTrace\x12$.avalanche.operator.ReadTraceRequest\x1a\x1e.avalanche.operator.TraceChunk0\x01\x12V\n\nReadDetail\x12%.avalanche.operator.ReadDetailRequest\x1a\x1f.avalanche.operator.DetailChunk0\x01\x12w\n\x15StreamOperatorUpdates\x12\x30.avalanche.operator.StreamOperatorUpdatesRequest\x1a*.avalanche.operator.OperatorUpdateEnvelope0\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eoperator.proto\x12\x12\x61valanche.operator\"\x07\n\x05\x45mpty\"\xb2\x01\n\x0fStartRunRequest\x12\x11\n\tflow_name\x18\x01 \x01(\t\x12\x12\n\ninput_json\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_json\x18\x03 \x01(\t\x12\x37\n\x0binput_files\x18\x04 \x03(\x0b\x32\".avalanche.operator.FileAttachment\x12\x0e\n\x06run_id\x18\x06 \x01(\t\x12\x19\n\x11workflow_selector\x18\x07 \x01(\t\"i\n\x0e\x46ileAttachment\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x04 \x01(\t\x12\x0e\n\x06sha256\x18\x05 \x01(\t\"\"\n\x10StartRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\"\n\x10\x43\x61ncelRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"[\n\x17ListRunSummariesRequest\x12\x19\n\x11workflow_selector\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\r\x12\x12\n\npage_token\x18\x03 \x01(\t\"]\n\x15GetRunSnapshotRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x1c\n\x14operator_instance_id\x18\x02 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x03 \x01(\x04\"K\n\x1bGetLatestRunSnapshotRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x1c\n\x14operator_instance_id\x18\x02 \x01(\t\"\xb2\x01\n\x0fListLogsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\x12\x17\n\x0f\x62\x65\x66ore_sequence\x18\x04 \x01(\x04\x12\x0f\n\x07node_id\x18\x05 \x01(\t\x12\x36\n\x05order\x18\x06 \x01(\x0e\x32\'.avalanche.operator.DescriptorPageOrder\"\xb4\x01\n\x16ListAgentEventsRequest\x12\x12\n\npage_token\x18\x01 \x01(\t\x12\x1c\n\x14\x61\x66ter_event_sequence\x18\x02 \x01(\x04\x12\x11\n\tpage_size\x18\x03 \x01(\r\x12\x1d\n\x15\x62\x65\x66ore_event_sequence\x18\x04 \x01(\x04\x12\x36\n\x05order\x18\x05 \x01(\x0e\x32\'.avalanche.operator.DescriptorPageOrder\"c\n\x10ReadTraceRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x1c\n\x14operator_instance_id\x18\x04 \x01(\t\"\'\n\x11ReadDetailRequest\x12\x12\n\nbody_token\x18\x01 \x01(\t\"T\n\x1cStreamOperatorUpdatesRequest\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61\x66ter_sequence\x18\x02 \x01(\x04\"\x1d\n\tNodeEdges\x12\x10\n\x08\x63hildren\x18\x01 \x03(\t\"\xe0\x04\n\x13WorkflowTopologyMsg\x12\x10\n\x08node_ids\x18\x01 \x03(\t\x12\x41\n\x05graph\x18\x02 \x03(\x0b\x32\x32.avalanche.operator.WorkflowTopologyMsg.GraphEntry\x12J\n\nnode_types\x18\x03 \x03(\x0b\x32\x36.avalanche.operator.WorkflowTopologyMsg.NodeTypesEntry\x12P\n\rdisplay_names\x18\x04 \x03(\x0b\x32\x39.avalanche.operator.WorkflowTopologyMsg.DisplayNamesEntry\x12\x64\n\x18\x61gent_field_schemas_json\x18\x05 \x03(\x0b\x32\x42.avalanche.operator.WorkflowTopologyMsg.AgentFieldSchemasJsonEntry\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a<\n\x1a\x41gentFieldSchemasJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcd\x06\n\x0b\x46lowInfoMsg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x10\n\x08node_ids\x18\x03 \x03(\t\x12\x39\n\x05graph\x18\x04 \x03(\x0b\x32*.avalanche.operator.FlowInfoMsg.GraphEntry\x12\x42\n\nnode_types\x18\x05 \x03(\x0b\x32..avalanche.operator.FlowInfoMsg.NodeTypesEntry\x12H\n\rdisplay_names\x18\x06 \x03(\x0b\x32\x31.avalanche.operator.FlowInfoMsg.DisplayNamesEntry\x12\x0c\n\x04\x63ron\x18\x07 \x01(\t\x12\x13\n\x0bnext_run_at\x18\x08 \x01(\x01\x12\x13\n\x0blast_run_at\x18\t \x01(\x01\x12\x13\n\x0bworkflow_id\x18\n \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x12\x12\n\nroot_alias\x18\x0c \x01(\t\x12\x15\n\rrelative_file\x18\r \x01(\t\x12\x16\n\x0e\x62uilder_symbol\x18\x0e \x01(\t\x12\x16\n\x0e\x61gent_node_ids\x18\x0f \x03(\t\x12S\n\x13\x61gent_metadata_json\x18\x10 \x03(\x0b\x32\x36.avalanche.operator.FlowInfoMsg.AgentMetadataJsonEntry\x12\x14\n\x0cwebhook_path\x18\x11 \x01(\t\x12\x13\n\x0bwebhook_url\x18\x12 \x01(\t\x12\x16\n\x0ewebhook_active\x18\x13 \x01(\x08\x1aK\n\nGraphEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.avalanche.operator.NodeEdges:\x02\x38\x01\x1a\x30\n\x0eNodeTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x44isplayNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x41gentMetadataJsonEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x16\x44iscoveryDiagnosticMsg\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\"A\n\rScanTargetMsg\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12\x13\n\x0btarget_path\x18\x02 \x01(\t\x12\x0c\n\x04kind\x18\x03 \x01(\t\"\x8a\x02\n\x12\x43\x61talogSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x10\n\x08revision\x18\x03 \x01(\x04\x12\x32\n\tworkflows\x18\x04 \x03(\x0b\x32\x1f.avalanche.operator.FlowInfoMsg\x12\x37\n\x0cscan_targets\x18\x05 \x03(\x0b\x32!.avalanche.operator.ScanTargetMsg\x12?\n\x0b\x64iagnostics\x18\x06 \x03(\x0b\x32*.avalanche.operator.DiscoveryDiagnosticMsg\"\x92\x01\n\x14ResultFileAttachment\x12\x15\n\rattachment_id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x17\n\nmedia_type\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06sha256\x18\x05 \x01(\tB\x07\n\x05_nameB\r\n\x0b_media_type\"[\n\x0cRunResultMsg\x12\x12\n\nvalue_json\x18\x01 \x01(\t\x12\x37\n\x05\x66iles\x18\x02 \x03(\x0b\x32(.avalanche.operator.ResultFileAttachment\"\xde\x01\n\rRunSummaryMsg\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x11\n\tflow_name\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x14\n\x0ctriggered_by\x18\x06 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12\x1d\n\x15workflow_display_name\x18\x08 \x01(\t\x12\x18\n\x10\x63reated_sequence\x18\t \x01(\x04\x12\x10\n\x08revision\x18\n \x01(\x04\"\xda\x01\n\x0eTraceHeaderMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x16\n\tsub_model\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\niterations\x18\x04 \x01(\x04\x12\x16\n\x0emax_iterations\x18\x05 \x01(\x04\x12\x13\n\x0b\x64uration_ms\x18\x06 \x01(\x04\x12\x12\n\nusage_json\x18\x07 \x01(\t\x12\x1b\n\x0etelemetry_json\x18\x08 \x01(\tH\x01\x88\x01\x01\x42\x0c\n\n_sub_modelB\x11\n\x0f_telemetry_json\"\xd7\x01\n\x12TraceDescriptorMsg\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\x04\x12\x11\n\tavailable\x18\x03 \x01(\x08\x12\x10\n\x08\x63omplete\x18\x04 \x01(\x08\x12\x13\n\x0b\x65vent_count\x18\x05 \x01(\x04\x12\x12\n\nsize_bytes\x18\x06 \x01(\x04\x12\x1d\n\x15latest_event_sequence\x18\x07 \x01(\x04\x12\x32\n\x06header\x18\x08 \x01(\x0b\x32\".avalanche.operator.TraceHeaderMsg\"\xfa\x01\n\x0fNodeSnapshotMsg\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tnode_type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12\x12\n\nstarted_at\x18\x05 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x06 \x01(\x01\x12\x35\n\x05trace\x18\x07 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\x12\x10\n\x08revision\x18\x08 \x01(\x04\x12\x18\n\x10\x65vent_page_token\x18\t \x01(\t\x12\x12\n\x05\x65rror\x18\n \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x9e\x02\n\x0eRunSnapshotMsg\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x32\n\x07summary\x18\x03 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x04 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x1b\n\x13latest_log_sequence\x18\x05 \x01(\x04\x12\x16\n\x0elog_page_token\x18\x06 \x01(\t\x12\x39\n\x08topology\x18\x07 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"\x90\x01\n\x0eRunSummaryPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12/\n\x04runs\x18\x03 \x03(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x85\x01\n\x16LogRecordDescriptorMsg\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x11\n\ttimestamp\x18\x02 \x01(\x01\x12\r\n\x05level\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12\x12\n\nsize_bytes\x18\x05 \x01(\x04\x12\x12\n\nbody_token\x18\x06 \x01(\t\"\x92\x01\n\x07LogPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x38\n\x04logs\x18\x03 \x03(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\"\x8e\x02\n\x17\x41gentEventDescriptorMsg\x12\x16\n\x0e\x65vent_sequence\x18\x01 \x01(\x04\x12\x12\n\nsize_bytes\x18\x02 \x01(\x04\x12\x12\n\nbody_token\x18\x03 \x01(\t\x12\x15\n\rinvocation_id\x18\x04 \x01(\t\x12\x12\n\nevent_kind\x18\x05 \x01(\t\x12\x16\n\titeration\x18\x06 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64uration_ms\x18\x07 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05\x65rror\x18\x08 \x01(\x08\x12\x12\n\ntool_count\x18\t \x01(\r\x12\x15\n\rpredict_count\x18\n \x01(\rB\x0c\n\n_iterationB\x0e\n\x0c_duration_ms\"\xbd\x01\n\x0e\x41gentEventPage\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x16\n\x0e\x61s_of_sequence\x18\x02 \x01(\x04\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12;\n\x06\x65vents\x18\x05 \x03(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\"N\n\nTraceChunk\x12\x10\n\x08revision\x18\x01 \x01(\x04\x12\x13\n\x0b\x63hunk_index\x18\x02 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x04 \x01(\x08\"=\n\x0b\x44\x65tailChunk\x12\x13\n\x0b\x63hunk_index\x18\x01 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x03 \x01(\x08\"\xaf\x01\n\nRunCreated\x12\x32\n\x07summary\x18\x01 \x01(\x0b\x32!.avalanche.operator.RunSummaryMsg\x12\x32\n\x05nodes\x18\x02 \x03(\x0b\x32#.avalanche.operator.NodeSnapshotMsg\x12\x39\n\x08topology\x18\x03 \x01(\x0b\x32\'.avalanche.operator.WorkflowTopologyMsg\"j\n\x10RunStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nstarted_at\x18\x03 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x04 \x01(\x01\x12\x10\n\x08revision\x18\x05 \x01(\x04\"\x9a\x01\n\x11NodeStatusChanged\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x12\n\nstarted_at\x18\x04 \x01(\x01\x12\x10\n\x08\x65nded_at\x18\x05 \x01(\x01\x12\x10\n\x08revision\x18\x06 \x01(\x04\x12\x12\n\x05\x65rror\x18\x07 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"V\n\x0bLogAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x37\n\x03log\x18\x02 \x01(\x0b\x32*.avalanche.operator.LogRecordDescriptorMsg\"q\n\x12\x41gentEventAppended\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12:\n\x05\x65vent\x18\x03 \x01(\x0b\x32+.avalanche.operator.AgentEventDescriptorMsg\"h\n\x0eTraceFinalized\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x35\n\x05trace\x18\x03 \x01(\x0b\x32&.avalanche.operator.TraceDescriptorMsg\"J\n\x0f\x43\x61talogReplaced\x12\x37\n\x07\x63\x61talog\x18\x01 \x01(\x0b\x32&.avalanche.operator.CatalogSnapshotMsg\"\xee\x03\n\x0eOperatorUpdate\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x35\n\x0brun_created\x18\x02 \x01(\x0b\x32\x1e.avalanche.operator.RunCreatedH\x00\x12\x42\n\x12run_status_changed\x18\x03 \x01(\x0b\x32$.avalanche.operator.RunStatusChangedH\x00\x12\x44\n\x13node_status_changed\x18\x04 \x01(\x0b\x32%.avalanche.operator.NodeStatusChangedH\x00\x12\x37\n\x0clog_appended\x18\x05 \x01(\x0b\x32\x1f.avalanche.operator.LogAppendedH\x00\x12\x46\n\x14\x61gent_event_appended\x18\x06 \x01(\x0b\x32&.avalanche.operator.AgentEventAppendedH\x00\x12=\n\x0ftrace_finalized\x18\x07 \x01(\x0b\x32\".avalanche.operator.TraceFinalizedH\x00\x12?\n\x10\x63\x61talog_replaced\x18\x08 \x01(\x0b\x32#.avalanche.operator.CatalogReplacedH\x00\x42\x08\n\x06\x63hange\"?\n\rResetRequired\x12\x15\n\rhistory_floor\x18\x01 \x01(\x04\x12\x17\n\x0flatest_sequence\x18\x02 \x01(\x04\"\xb4\x01\n\x16OperatorUpdateEnvelope\x12\x1c\n\x14operator_instance_id\x18\x01 \x01(\t\x12\x34\n\x06update\x18\x02 \x01(\x0b\x32\".avalanche.operator.OperatorUpdateH\x00\x12;\n\x0ereset_required\x18\x03 \x01(\x0b\x32!.avalanche.operator.ResetRequiredH\x00\x42\t\n\x07payload*`\n\x13\x44\x65scriptorPageOrder\x12!\n\x1d\x44\x45SCRIPTOR_PAGE_ORDER_FORWARD\x10\x00\x12&\n\"DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST\x10\x01\x32\xe6\x08\n\x0fOperatorService\x12O\n\nGetCatalog\x12\x19.avalanche.operator.Empty\x1a&.avalanche.operator.CatalogSnapshotMsg\x12U\n\x08StartRun\x12#.avalanche.operator.StartRunRequest\x1a$.avalanche.operator.StartRunResponse\x12L\n\tCancelRun\x12$.avalanche.operator.CancelRunRequest\x1a\x19.avalanche.operator.Empty\x12S\n\x0cGetRunResult\x12!.avalanche.operator.GetRunRequest\x1a .avalanche.operator.RunResultMsg\x12\x63\n\x10ListRunSummaries\x12+.avalanche.operator.ListRunSummariesRequest\x1a\".avalanche.operator.RunSummaryPage\x12_\n\x0eGetRunSnapshot\x12).avalanche.operator.GetRunSnapshotRequest\x1a\".avalanche.operator.RunSnapshotMsg\x12k\n\x14GetLatestRunSnapshot\x12/.avalanche.operator.GetLatestRunSnapshotRequest\x1a\".avalanche.operator.RunSnapshotMsg\x12L\n\x08ListLogs\x12#.avalanche.operator.ListLogsRequest\x1a\x1b.avalanche.operator.LogPage\x12\x61\n\x0fListAgentEvents\x12*.avalanche.operator.ListAgentEventsRequest\x1a\".avalanche.operator.AgentEventPage\x12S\n\tReadTrace\x12$.avalanche.operator.ReadTraceRequest\x1a\x1e.avalanche.operator.TraceChunk0\x01\x12V\n\nReadDetail\x12%.avalanche.operator.ReadDetailRequest\x1a\x1f.avalanche.operator.DetailChunk0\x01\x12w\n\x15StreamOperatorUpdates\x12\x30.avalanche.operator.StreamOperatorUpdatesRequest\x1a*.avalanche.operator.OperatorUpdateEnvelope0\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -47,6 +47,8 @@ _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_options = b'8\001' _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._loaded_options = None _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_options = b'8\001' + _globals['_DESCRIPTORPAGEORDER']._serialized_start=7255 + _globals['_DESCRIPTORPAGEORDER']._serialized_end=7351 _globals['_EMPTY']._serialized_start=38 _globals['_EMPTY']._serialized_end=45 _globals['_STARTRUNREQUEST']._serialized_start=48 @@ -63,92 +65,94 @@ _globals['_LISTRUNSUMMARIESREQUEST']._serialized_end=531 _globals['_GETRUNSNAPSHOTREQUEST']._serialized_start=533 _globals['_GETRUNSNAPSHOTREQUEST']._serialized_end=626 - _globals['_LISTLOGSREQUEST']._serialized_start=628 - _globals['_LISTLOGSREQUEST']._serialized_end=708 - _globals['_LISTAGENTEVENTSREQUEST']._serialized_start=710 - _globals['_LISTAGENTEVENTSREQUEST']._serialized_end=803 - _globals['_READTRACEREQUEST']._serialized_start=805 - _globals['_READTRACEREQUEST']._serialized_end=904 - _globals['_READDETAILREQUEST']._serialized_start=906 - _globals['_READDETAILREQUEST']._serialized_end=945 - _globals['_STREAMOPERATORUPDATESREQUEST']._serialized_start=947 - _globals['_STREAMOPERATORUPDATESREQUEST']._serialized_end=1031 - _globals['_NODEEDGES']._serialized_start=1033 - _globals['_NODEEDGES']._serialized_end=1062 - _globals['_WORKFLOWTOPOLOGYMSG']._serialized_start=1065 - _globals['_WORKFLOWTOPOLOGYMSG']._serialized_end=1673 - _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_start=1433 - _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_end=1508 - _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_start=1510 - _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_end=1558 - _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_start=1560 - _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_end=1611 - _globals['_WORKFLOWTOPOLOGYMSG_AGENTFIELDSCHEMASJSONENTRY']._serialized_start=1613 - _globals['_WORKFLOWTOPOLOGYMSG_AGENTFIELDSCHEMASJSONENTRY']._serialized_end=1673 - _globals['_FLOWINFOMSG']._serialized_start=1676 - _globals['_FLOWINFOMSG']._serialized_end=2521 - _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_start=1433 - _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_end=1508 - _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_start=1510 - _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_end=1558 - _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_start=1560 - _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_end=1611 - _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_start=2465 - _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_end=2521 - _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_start=2523 - _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_end=2592 - _globals['_SCANTARGETMSG']._serialized_start=2594 - _globals['_SCANTARGETMSG']._serialized_end=2659 - _globals['_CATALOGSNAPSHOTMSG']._serialized_start=2662 - _globals['_CATALOGSNAPSHOTMSG']._serialized_end=2928 - _globals['_RESULTFILEATTACHMENT']._serialized_start=2931 - _globals['_RESULTFILEATTACHMENT']._serialized_end=3077 - _globals['_RUNRESULTMSG']._serialized_start=3079 - _globals['_RUNRESULTMSG']._serialized_end=3170 - _globals['_RUNSUMMARYMSG']._serialized_start=3173 - _globals['_RUNSUMMARYMSG']._serialized_end=3395 - _globals['_TRACEHEADERMSG']._serialized_start=3398 - _globals['_TRACEHEADERMSG']._serialized_end=3616 - _globals['_TRACEDESCRIPTORMSG']._serialized_start=3619 - _globals['_TRACEDESCRIPTORMSG']._serialized_end=3834 - _globals['_NODESNAPSHOTMSG']._serialized_start=3837 - _globals['_NODESNAPSHOTMSG']._serialized_end=4087 - _globals['_RUNSNAPSHOTMSG']._serialized_start=4090 - _globals['_RUNSNAPSHOTMSG']._serialized_end=4376 - _globals['_RUNSUMMARYPAGE']._serialized_start=4379 - _globals['_RUNSUMMARYPAGE']._serialized_end=4523 - _globals['_LOGRECORDDESCRIPTORMSG']._serialized_start=4526 - _globals['_LOGRECORDDESCRIPTORMSG']._serialized_end=4659 - _globals['_LOGPAGE']._serialized_start=4662 - _globals['_LOGPAGE']._serialized_end=4808 - _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_start=4811 - _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_end=5081 - _globals['_AGENTEVENTPAGE']._serialized_start=5084 - _globals['_AGENTEVENTPAGE']._serialized_end=5273 - _globals['_TRACECHUNK']._serialized_start=5275 - _globals['_TRACECHUNK']._serialized_end=5353 - _globals['_DETAILCHUNK']._serialized_start=5355 - _globals['_DETAILCHUNK']._serialized_end=5416 - _globals['_RUNCREATED']._serialized_start=5419 - _globals['_RUNCREATED']._serialized_end=5594 - _globals['_RUNSTATUSCHANGED']._serialized_start=5596 - _globals['_RUNSTATUSCHANGED']._serialized_end=5702 - _globals['_NODESTATUSCHANGED']._serialized_start=5705 - _globals['_NODESTATUSCHANGED']._serialized_end=5859 - _globals['_LOGAPPENDED']._serialized_start=5861 - _globals['_LOGAPPENDED']._serialized_end=5947 - _globals['_AGENTEVENTAPPENDED']._serialized_start=5949 - _globals['_AGENTEVENTAPPENDED']._serialized_end=6062 - _globals['_TRACEFINALIZED']._serialized_start=6064 - _globals['_TRACEFINALIZED']._serialized_end=6168 - _globals['_CATALOGREPLACED']._serialized_start=6170 - _globals['_CATALOGREPLACED']._serialized_end=6244 - _globals['_OPERATORUPDATE']._serialized_start=6247 - _globals['_OPERATORUPDATE']._serialized_end=6741 - _globals['_RESETREQUIRED']._serialized_start=6743 - _globals['_RESETREQUIRED']._serialized_end=6806 - _globals['_OPERATORUPDATEENVELOPE']._serialized_start=6809 - _globals['_OPERATORUPDATEENVELOPE']._serialized_end=6989 - _globals['_OPERATORSERVICE']._serialized_start=6992 - _globals['_OPERATORSERVICE']._serialized_end=8009 + _globals['_GETLATESTRUNSNAPSHOTREQUEST']._serialized_start=628 + _globals['_GETLATESTRUNSNAPSHOTREQUEST']._serialized_end=703 + _globals['_LISTLOGSREQUEST']._serialized_start=706 + _globals['_LISTLOGSREQUEST']._serialized_end=884 + _globals['_LISTAGENTEVENTSREQUEST']._serialized_start=887 + _globals['_LISTAGENTEVENTSREQUEST']._serialized_end=1067 + _globals['_READTRACEREQUEST']._serialized_start=1069 + _globals['_READTRACEREQUEST']._serialized_end=1168 + _globals['_READDETAILREQUEST']._serialized_start=1170 + _globals['_READDETAILREQUEST']._serialized_end=1209 + _globals['_STREAMOPERATORUPDATESREQUEST']._serialized_start=1211 + _globals['_STREAMOPERATORUPDATESREQUEST']._serialized_end=1295 + _globals['_NODEEDGES']._serialized_start=1297 + _globals['_NODEEDGES']._serialized_end=1326 + _globals['_WORKFLOWTOPOLOGYMSG']._serialized_start=1329 + _globals['_WORKFLOWTOPOLOGYMSG']._serialized_end=1937 + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_start=1697 + _globals['_WORKFLOWTOPOLOGYMSG_GRAPHENTRY']._serialized_end=1772 + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_start=1774 + _globals['_WORKFLOWTOPOLOGYMSG_NODETYPESENTRY']._serialized_end=1822 + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_start=1824 + _globals['_WORKFLOWTOPOLOGYMSG_DISPLAYNAMESENTRY']._serialized_end=1875 + _globals['_WORKFLOWTOPOLOGYMSG_AGENTFIELDSCHEMASJSONENTRY']._serialized_start=1877 + _globals['_WORKFLOWTOPOLOGYMSG_AGENTFIELDSCHEMASJSONENTRY']._serialized_end=1937 + _globals['_FLOWINFOMSG']._serialized_start=1940 + _globals['_FLOWINFOMSG']._serialized_end=2785 + _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_start=1697 + _globals['_FLOWINFOMSG_GRAPHENTRY']._serialized_end=1772 + _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_start=1774 + _globals['_FLOWINFOMSG_NODETYPESENTRY']._serialized_end=1822 + _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_start=1824 + _globals['_FLOWINFOMSG_DISPLAYNAMESENTRY']._serialized_end=1875 + _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_start=2729 + _globals['_FLOWINFOMSG_AGENTMETADATAJSONENTRY']._serialized_end=2785 + _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_start=2787 + _globals['_DISCOVERYDIAGNOSTICMSG']._serialized_end=2856 + _globals['_SCANTARGETMSG']._serialized_start=2858 + _globals['_SCANTARGETMSG']._serialized_end=2923 + _globals['_CATALOGSNAPSHOTMSG']._serialized_start=2926 + _globals['_CATALOGSNAPSHOTMSG']._serialized_end=3192 + _globals['_RESULTFILEATTACHMENT']._serialized_start=3195 + _globals['_RESULTFILEATTACHMENT']._serialized_end=3341 + _globals['_RUNRESULTMSG']._serialized_start=3343 + _globals['_RUNRESULTMSG']._serialized_end=3434 + _globals['_RUNSUMMARYMSG']._serialized_start=3437 + _globals['_RUNSUMMARYMSG']._serialized_end=3659 + _globals['_TRACEHEADERMSG']._serialized_start=3662 + _globals['_TRACEHEADERMSG']._serialized_end=3880 + _globals['_TRACEDESCRIPTORMSG']._serialized_start=3883 + _globals['_TRACEDESCRIPTORMSG']._serialized_end=4098 + _globals['_NODESNAPSHOTMSG']._serialized_start=4101 + _globals['_NODESNAPSHOTMSG']._serialized_end=4351 + _globals['_RUNSNAPSHOTMSG']._serialized_start=4354 + _globals['_RUNSNAPSHOTMSG']._serialized_end=4640 + _globals['_RUNSUMMARYPAGE']._serialized_start=4643 + _globals['_RUNSUMMARYPAGE']._serialized_end=4787 + _globals['_LOGRECORDDESCRIPTORMSG']._serialized_start=4790 + _globals['_LOGRECORDDESCRIPTORMSG']._serialized_end=4923 + _globals['_LOGPAGE']._serialized_start=4926 + _globals['_LOGPAGE']._serialized_end=5072 + _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_start=5075 + _globals['_AGENTEVENTDESCRIPTORMSG']._serialized_end=5345 + _globals['_AGENTEVENTPAGE']._serialized_start=5348 + _globals['_AGENTEVENTPAGE']._serialized_end=5537 + _globals['_TRACECHUNK']._serialized_start=5539 + _globals['_TRACECHUNK']._serialized_end=5617 + _globals['_DETAILCHUNK']._serialized_start=5619 + _globals['_DETAILCHUNK']._serialized_end=5680 + _globals['_RUNCREATED']._serialized_start=5683 + _globals['_RUNCREATED']._serialized_end=5858 + _globals['_RUNSTATUSCHANGED']._serialized_start=5860 + _globals['_RUNSTATUSCHANGED']._serialized_end=5966 + _globals['_NODESTATUSCHANGED']._serialized_start=5969 + _globals['_NODESTATUSCHANGED']._serialized_end=6123 + _globals['_LOGAPPENDED']._serialized_start=6125 + _globals['_LOGAPPENDED']._serialized_end=6211 + _globals['_AGENTEVENTAPPENDED']._serialized_start=6213 + _globals['_AGENTEVENTAPPENDED']._serialized_end=6326 + _globals['_TRACEFINALIZED']._serialized_start=6328 + _globals['_TRACEFINALIZED']._serialized_end=6432 + _globals['_CATALOGREPLACED']._serialized_start=6434 + _globals['_CATALOGREPLACED']._serialized_end=6508 + _globals['_OPERATORUPDATE']._serialized_start=6511 + _globals['_OPERATORUPDATE']._serialized_end=7005 + _globals['_RESETREQUIRED']._serialized_start=7007 + _globals['_RESETREQUIRED']._serialized_end=7070 + _globals['_OPERATORUPDATEENVELOPE']._serialized_start=7073 + _globals['_OPERATORUPDATEENVELOPE']._serialized_end=7253 + _globals['_OPERATORSERVICE']._serialized_start=7354 + _globals['_OPERATORSERVICE']._serialized_end=8480 # @@protoc_insertion_point(module_scope) diff --git a/src/runtime/operator/proto/operator_pb2.pyi b/src/runtime/operator/proto/operator_pb2.pyi index 0bb3291..3387d50 100644 --- a/src/runtime/operator/proto/operator_pb2.pyi +++ b/src/runtime/operator/proto/operator_pb2.pyi @@ -1,4 +1,5 @@ from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from collections.abc import Iterable as _Iterable, Mapping as _Mapping @@ -6,6 +7,13 @@ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor +class DescriptorPageOrder(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + DESCRIPTOR_PAGE_ORDER_FORWARD: _ClassVar[DescriptorPageOrder] + DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST: _ClassVar[DescriptorPageOrder] +DESCRIPTOR_PAGE_ORDER_FORWARD: DescriptorPageOrder +DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST: DescriptorPageOrder + class Empty(_message.Message): __slots__ = () def __init__(self) -> None: ... @@ -78,25 +86,43 @@ class GetRunSnapshotRequest(_message.Message): as_of_sequence: int def __init__(self, run_id: _Optional[str] = ..., operator_instance_id: _Optional[str] = ..., as_of_sequence: _Optional[int] = ...) -> None: ... +class GetLatestRunSnapshotRequest(_message.Message): + __slots__ = ("run_id", "operator_instance_id") + RUN_ID_FIELD_NUMBER: _ClassVar[int] + OPERATOR_INSTANCE_ID_FIELD_NUMBER: _ClassVar[int] + run_id: str + operator_instance_id: str + def __init__(self, run_id: _Optional[str] = ..., operator_instance_id: _Optional[str] = ...) -> None: ... + class ListLogsRequest(_message.Message): - __slots__ = ("page_token", "after_sequence", "page_size") + __slots__ = ("page_token", "after_sequence", "page_size", "before_sequence", "node_id", "order") PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int] AFTER_SEQUENCE_FIELD_NUMBER: _ClassVar[int] PAGE_SIZE_FIELD_NUMBER: _ClassVar[int] + BEFORE_SEQUENCE_FIELD_NUMBER: _ClassVar[int] + NODE_ID_FIELD_NUMBER: _ClassVar[int] + ORDER_FIELD_NUMBER: _ClassVar[int] page_token: str after_sequence: int page_size: int - def __init__(self, page_token: _Optional[str] = ..., after_sequence: _Optional[int] = ..., page_size: _Optional[int] = ...) -> None: ... + before_sequence: int + node_id: str + order: DescriptorPageOrder + def __init__(self, page_token: _Optional[str] = ..., after_sequence: _Optional[int] = ..., page_size: _Optional[int] = ..., before_sequence: _Optional[int] = ..., node_id: _Optional[str] = ..., order: _Optional[_Union[DescriptorPageOrder, str]] = ...) -> None: ... class ListAgentEventsRequest(_message.Message): - __slots__ = ("page_token", "after_event_sequence", "page_size") + __slots__ = ("page_token", "after_event_sequence", "page_size", "before_event_sequence", "order") PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int] AFTER_EVENT_SEQUENCE_FIELD_NUMBER: _ClassVar[int] PAGE_SIZE_FIELD_NUMBER: _ClassVar[int] + BEFORE_EVENT_SEQUENCE_FIELD_NUMBER: _ClassVar[int] + ORDER_FIELD_NUMBER: _ClassVar[int] page_token: str after_event_sequence: int page_size: int - def __init__(self, page_token: _Optional[str] = ..., after_event_sequence: _Optional[int] = ..., page_size: _Optional[int] = ...) -> None: ... + before_event_sequence: int + order: DescriptorPageOrder + def __init__(self, page_token: _Optional[str] = ..., after_event_sequence: _Optional[int] = ..., page_size: _Optional[int] = ..., before_event_sequence: _Optional[int] = ..., order: _Optional[_Union[DescriptorPageOrder, str]] = ...) -> None: ... class ReadTraceRequest(_message.Message): __slots__ = ("run_id", "node_id", "revision", "operator_instance_id") diff --git a/src/runtime/operator/proto/operator_pb2_grpc.py b/src/runtime/operator/proto/operator_pb2_grpc.py index 6db1488..59fc129 100644 --- a/src/runtime/operator/proto/operator_pb2_grpc.py +++ b/src/runtime/operator/proto/operator_pb2_grpc.py @@ -70,6 +70,11 @@ def __init__(self, channel): request_serializer=operator__pb2.GetRunSnapshotRequest.SerializeToString, response_deserializer=operator__pb2.RunSnapshotMsg.FromString, _registered_method=True) + self.GetLatestRunSnapshot = channel.unary_unary( + '/avalanche.operator.OperatorService/GetLatestRunSnapshot', + request_serializer=operator__pb2.GetLatestRunSnapshotRequest.SerializeToString, + response_deserializer=operator__pb2.RunSnapshotMsg.FromString, + _registered_method=True) self.ListLogs = channel.unary_unary( '/avalanche.operator.OperatorService/ListLogs', request_serializer=operator__pb2.ListLogsRequest.SerializeToString, @@ -142,6 +147,12 @@ def GetRunSnapshot(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetLatestRunSnapshot(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def ListLogs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -205,6 +216,11 @@ def add_OperatorServiceServicer_to_server(servicer, server): request_deserializer=operator__pb2.GetRunSnapshotRequest.FromString, response_serializer=operator__pb2.RunSnapshotMsg.SerializeToString, ), + 'GetLatestRunSnapshot': grpc.unary_unary_rpc_method_handler( + servicer.GetLatestRunSnapshot, + request_deserializer=operator__pb2.GetLatestRunSnapshotRequest.FromString, + response_serializer=operator__pb2.RunSnapshotMsg.SerializeToString, + ), 'ListLogs': grpc.unary_unary_rpc_method_handler( servicer.ListLogs, request_deserializer=operator__pb2.ListLogsRequest.FromString, @@ -409,6 +425,33 @@ def GetRunSnapshot(request, metadata, _registered_method=True) + @staticmethod + def GetLatestRunSnapshot(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/avalanche.operator.OperatorService/GetLatestRunSnapshot', + operator__pb2.GetLatestRunSnapshotRequest.SerializeToString, + operator__pb2.RunSnapshotMsg.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def ListLogs(request, target, diff --git a/src/runtime/operator/web_assets/assets/index-BuH1gsyY.js b/src/runtime/operator/web_assets/assets/index-BuH1gsyY.js deleted file mode 100644 index b047b51..0000000 --- a/src/runtime/operator/web_assets/assets/index-BuH1gsyY.js +++ /dev/null @@ -1,9 +0,0 @@ -import{r as Dm,a as _m,b as Z,j as p,H as Kd,P as Zd,M as Mm,i as wm,B as Rm,C as Um,c as Bm}from"./graph-CoDTrhFP.js";import{S as qm,M as W,r as F,U as R,W as S,s as Oe,G as Cm}from"./protobuf-BR9ifi4u.js";import{E as Da,a as Lm,j as Hm,k as Vm}from"./editor-Dh6wG2B-.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const c of f)if(c.type==="childList")for(const v of c.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function i(f){const c={};return f.integrity&&(c.integrity=f.integrity),f.referrerPolicy&&(c.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?c.credentials="include":f.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(f){if(f.ep)return;f.ep=!0;const c=i(f);fetch(f.href,c)}})();var Tc={exports:{}},_a={},kc={exports:{}},zc={};var Jd;function Ym(){return Jd||(Jd=1,(function(m){function a(_,q){var K=_.length;_.push(q);t:for(;0>>1,Y=_[w];if(0>>1;wf(ot,K))Btf(xe,ot)?(_[w]=xe,_[Bt]=K,w=Bt):(_[w]=ot,_[ct]=K,w=ct);else if(Btf(xe,K))_[w]=xe,_[Bt]=K,w=Bt;else break t}}return q}function f(_,q){var K=_.sortIndex-q.sortIndex;return K!==0?K:_.id-q.id}if(m.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;m.unstable_now=function(){return c.now()}}else{var v=Date,d=v.now();m.unstable_now=function(){return v.now()-d}}var g=[],y=[],z=1,x=null,B=3,U=!1,H=!1,J=!1,et=!1,L=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,tt=typeof setImmediate<"u"?setImmediate:null;function ht(_){for(var q=i(y);q!==null;){if(q.callback===null)o(y);else if(q.startTime<=_)o(y),q.sortIndex=q.expirationTime,a(g,q);else break;q=i(y)}}function at(_){if(J=!1,ht(_),!H)if(i(g)!==null)H=!0,Ut||(Ut=!0,Lt());else{var q=i(y);q!==null&&he(at,q.startTime-_)}}var Ut=!1,$=-1,Tt=5,re=-1;function Qt(){return et?!0:!(m.unstable_now()-re_&&Qt());){var w=x.callback;if(typeof w=="function"){x.callback=null,B=x.priorityLevel;var Y=w(x.expirationTime<=_);if(_=m.unstable_now(),typeof Y=="function"){x.callback=Y,ht(_),q=!0;break e}x===i(g)&&o(g),ht(_)}else o(g);x=i(g)}if(x!==null)q=!0;else{var bt=i(y);bt!==null&&he(at,bt.startTime-_),q=!1}}break t}finally{x=null,B=K,U=!1}q=void 0}}finally{q?Lt():Ut=!1}}}var Lt;if(typeof tt=="function")Lt=function(){tt(Ot)};else if(typeof MessageChannel<"u"){var Zt=new MessageChannel,de=Zt.port2;Zt.port1.onmessage=Ot,Lt=function(){de.postMessage(null)}}else Lt=function(){L(Ot,0)};function he(_,q){$=L(function(){_(m.unstable_now())},q)}m.unstable_IdlePriority=5,m.unstable_ImmediatePriority=1,m.unstable_LowPriority=4,m.unstable_NormalPriority=3,m.unstable_Profiling=null,m.unstable_UserBlockingPriority=2,m.unstable_cancelCallback=function(_){_.callback=null},m.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Tt=0<_?Math.floor(1e3/_):5},m.unstable_getCurrentPriorityLevel=function(){return B},m.unstable_next=function(_){switch(B){case 1:case 2:case 3:var q=3;break;default:q=B}var K=B;B=q;try{return _()}finally{B=K}},m.unstable_requestPaint=function(){et=!0},m.unstable_runWithPriority=function(_,q){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var K=B;B=_;try{return q()}finally{B=K}},m.unstable_scheduleCallback=function(_,q,K){var w=m.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0w?(_.sortIndex=K,a(y,_),i(g)===null&&_===i(y)&&(J?(Q($),$=-1):J=!0,he(at,K-w))):(_.sortIndex=Y,a(g,_),H||U||(H=!0,Ut||(Ut=!0,Lt()))),_},m.unstable_shouldYield=Qt,m.unstable_wrapCallback=function(_){var q=B;return function(){var K=B;B=q;try{return _.apply(this,arguments)}finally{B=K}}}})(zc)),zc}var $d;function Gm(){return $d||($d=1,kc.exports=Ym()),kc.exports}var Wd;function Xm(){if(Wd)return _a;Wd=1;var m=Gm(),a=Dm(),i=_m();function o(t){var e="https://react.dev/errors/"+t;if(1Y||(t.current=w[Y],w[Y]=null,Y--)}function ot(t,e){Y++,w[Y]=t.current,t.current=e}var Bt=bt(null),xe=bt(null),Ie=bt(null),wa=bt(null);function Ra(t,e){switch(ot(Ie,e),ot(xe,t),ot(Bt,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?md(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=md(e),t=yd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ct(Bt),ot(Bt,t)}function Zn(){ct(Bt),ct(xe),ct(Ie)}function nu(t){t.memoizedState!==null&&ot(wa,t);var e=Bt.current,n=yd(e,t.type);e!==n&&(ot(xe,t),ot(Bt,n))}function Ua(t){xe.current===t&&(ct(Bt),ct(xe)),wa.current===t&&(ct(wa),Aa._currentValue=K)}var lu,Gc;function On(t){if(lu===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);lu=e&&e[1]||"",Gc=-1)":-1u||b[l]!==N[u]){var j=` -`+b[l].replace(" at new "," at ");return t.displayName&&j.includes("")&&(j=j.replace("",t.displayName)),j}while(1<=l&&0<=u);break}}}finally{au=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?On(n):""}function sh(t,e){switch(t.tag){case 26:case 27:case 5:return On(t.type);case 16:return On("Lazy");case 13:return t.child!==e&&e!==null?On("Suspense Fallback"):On("Suspense");case 19:return On("SuspenseList");case 0:case 15:return iu(t.type,!1);case 11:return iu(t.type.render,!1);case 1:return iu(t.type,!0);case 31:return On("Activity");default:return""}}function Xc(t){try{var e="",n=null;do e+=sh(t,n),n=t,t=t.return;while(t);return e}catch(l){return` -Error generating stack: `+l.message+` -`+l.stack}}var uu=Object.prototype.hasOwnProperty,su=m.unstable_scheduleCallback,cu=m.unstable_cancelCallback,ch=m.unstable_shouldYield,oh=m.unstable_requestPaint,ee=m.unstable_now,fh=m.unstable_getCurrentPriorityLevel,Qc=m.unstable_ImmediatePriority,Kc=m.unstable_UserBlockingPriority,Ba=m.unstable_NormalPriority,rh=m.unstable_LowPriority,Zc=m.unstable_IdlePriority,dh=m.log,hh=m.unstable_setDisableYieldValue,Cl=null,ne=null;function Pe(t){if(typeof dh=="function"&&hh(t),ne&&typeof ne.setStrictMode=="function")try{ne.setStrictMode(Cl,t)}catch{}}var le=Math.clz32?Math.clz32:yh,gh=Math.log,mh=Math.LN2;function yh(t){return t>>>=0,t===0?32:31-(gh(t)/mh|0)|0}var qa=256,Ca=262144,La=4194304;function xn(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ha(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var u=0,s=t.suspendedLanes,r=t.pingedLanes;t=t.warmLanes;var h=l&134217727;return h!==0?(l=h&~s,l!==0?u=xn(l):(r&=h,r!==0?u=xn(r):n||(n=h&~t,n!==0&&(u=xn(n))))):(h=l&~s,h!==0?u=xn(h):r!==0?u=xn(r):n||(n=l&~t,n!==0&&(u=xn(n)))),u===0?0:e!==0&&e!==u&&(e&s)===0&&(s=u&-u,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:u}function Ll(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function ph(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jc(){var t=La;return La<<=1,(La&62914560)===0&&(La=4194304),t}function ou(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Hl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function vh(t,e,n,l,u,s){var r=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,b=t.expirationTimes,N=t.hiddenUpdates;for(n=r&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Eh=/[\n"\\]/g;function me(t){return t.replace(Eh,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function mu(t,e,n,l,u,s,r,h){t.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.type=r:t.removeAttribute("type"),e!=null?r==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ge(e)):t.value!==""+ge(e)&&(t.value=""+ge(e)):r!=="submit"&&r!=="reset"||t.removeAttribute("value"),e!=null?yu(t,r,ge(e)):n!=null?yu(t,r,ge(n)):l!=null&&t.removeAttribute("value"),u==null&&s!=null&&(t.defaultChecked=!!s),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+ge(h):t.removeAttribute("name")}function so(t,e,n,l,u,s,r,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){gu(t);return}n=n!=null?""+ge(n):"",e=e!=null?""+ge(e):n,h||e===t.value||(t.value=e),t.defaultValue=e}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=h?t.checked:!!l,t.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.name=r),gu(t)}function yu(t,e,n){e==="number"&&Ga(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Pn(t,e,n,l){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tu=!1;if(Ue)try{var Xl={};Object.defineProperty(Xl,"passive",{get:function(){Tu=!0}}),window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{Tu=!1}var en=null,ku=null,Qa=null;function mo(){if(Qa)return Qa;var t,e=ku,n=e.length,l,u="value"in en?en.value:en.textContent,s=u.length;for(t=0;t=Zl),To=" ",ko=!1;function zo(t,e){switch(t){case"keyup":return Ih.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ll=!1;function tg(t,e){switch(t){case"compositionend":return Eo(e);case"keypress":return e.which!==32?null:(ko=!0,To);case"textInput":return t=e.data,t===To&&ko?null:t;default:return null}}function eg(t,e){if(ll)return t==="compositionend"||!Ou&&zo(t,e)?(t=mo(),Qa=ku=en=null,ll=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Mo(n)}}function Ro(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ro(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Uo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ga(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ga(t.document)}return e}function Du(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var og=Ue&&"documentMode"in document&&11>=document.documentMode,al=null,_u=null,Fl=null,Mu=!1;function Bo(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mu||al==null||al!==Ga(l)||(l=al,"selectionStart"in l&&Du(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Fl&&Wl(Fl,l)||(Fl=l,l=Ci(_u,"onSelect"),0>=r,u-=r,je=1<<32-le(e)+u|n<P?(ut=V,V=null):ut=V.sibling;var rt=A(k,V,E[P],D);if(rt===null){V===null&&(V=ut);break}t&&V&&rt.alternate===null&&e(k,V),T=s(rt,T,P),ft===null?G=rt:ft.sibling=rt,ft=rt,V=ut}if(P===E.length)return n(k,V),st&&qe(k,P),G;if(V===null){for(;PP?(ut=V,V=null):ut=V.sibling;var En=A(k,V,rt.value,D);if(En===null){V===null&&(V=ut);break}t&&V&&En.alternate===null&&e(k,V),T=s(En,T,P),ft===null?G=En:ft.sibling=En,ft=En,V=ut}if(rt.done)return n(k,V),st&&qe(k,P),G;if(V===null){for(;!rt.done;P++,rt=E.next())rt=M(k,rt.value,D),rt!==null&&(T=s(rt,T,P),ft===null?G=rt:ft.sibling=rt,ft=rt);return st&&qe(k,P),G}for(V=l(V);!rt.done;P++,rt=E.next())rt=O(V,k,P,rt.value,D),rt!==null&&(t&&rt.alternate!==null&&V.delete(rt.key===null?P:rt.key),T=s(rt,T,P),ft===null?G=rt:ft.sibling=rt,ft=rt);return t&&V.forEach(function(jm){return e(k,jm)}),st&&qe(k,P),G}function vt(k,T,E,D){if(typeof E=="object"&&E!==null&&E.type===J&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case U:t:{for(var G=E.key;T!==null;){if(T.key===G){if(G=E.type,G===J){if(T.tag===7){n(k,T.sibling),D=u(T,E.props.children),D.return=k,k=D;break t}}else if(T.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Tt&&Ln(G)===T.type){n(k,T.sibling),D=u(T,E.props),la(D,E),D.return=k,k=D;break t}n(k,T);break}else e(k,T);T=T.sibling}E.type===J?(D=Rn(E.props.children,k.mode,D,E.key),D.return=k,k=D):(D=ei(E.type,E.key,E.props,null,k.mode,D),la(D,E),D.return=k,k=D)}return r(k);case H:t:{for(G=E.key;T!==null;){if(T.key===G)if(T.tag===4&&T.stateNode.containerInfo===E.containerInfo&&T.stateNode.implementation===E.implementation){n(k,T.sibling),D=u(T,E.children||[]),D.return=k,k=D;break t}else{n(k,T);break}else e(k,T);T=T.sibling}D=Lu(E,k.mode,D),D.return=k,k=D}return r(k);case Tt:return E=Ln(E),vt(k,T,E,D)}if(he(E))return C(k,T,E,D);if(Lt(E)){if(G=Lt(E),typeof G!="function")throw Error(o(150));return E=G.call(E),X(k,T,E,D)}if(typeof E.then=="function")return vt(k,T,ci(E),D);if(E.$$typeof===tt)return vt(k,T,ai(k,E),D);oi(k,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,T!==null&&T.tag===6?(n(k,T.sibling),D=u(T,E),D.return=k,k=D):(n(k,T),D=Cu(E,k.mode,D),D.return=k,k=D),r(k)):n(k,T)}return function(k,T,E,D){try{na=0;var G=vt(k,T,E,D);return ml=null,G}catch(V){if(V===gl||V===ui)throw V;var ft=ie(29,V,null,k.mode);return ft.lanes=D,ft.return=k,ft}}}var Vn=uf(!0),sf=uf(!1),sn=!1;function Fu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Iu(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function on(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(dt&2)!==0){var u=l.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),l.pending=e,e=ti(t),Go(t,null,n),e}return Pa(t,l,e,n),ti(t)}function aa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Wc(t,n)}}function Pu(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var u=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?u=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?u=s=e:s=s.next=e}else u=s=e;n={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var ts=!1;function ia(){if(ts){var t=hl;if(t!==null)throw t}}function ua(t,e,n,l){ts=!1;var u=t.updateQueue;sn=!1;var s=u.firstBaseUpdate,r=u.lastBaseUpdate,h=u.shared.pending;if(h!==null){u.shared.pending=null;var b=h,N=b.next;b.next=null,r===null?s=N:r.next=N,r=b;var j=t.alternate;j!==null&&(j=j.updateQueue,h=j.lastBaseUpdate,h!==r&&(h===null?j.firstBaseUpdate=N:h.next=N,j.lastBaseUpdate=b))}if(s!==null){var M=u.baseState;r=0,j=N=b=null,h=s;do{var A=h.lane&-536870913,O=A!==h.lane;if(O?(it&A)===A:(l&A)===A){A!==0&&A===dl&&(ts=!0),j!==null&&(j=j.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var C=t,X=h;A=e;var vt=n;switch(X.tag){case 1:if(C=X.payload,typeof C=="function"){M=C.call(vt,M,A);break t}M=C;break t;case 3:C.flags=C.flags&-65537|128;case 0:if(C=X.payload,A=typeof C=="function"?C.call(vt,M,A):C,A==null)break t;M=x({},M,A);break t;case 2:sn=!0}}A=h.callback,A!==null&&(t.flags|=64,O&&(t.flags|=8192),O=u.callbacks,O===null?u.callbacks=[A]:O.push(A))}else O={lane:A,tag:h.tag,payload:h.payload,callback:h.callback,next:null},j===null?(N=j=O,b=M):j=j.next=O,r|=A;if(h=h.next,h===null){if(h=u.shared.pending,h===null)break;O=h,h=O.next,O.next=null,u.lastBaseUpdate=O,u.shared.pending=null}}while(!0);j===null&&(b=M),u.baseState=b,u.firstBaseUpdate=N,u.lastBaseUpdate=j,s===null&&(u.shared.lanes=0),gn|=r,t.lanes=r,t.memoizedState=M}}function cf(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function of(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ts?s:8;var r=_.T,h={};_.T=h,bs(t,!1,e,n);try{var b=u(),N=_.S;if(N!==null&&N(h,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var j=vg(b,l);oa(t,e,j,fe(t))}else oa(t,e,l,fe(t))}catch(M){oa(t,e,{then:function(){},status:"rejected",reason:M},fe())}finally{q.p=s,r!==null&&h.types!==null&&(r.types=h.types),_.T=r}}function Eg(){}function ps(t,e,n,l){if(t.tag!==5)throw Error(o(476));var u=Vf(t).queue;Hf(t,u,e,K,n===null?Eg:function(){return Yf(t),n(l)})}function Vf(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:K},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Yf(t){var e=Vf(t);e.next===null&&(e=t.alternate.memoizedState),oa(t,e.next.queue,{},fe())}function vs(){return Yt(Aa)}function Gf(){return jt().memoizedState}function Xf(){return jt().memoizedState}function Ng(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=fe();t=cn(n);var l=on(e,t,n);l!==null&&(te(l,e,n),aa(l,e,n)),e={cache:Zu()},t.payload=e;return}e=e.return}}function Ag(t,e,n){var l=fe();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bi(t)?Kf(e,n):(n=Bu(t,e,n,l),n!==null&&(te(n,t,l),Zf(n,e,l)))}function Qf(t,e,n){var l=fe();oa(t,e,n,l)}function oa(t,e,n,l){var u={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bi(t))Kf(e,u);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var r=e.lastRenderedState,h=s(r,n);if(u.hasEagerState=!0,u.eagerState=h,ae(h,r))return Pa(t,e,u,0),St===null&&Ia(),!1}catch{}if(n=Bu(t,e,u,l),n!==null)return te(n,t,l),Zf(n,e,l),!0}return!1}function bs(t,e,n,l){if(l={lane:2,revertLane:Fs(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},bi(t)){if(e)throw Error(o(479))}else e=Bu(t,n,l,2),e!==null&&te(e,t,2)}function bi(t){var e=t.alternate;return t===I||e!==null&&e===I}function Kf(t,e){pl=di=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Zf(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Wc(t,n)}}var fa={readContext:Yt,use:mi,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};fa.useEffectEvent=Nt;var Jf={readContext:Yt,use:mi,useCallback:function(t,e){return Kt().memoizedState=[t,e===void 0?null:e],t},useContext:Yt,useEffect:_f,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,pi(4194308,4,Uf.bind(null,e,t),n)},useLayoutEffect:function(t,e){return pi(4194308,4,t,e)},useInsertionEffect:function(t,e){pi(4,2,t,e)},useMemo:function(t,e){var n=Kt();e=e===void 0?null:e;var l=t();if(Yn){Pe(!0);try{t()}finally{Pe(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=Kt();if(n!==void 0){var u=n(e);if(Yn){Pe(!0);try{n(e)}finally{Pe(!1)}}}else u=e;return l.memoizedState=l.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},l.queue=t,t=t.dispatch=Ag.bind(null,I,t),[l.memoizedState,t]},useRef:function(t){var e=Kt();return t={current:t},e.memoizedState=t},useState:function(t){t=ds(t);var e=t.queue,n=Qf.bind(null,I,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(t,e){var n=Kt();return ys(n,t,e)},useTransition:function(){var t=ds(!1);return t=Hf.bind(null,I,t.queue,!0,!1),Kt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=I,u=Kt();if(st){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),St===null)throw Error(o(349));(it&127)!==0||mf(l,e,n)}u.memoizedState=n;var s={value:n,getSnapshot:e};return u.queue=s,_f(pf.bind(null,l,s,t),[t]),l.flags|=2048,bl(9,{destroy:void 0},yf.bind(null,l,s,n,e),null),n},useId:function(){var t=Kt(),e=St.identifierPrefix;if(st){var n=De,l=je;n=(l&~(1<<32-le(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=hi++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(u,{is:l.is}):r.createElement(u)}}s[Ht]=e,s[Jt]=l;t:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break t;for(;r.sibling===null;){if(r.return===null||r.return===e)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=s;t:switch(Xt(s,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&Ge(e)}}return zt(e),ws(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Ge(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(o(166));if(t=Ie.current,fl(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,u=Vt,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}t[Ht]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||hd(t.nodeValue,n)),t||an(e,!0)}else t=Li(t).createTextNode(l),t[Ht]=e,e.stateNode=t}return zt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=fl(e),n!==null){if(t===null){if(!l)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Ht]=e}else Un(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;zt(e),t=!1}else n=Gu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(se(e),e):(se(e),null);if((e.flags&128)!==0)throw Error(o(558))}return zt(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=fl(e),l!==null&&l.dehydrated!==null){if(t===null){if(!u)throw Error(o(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Ht]=e}else Un(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;zt(e),u=!1}else u=Gu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(se(e),e):(se(e),null)}return se(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Ei(e,e.updateQueue),zt(e),null);case 4:return Zn(),t===null&&ec(e.stateNode.containerInfo),zt(e),null;case 10:return Le(e.type),zt(e),null;case 19:if(ct(xt),l=e.memoizedState,l===null)return zt(e),null;if(u=(e.flags&128)!==0,s=l.rendering,s===null)if(u)da(l,!1);else{if(At!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=ri(t),s!==null){for(e.flags|=128,da(l,!1),t=s.updateQueue,e.updateQueue=t,Ei(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Xo(n,t),n=n.sibling;return ot(xt,xt.current&1|2),st&&qe(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&ee()>ji&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304)}else{if(!u)if(t=ri(s),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,Ei(e,t),da(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!st)return zt(e),null}else 2*ee()-l.renderingStartTime>ji&&n!==536870912&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304);l.isBackwards?(s.sibling=e.child,e.child=s):(t=l.last,t!==null?t.sibling=s:e.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ee(),t.sibling=null,n=xt.current,ot(xt,u?n&1|2:n&1),st&&qe(e,l.treeForkCount),t):(zt(e),null);case 22:case 23:return se(e),ns(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(zt(e),e.subtreeFlags&6&&(e.flags|=8192)):zt(e),n=e.updateQueue,n!==null&&Ei(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&ct(Cn),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Le(Dt),zt(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function _g(t,e){switch(Vu(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Le(Dt),Zn(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ua(e),null;case 31:if(e.memoizedState!==null){if(se(e),e.alternate===null)throw Error(o(340));Un()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(se(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));Un()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(xt),null;case 4:return Zn(),null;case 10:return Le(e.type),null;case 22:case 23:return se(e),ns(),t!==null&&ct(Cn),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Le(Dt),null;case 25:return null;default:return null}}function vr(t,e){switch(Vu(e),e.tag){case 3:Le(Dt),Zn();break;case 26:case 27:case 5:Ua(e);break;case 4:Zn();break;case 31:e.memoizedState!==null&&se(e);break;case 13:se(e);break;case 19:ct(xt);break;case 10:Le(e.type);break;case 22:case 23:se(e),ns(),t!==null&&ct(Cn);break;case 24:Le(Dt)}}function ha(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var u=l.next;n=u;do{if((n.tag&t)===t){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==u)}}catch(h){mt(e,e.return,h)}}function dn(t,e,n){try{var l=e.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var s=u.next;l=s;do{if((l.tag&t)===t){var r=l.inst,h=r.destroy;if(h!==void 0){r.destroy=void 0,u=e;var b=n,N=h;try{N()}catch(j){mt(u,b,j)}}}l=l.next}while(l!==s)}}catch(j){mt(e,e.return,j)}}function br(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{of(e,n)}catch(l){mt(t,t.return,l)}}}function Sr(t,e,n){n.props=Gn(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){mt(t,e,l)}}function ga(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(u){mt(t,e,u)}}function _e(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(u){mt(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){mt(t,e,u)}else n.current=null}function Tr(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(u){mt(t,t.return,u)}}function Rs(t,e,n){try{var l=t.stateNode;Pg(l,t.type,n,e),l[Jt]=e}catch(u){mt(t,t.return,u)}}function kr(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bn(t.type)||t.tag===4}function Us(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||kr(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Bs(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Re));else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Bs(t,e,n),t=t.sibling;t!==null;)Bs(t,e,n),t=t.sibling}function Ni(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ni(t,e,n),t=t.sibling;t!==null;)Ni(t,e,n),t=t.sibling}function zr(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);Xt(e,l,n),e[Ht]=t,e[Jt]=n}catch(s){mt(t,t.return,s)}}var Xe=!1,wt=!1,qs=!1,Er=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function Mg(t,e){if(t=t.containerInfo,ac=Ki,t=Uo(t),Du(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var u=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var r=0,h=-1,b=-1,N=0,j=0,M=t,A=null;e:for(;;){for(var O;M!==n||u!==0&&M.nodeType!==3||(h=r+u),M!==s||l!==0&&M.nodeType!==3||(b=r+l),M.nodeType===3&&(r+=M.nodeValue.length),(O=M.firstChild)!==null;)A=M,M=O;for(;;){if(M===t)break e;if(A===n&&++N===u&&(h=r),A===s&&++j===l&&(b=r),(O=M.nextSibling)!==null)break;M=A,A=M.parentNode}M=O}n=h===-1||b===-1?null:{start:h,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(ic={focusedElem:t,selectionRange:n},Ki=!1,Ct=e;Ct!==null;)if(e=Ct,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ct=t;else for(;Ct!==null;){switch(e=Ct,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),Xt(s,l,n),s[Ht]=t,qt(s),l=s;break t;case"link":var r=Dd("link","href",u).get(l+(n.href||""));if(r){for(var h=0;hvt&&(r=vt,vt=X,X=r);var k=wo(h,X),T=wo(h,vt);if(k&&T&&(O.rangeCount!==1||O.anchorNode!==k.node||O.anchorOffset!==k.offset||O.focusNode!==T.node||O.focusOffset!==T.offset)){var E=M.createRange();E.setStart(k.node,k.offset),O.removeAllRanges(),X>vt?(O.addRange(E),O.extend(T.node,T.offset)):(E.setEnd(T.node,T.offset),O.addRange(E))}}}}for(M=[],O=h;O=O.parentNode;)O.nodeType===1&&M.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;hn?32:n,_.T=null,n=Xs,Xs=null;var s=yn,r=$e;if(Rt=0,El=yn=null,$e=0,(dt&6)!==0)throw Error(o(331));var h=dt;if(dt|=4,Ur(s.current),Mr(s,s.current,r,n),dt=h,Sa(0,!1),ne&&typeof ne.onPostCommitFiberRoot=="function")try{ne.onPostCommitFiberRoot(Cl,s)}catch{}return!0}finally{q.p=u,_.T=l,Pr(t,e)}}function ed(t,e,n){e=pe(n,e),e=zs(t.stateNode,e,2),t=on(t,e,2),t!==null&&(Hl(t,2),Me(t))}function mt(t,e,n){if(t.tag===3)ed(t,t,n);else for(;e!==null;){if(e.tag===3){ed(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(mn===null||!mn.has(l))){t=pe(n,t),n=nr(2),l=on(e,n,2),l!==null&&(lr(n,l,e,t),Hl(l,2),Me(l));break}}e=e.return}}function Js(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new Ug;var u=new Set;l.set(e,u)}else u=l.get(e),u===void 0&&(u=new Set,l.set(e,u));u.has(n)||(Hs=!0,u.add(n),t=Hg.bind(null,t,e,n),e.then(t,t))}function Hg(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,St===t&&(it&n)===n&&(At===4||At===3&&(it&62914560)===it&&300>ee()-xi?(dt&2)===0&&Nl(t,0):Vs|=n,zl===it&&(zl=0)),Me(t)}function nd(t,e){e===0&&(e=Jc()),t=wn(t,e),t!==null&&(Hl(t,e),Me(t))}function Vg(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),nd(t,n)}function Yg(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(e),nd(t,n)}function Gg(t,e){return su(t,e)}var Ui=null,Ol=null,$s=!1,Bi=!1,Ws=!1,vn=0;function Me(t){t!==Ol&&t.next===null&&(Ol===null?Ui=Ol=t:Ol=Ol.next=t),Bi=!0,$s||($s=!0,Qg())}function Sa(t,e){if(!Ws&&Bi){Ws=!0;do for(var n=!1,l=Ui;l!==null;){if(t!==0){var u=l.pendingLanes;if(u===0)var s=0;else{var r=l.suspendedLanes,h=l.pingedLanes;s=(1<<31-le(42|t)+1)-1,s&=u&~(r&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,ud(l,s))}else s=it,s=Ha(l,l===St?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Ll(l,s)||(n=!0,ud(l,s));l=l.next}while(n);Ws=!1}}function Xg(){ld()}function ld(){Bi=$s=!1;var t=0;vn!==0&&em()&&(t=vn);for(var e=ee(),n=null,l=Ui;l!==null;){var u=l.next,s=ad(l,e);s===0?(l.next=null,n===null?Ui=u:n.next=u,u===null&&(Ol=n)):(n=l,(t!==0||(s&3)!==0)&&(Bi=!0)),l=u}Rt!==0&&Rt!==5||Sa(t),vn!==0&&(vn=0)}function ad(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,u=t.expirationTimes,s=t.pendingLanes&-62914561;0h)break;var j=b.transferSize,M=b.initiatorType;j&&gd(M)&&(b=b.responseEnd,r+=j*(b"u"?null:document;function Ad(t,e,n){var l=xl;if(l&&typeof e=="string"&&e){var u=me(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Nd.has(u)||(Nd.add(u),t={rel:t,crossOrigin:n,href:e},l.querySelector(u)===null&&(e=l.createElement("link"),Xt(e,"link",t),qt(e),l.head.appendChild(e)))}}function fm(t){We.D(t),Ad("dns-prefetch",t,null)}function rm(t,e){We.C(t,e),Ad("preconnect",t,e)}function dm(t,e,n){We.L(t,e,n);var l=xl;if(l&&t&&e){var u='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+me(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+me(n.imageSizes)+'"]')):u+='[href="'+me(t)+'"]';var s=u;switch(e){case"style":s=jl(t);break;case"script":s=Dl(t)}ze.has(s)||(t=x({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),ze.set(s,t),l.querySelector(u)!==null||e==="style"&&l.querySelector(Ea(s))||e==="script"&&l.querySelector(Na(s))||(e=l.createElement("link"),Xt(e,"link",t),qt(e),l.head.appendChild(e)))}}function hm(t,e){We.m(t,e);var n=xl;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+me(l)+'"][href="'+me(t)+'"]',s=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Dl(t)}if(!ze.has(s)&&(t=x({rel:"modulepreload",href:t},e),ze.set(s,t),n.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Na(s)))return}l=n.createElement("link"),Xt(l,"link",t),qt(l),n.head.appendChild(l)}}}function gm(t,e,n){We.S(t,e,n);var l=xl;if(l&&t){var u=Fn(l).hoistableStyles,s=jl(t);e=e||"default";var r=u.get(s);if(!r){var h={loading:0,preload:null};if(r=l.querySelector(Ea(s)))h.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":e},n),(n=ze.get(s))&&dc(t,n);var b=r=l.createElement("link");qt(b),Xt(b,"link",t),b._p=new Promise(function(N,j){b.onload=N,b.onerror=j}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Vi(r,e,l)}r={type:"stylesheet",instance:r,count:1,state:h},u.set(s,r)}}}function mm(t,e){We.X(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=x({src:t,async:!0},e),(e=ze.get(u))&&hc(t,e),s=n.createElement("script"),qt(s),Xt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function ym(t,e){We.M(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=Dl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=x({src:t,async:!0,type:"module"},e),(e=ze.get(u))&&hc(t,e),s=n.createElement("script"),qt(s),Xt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function Od(t,e,n,l){var u=(u=Ie.current)?Hi(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=jl(n.href),n=Fn(u).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=jl(n.href);var s=Fn(u).hoistableStyles,r=s.get(t);if(r||(u=u.ownerDocument||u,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,r),(s=u.querySelector(Ea(t)))&&!s._p&&(r.instance=s,r.state.loading=5),ze.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ze.set(t,n),s||pm(u,t,n,r.state))),e&&l===null)throw Error(o(528,""));return r}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Dl(n),n=Fn(u).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function jl(t){return'href="'+me(t)+'"'}function Ea(t){return'link[rel="stylesheet"]['+t+"]"}function xd(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function pm(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),Xt(e,"link",n),qt(e),t.head.appendChild(e))}function Dl(t){return'[src="'+me(t)+'"]'}function Na(t){return"script[async]"+t}function jd(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+me(n.href)+'"]');if(l)return e.instance=l,qt(l),l;var u=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),qt(l),Xt(l,"style",u),Vi(l,n.precedence,t),e.instance=l;case"stylesheet":u=jl(n.href);var s=t.querySelector(Ea(u));if(s)return e.state.loading|=4,e.instance=s,qt(s),s;l=xd(n),(u=ze.get(u))&&dc(l,u),s=(t.ownerDocument||t).createElement("link"),qt(s);var r=s;return r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Xt(s,"link",l),e.state.loading|=4,Vi(s,n.precedence,t),e.instance=s;case"script":return s=Dl(n.src),(u=t.querySelector(Na(s)))?(e.instance=u,qt(u),u):(l=n,(u=ze.get(s))&&(l=x({},n),hc(l,u)),t=t.ownerDocument||t,u=t.createElement("script"),qt(u),Xt(u,"link",l),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,Vi(l,n.precedence,t));return e.instance}function Vi(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,s=u,r=0;r title"):null)}function vm(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Md(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function bm(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=jl(l.href),s=e.querySelector(Ea(u));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Gi.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,qt(s);return}s=e.ownerDocument||e,l=xd(l),(u=ze.get(u))&&dc(l,u),s=s.createElement("link"),qt(s);var r=s;r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Xt(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Gi.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var gc=0;function Sm(t,e){return t.stylesheets&&t.count===0&&Qi(t,t.stylesheets),0gc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Gi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qi(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Xi=null;function Qi(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Xi=new Map,e.forEach(Tm,t),Xi=null,Gi.call(t))}function Tm(t,e){if(!(e.state.loading&4)){var n=Xi.get(t);if(n)var l=n.get(null);else{n=new Map,Xi.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(m)}catch(a){console.error(a)}}return m(),Tc.exports=Xm(),Tc.exports}var Km=Qm();class Zm extends W{constructor(){super("avalanche.operator.Empty",[])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posEc},{no:6,name:"run_id",kind:"scalar",T:9},{no:7,name:"workflow_selector",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.flowName="",i.inputJson="",i.contextJson="",i.inputFiles=[],i.runId="",i.workflowSelector="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:3,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"agent_field_schemas_json",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.agentFieldSchemasJson={},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:5,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"cron",kind:"scalar",T:9},{no:8,name:"next_run_at",kind:"scalar",T:1},{no:9,name:"last_run_at",kind:"scalar",T:1},{no:10,name:"workflow_id",kind:"scalar",T:9},{no:11,name:"display_name",kind:"scalar",T:9},{no:12,name:"root_alias",kind:"scalar",T:9},{no:13,name:"relative_file",kind:"scalar",T:9},{no:14,name:"builder_symbol",kind:"scalar",T:9},{no:15,name:"agent_node_ids",kind:"scalar",repeat:2,T:9},{no:16,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:17,name:"webhook_path",kind:"scalar",T:9},{no:18,name:"webhook_url",kind:"scalar",T:9},{no:19,name:"webhook_active",kind:"scalar",T:8}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.name="",i.filePath="",i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.cron="",i.nextRunAt=0,i.lastRunAt=0,i.workflowId="",i.displayName="",i.rootAlias="",i.relativeFile="",i.builderSymbol="",i.agentNodeIds=[],i.agentMetadataJson={},i.webhookPath="",i.webhookUrl="",i.webhookActive=!1,a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNc},{no:5,name:"scan_targets",kind:"message",repeat:2,T:()=>Oc},{no:6,name:"diagnostics",kind:"message",repeat:2,T:()=>Ac}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.revision="0",i.workflows=[],i.scanTargets=[],i.diagnostics=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posxc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.valueJson="",i.files=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posjc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.status="",i.revision="0",i.available=!1,i.complete=!1,i.eventCount="0",i.sizeBytes="0",i.latestEventSequence="0",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posRl},{no:8,name:"revision",kind:"scalar",T:4},{no:9,name:"event_page_token",kind:"scalar",T:9},{no:10,name:"error",kind:"scalar",opt:!0,T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeId="",i.name="",i.nodeType="",i.status="",i.startedAt=0,i.endedAt=0,i.revision="0",i.eventPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:5,name:"latest_log_sequence",kind:"scalar",T:4},{no:6,name:"log_page_token",kind:"scalar",T:9},{no:7,name:"topology",kind:"message",T:()=>wl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.nodes=[],i.latestLogSequence="0",i.logPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.logs=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql},{no:6,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runId="",i.nodeId="",i.events=[],i.nextPageToken="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:2,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:3,name:"topology",kind:"message",T:()=>wl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodes=[],a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posRl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posPi}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posDc},{no:3,name:"run_status_changed",kind:"message",oneof:"change",T:()=>_c},{no:4,name:"node_status_changed",kind:"message",oneof:"change",T:()=>Mc},{no:5,name:"log_appended",kind:"message",oneof:"change",T:()=>wc},{no:6,name:"agent_event_appended",kind:"message",oneof:"change",T:()=>Rc},{no:7,name:"trace_finalized",kind:"message",oneof:"change",T:()=>Uc},{no:8,name:"catalog_replaced",kind:"message",oneof:"change",T:()=>Bc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.sequence="0",i.change={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posqc},{no:3,name:"reset_required",kind:"message",oneof:"payload",T:()=>Cc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.payload={oneofKind:void 0},a!==void 0&&F(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posawait this.client.getRunSnapshot({runId:g.runId,operatorInstanceId:f,asOfSequence:c}).response)),d=await this.getCatalog();if(a.operatorInstanceId!==f||d.operatorInstanceId!==f||a.revision!==d.revision||BigInt(a.asOfSequence)>BigInt(c)||BigInt(d.asOfSequence)d.nodeId===i);if(!o?.eventPageToken)return[];const f=[];let c=o.eventPageToken,v="0";do{const d=await this.client.listAgentEvents({pageToken:c,afterEventSequence:v,pageSize:100}).response;f.push(...d.events),d.events.length&&(v=d.events.at(-1).eventSequence),c=d.nextPageToken}while(c);return f}async listLogs(a){if(!a.logPageToken)return[];const i=[];let o=a.logPageToken,f="0";do{const c=await this.client.listLogs({pageToken:o,afterSequence:f,pageSize:100}).response;i.push(...c.logs),c.logs.length&&(f=c.logs.at(-1).sequence),o=c.nextPageToken}while(o);return i}async readDetail(a){const i=[];for await(const v of this.client.readDetail({bodyToken:a}).responses)i.push(v.data);const o=i.reduce((v,d)=>v+d.length,0),f=new Uint8Array(o);let c=0;for(const v of i)f.set(v,c),c+=v.length;return JSON.parse(new TextDecoder().decode(f))}async startRun(a,i){return(await this.client.startRun({flowName:"",workflowSelector:a,runId:"",inputJson:i===void 0?"":JSON.stringify(i),contextJson:"",inputFiles:[]}).response).runId}async cancelRun(a){await this.client.cancelRun({runId:a}).response}}function lp(m){return m==="success"?"✓":m==="failed"?"!":m==="running"?"●":"·"}function ap({workflow:m,runs:a,selection:i,onSelect:o}){const[f,c]=Z.useState(!0);return p.jsxs("div",{className:"workflow-branch",children:[p.jsxs("div",{className:"tree-row",children:[p.jsx("button",{type:"button",className:"tree-disclosure",onClick:()=>c(v=>!v),"aria-label":`${f?"Collapse":"Expand"} ${m.displayName}`,children:f?"⌄":"›"}),p.jsxs("button",{type:"button",className:i?.kind==="workflow"&&i.workflowId===m.workflowId?"tree-select active":"tree-select",onClick:()=>o({kind:"workflow",workflowId:m.workflowId}),children:[p.jsx("span",{className:"workflow-glyph",children:"◇"}),p.jsxs("span",{children:[p.jsx("strong",{children:m.displayName}),p.jsx("small",{children:m.relativeFile})]})]})]}),f&&p.jsxs("div",{className:"run-branches",children:[a.map(v=>{const d=v.summary;return p.jsxs("button",{type:"button",className:i?.kind==="run"&&i.runId===d.runId?"run-select active":"run-select",onClick:()=>o({kind:"run",workflowId:m.workflowId,runId:d.runId}),children:[p.jsx("span",{className:`run-dot status-${d.status}`,children:lp(d.status)}),p.jsxs("span",{children:[p.jsx("strong",{children:d.runId}),p.jsx("small",{children:d.startedAt?`Created at sequence ${d.createdSequence}`:"Awaiting start"})]})]},d.runId)}),!a.length&&p.jsx("span",{className:"no-runs",children:"No runs yet"})]})]})}function ip(m,a){return m.workflows.filter(i=>i.rootAlias===a.alias)}function up({catalog:m,runs:a,selection:i,onSelect:o}){const[f,c]=Z.useState({});if(!m)return p.jsxs("aside",{id:"operator-explorer",className:"explorer skeleton","aria-label":"Explorer",children:[p.jsx("div",{}),p.jsx("div",{}),p.jsx("div",{})]});const v=m.scanTargets.length?m.scanTargets:[{alias:"workflows",targetPath:"Configured workflows",kind:"directory"}];return p.jsxs("aside",{id:"operator-explorer",className:"explorer","aria-label":"Explorer",children:[p.jsxs("header",{children:[p.jsx("span",{className:"eyebrow",children:"Navigator"}),p.jsx("h2",{children:"Explorer"}),p.jsxs("span",{className:"catalog-revision",children:["catalog r",m.revision]})]}),m.diagnostics.length>0&&p.jsxs("details",{className:"diagnostics",open:!0,children:[p.jsxs("summary",{children:[m.diagnostics.length," reload issue",m.diagnostics.length===1?"":"s"]}),m.diagnostics.map(d=>p.jsxs("div",{children:[p.jsx("strong",{children:d.kind.replaceAll("_"," ")}),p.jsx("span",{children:d.path}),p.jsx("p",{children:d.message})]},`${d.path}-${d.kind}`))]}),p.jsx("div",{className:"target-list",children:v.map(d=>{const g=d.alias==="workflows"?m.workflows:ip(m,d),y=!!f[d.alias];return p.jsxs("section",{className:"target",children:[p.jsxs("button",{type:"button",className:"target-heading",onClick:()=>c(z=>{const x={...z};return x[d.alias]?delete x[d.alias]:x[d.alias]=!0,x}),children:[p.jsx("span",{children:y?"›":"⌄"}),p.jsx("span",{className:"target-kind",children:d.kind==="file"?"F":"D"}),p.jsxs("span",{children:[p.jsx("strong",{children:d.alias}),p.jsx("small",{title:d.targetPath,children:d.targetPath})]})]}),!y&&p.jsx("div",{className:"workflow-list",children:g.map(z=>p.jsx(ap,{workflow:z,runs:Object.values(a).filter(x=>x.summary?.workflowId===z.workflowId).sort((x,B)=>Number(B.summary.createdSequence)-Number(x.summary.createdSequence)),selection:i,onSelect:o},z.workflowId))})]},d.alias)})})]})}function An(m){return typeof m=="object"&&m!==null&&!Array.isArray(m)}function tu(m){return Array.isArray(m)?m.flatMap(a=>!An(a)||typeof a.name!="string"?[]:[{name:a.name,type:typeof a.type=="string"?a.type:void 0,description:typeof a.description=="string"?a.description:void 0}]):[]}function eh(m){if(m)try{const a=JSON.parse(m);if(!An(a))return;const i=An(a.signature)?a.signature:{};return{instructions:typeof i.instructions=="string"?i.instructions:"",inputs:tu(i.inputs),outputs:tu(i.outputs),model:a.models,runtime:a.runtime,skills:a.skills,tools:a.tools}}catch{return}}function nh(m){if(m)try{const a=JSON.parse(m);return An(a)?{inputs:tu(a.inputs),outputs:tu(a.outputs)}:void 0}catch{return}}const lh=Z.memo(({data:m})=>p.jsxs("button",{type:"button",className:`node-card ${m.status?`status-${m.status}`:"blueprint"}`,onClick:m.onOpen,"aria-label":`Inspect ${m.label}${m.identity?` ${m.identity}`:""}`,children:[p.jsx(Kd,{type:"target",position:Zd.Left,isConnectable:!1}),p.jsx("span",{className:"node-kicker",children:m.nodeType}),p.jsx("strong",{children:m.label}),m.identity&&p.jsx("span",{className:"node-identity",children:m.identity}),m.status&&p.jsx("span",{className:"node-status",children:m.status}),m.duration&&p.jsx("span",{className:"node-duration",children:m.duration}),m.error&&p.jsx("span",{className:"node-error",children:m.error}),m.declaration&&p.jsxs("span",{className:"field-grid",children:[p.jsxs("span",{children:[p.jsx("small",{children:"Inputs"}),m.declaration.inputs.map(a=>p.jsx("span",{className:"field",children:a.name},`input-${a.name}`))]}),p.jsxs("span",{children:[p.jsx("small",{children:"Outputs"}),m.declaration.outputs.map(a=>p.jsx("span",{className:"field",children:a.name},`output-${a.name}`))]})]}),p.jsx(Kd,{type:"source",position:Zd.Right,isConnectable:!1})]}));lh.displayName="WorkflowNodeCard";function sp(m){const a=Object.fromEntries(m.nodeIds.map(c=>[c,0]));for(const c of Object.values(m.graph))for(const v of c.children)a[v]=(a[v]??0)+1;const i={},o=m.nodeIds.filter(c=>a[c]===0);for(const c of o)i[c]=0;for(let c=0;cv.map((d,g)=>[d,{x:Number(c)*330,y:g*220-(v.length-1)*110}])))}function cp(m){if(!m.startedAt)return;const a=m.endedAt||Date.now()/1e3,i=Math.max(0,a-m.startedAt);return i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m`}function op(m,a){const i=m.startsWith(`${a}_`)?m.slice(a.length+1):"";return i&&/^\d+$/.test(i)?`#${i}`:m}function fp({workflow:m,runTopology:a,runNodes:i=[],onOpenNode:o}){const f=Z.useMemo(()=>{if(a)return a;if(m)return{nodeIds:m.nodeIds,graph:m.graph,nodeTypes:m.nodeTypes,displayNames:m.displayNames}},[a,m]),c=Z.useMemo(()=>{if(!f)return{nodes:[],edges:[]};const v=sp(f),d=Object.fromEntries(i.map(U=>[U.nodeId,U])),g=Object.fromEntries(f.nodeIds.map(U=>[U,f.displayNames[U]||d[U]?.name||U])),y=Object.values(g).reduce((U,H)=>({...U,[H]:(U[H]??0)+1}),{}),z=f.nodeIds.map(U=>{const H=d[U];return{id:U,type:"workflow",position:v[U],data:{label:g[U],identity:y[g[U]]>1?op(U,g[U]):void 0,nodeType:f.nodeTypes[U]||H?.nodeType||"step",status:H?.status,error:H?.error,duration:H?cp(H):void 0,declaration:a?nh(a.agentFieldSchemasJson[U]):eh(m?.agentMetadataJson[U]),onOpen:()=>o(U)}}}),x=new Set,B=[];for(const[U,H]of Object.entries(f.graph))for(const J of H.children){const et=`${U}->${J}`;x.has(et)||(x.add(et),B.push({id:et,source:U,target:J,markerEnd:{type:Mm.ArrowClosed},className:"dag-edge"}))}return{nodes:z,edges:B}},[o,i,a,f,m]);return p.jsxs(wm,{nodes:c.nodes,edges:c.edges,nodeTypes:{workflow:lh},fitView:!0,fitViewOptions:{padding:.24},minZoom:.25,maxZoom:1.8,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[p.jsx(Rm,{color:"rgba(255,255,255,.06)",gap:24,size:1}),p.jsx(Um,{showInteractive:!1})]})}function rp(m,a,i){const o=new Array(m);return new Proxy(o,{get(f,c,v){if(typeof c=="string"){const d=c.charCodeAt(0);if(d>=48&&d<=57){const g=+c;if(Number.isInteger(g)&&g>=0&&go[z]!==y))&&(o=d,f=a(...d),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(f),c=!1),f}return v.updateDeps=d=>{o=d},v}function Pd(m,a){if(m===void 0)throw new Error("Unexpected undefined");return m}const dp=(m,a)=>Math.abs(m-a)<1.01,hp=(m,a,i)=>{let o;return function(...f){m.clearTimeout(o),o=m.setTimeout(()=>a.apply(this,f),i)}};let Ma;const Hc=()=>{if(Ma!==void 0)return Ma;if(typeof navigator>"u")return Ma=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ma=!0;const m=navigator.maxTouchPoints;return Ma=navigator.platform==="MacIntel"&&m!==void 0&&m>0},th=m=>{const{offsetWidth:a,offsetHeight:i}=m;return{width:a,height:i}},gp=m=>m,mp=m=>{const a=Math.max(m.startIndex-m.overscan,0),o=Math.min(m.endIndex+m.overscan,m.count-1)-a+1,f=new Array(o);for(let c=0;c{const i=m.scrollElement;if(!i)return;const o=m.targetWindow;if(!o)return;const f=v=>{const{width:d,height:g}=v;a({width:Math.round(d),height:Math.round(g)})};if(f(th(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(v=>{const d=()=>{const g=v[0];if(g?.borderBoxSize){const y=g.borderBoxSize[0];if(y){f({width:y.inlineSize,height:y.blockSize});return}}f(th(i))};m.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},eu={passive:!0},pp=typeof window>"u"?!0:"onscrollend"in window,vp=(m,a,i)=>{const o=m.scrollElement;if(!o)return;const f=m.targetWindow;if(!f)return;const c=m.options.useScrollendEvent&&pp;let v=0;const d=c?null:hp(f,()=>a(v,!1),m.options.isScrollingResetDelay),g=x=>()=>{v=i(o),d?.(),a(v,x)},y=g(!0),z=g(!1);return o.addEventListener("scroll",y,eu),c&&o.addEventListener("scrollend",z,eu),()=>{o.removeEventListener("scroll",y),c&&o.removeEventListener("scrollend",z)}},bp=(m,a)=>vp(m,a,i=>{const{horizontal:o,isRtl:f}=m.options;return o?i.scrollLeft*(f&&-1||1):i.scrollTop}),Sp=(m,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(m),f=i.options.getItemKey(o);return i.itemSizeCache.get(f)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(m),f=i.options.getItemKey(o),c=i.itemSizeCache.get(f);if(c!==void 0)return c}return m[i.options.horizontal?"offsetWidth":"offsetHeight"]},Tp=(m,{adjustments:a=0,behavior:i},o)=>{var f,c;(c=(f=o.scrollElement)==null?void 0:f.scrollTo)==null||c.call(f,{[o.options.horizontal?"left":"top"]:m+a,behavior:i})},kp=Tp;class zp{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,f;return((f=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:f.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(f=>{f.forEach(c=>{const v=()=>{const d=c.target,g=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[y,z]of this.elementsCache)if(z===d){this.elementsCache.delete(y);break}return}this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(d,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(v):v()})}));return{disconnect:()=>{var f;(f=o())==null||f.disconnect(),i=null},observe:f=>{var c;return(c=o())==null?void 0:c.observe(f,{box:"border-box"})},unobserve:f=>{var c;return(c=o())==null?void 0:c.unobserve(f)}}})(),this.range=null,this.setOptions=i=>{var o,f;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:gp,rangeExtractor:mp,onChange:()=>{},measureElement:Sp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const B in i){const U=i[B];U!==void 0&&(c[B]=U)}const v=this.options;let d=null,g=null,y=!1;if(v!==void 0&&v.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const B=v.count,U=c.count,H=this.getMeasurements(),J=B>0?((o=H[0])==null?void 0:o.key)??v.getItemKey(0):null,et=B>0?((f=H[B-1])==null?void 0:f.key)??v.getItemKey(B-1):null;if(U!==B||B>0&&U>0&&(c.getItemKey(0)!==J||c.getItemKey(U-1)!==et)){y=!0;const tt=B>0?this.getVirtualItemForOffset(this.getScrollOffset())??H[0]:null;tt&&(d=[tt.key,this.getScrollOffset()-tt.start]);const ht=c.followOnAppend===!0?"auto":c.followOnAppend||null;ht&&U>B&&this.isAtEnd(v.scrollEndThreshold)&&(B===0||c.getItemKey(U-1)!==et)&&(g=ht)}}this.options=c,y&&(this.pendingMin=0,this.itemSizeCacheVersion++);let z=!1,x=0;if(d&&this.scrollOffset!==null){const[B,U]=d,H=this.getMeasurements(),{count:J,getItemKey:et}=this.options;let L=0;for(;L{var o,f;(f=(o=this.options).onChange)==null||f.call(o,this,i)},this.maybeNotify=Ml(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,v)=>{if(v&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=v?d===c?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Hc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",v,eu),c.addEventListener("touchend",d,eu),this.unsubs.push(()=>{c.removeEventListener("touchstart",v),c.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const f=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,f&&this.scrollElement&&this.options.enabled){const[c,v,d,g]=f;c!==null&&!d&&(Hc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?g!==0&&(this._iosDeferredAdjustment+=g):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const f=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=f,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ml(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,f,c,v,d,g,y)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:y}),{key:!1}),this.getMeasurements=Ml(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:y},z)=>{const x=this.itemSizeCache;if(!v)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const L of this.laneAssignments.keys())L>=i&&this.laneAssignments.delete(L);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(L=>{this.itemSizeCache.set(L.key,L.size)}));const B=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),d===1){const L=i*2;let Q=this._flatMeasurements;if(!Q||Q.length0&&at.set(Q.subarray(0,B*2)),Q=at,this._flatMeasurements=Q}let tt;if(B===0)tt=o+f;else{const at=B-1;tt=Q[at*2]+Q[at*2+1]+y}for(let at=B;at1){ht=tt;const Qt=H[ht],Ot=Qt!==void 0?U[Qt]:void 0;at=Ot?Ot.end+y:o+f}else if(et===d){let Qt=0,Ot=J[0],Lt=H[0];for(let Zt=1;Ztthis.options.debug}),this.calculateRange=Ml(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,f,c)=>i.length===0||o===0?(this.range=null,null):(this.range=Np(i,o,f,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ml(()=>{let i=null,o=null;const f=this.calculateRange();return f&&(i=f.startIndex,o=f.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,f,c,v)=>c===null||v===null?[]:i({startIndex:c,endIndex:v,overscan:o,count:f}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,f=i.getAttribute(o);return f?parseInt(f,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const f=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(f!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),v=Math.max(0,f-c),d=Math.min(this.options.count-1,f+c);return i>=v&&i<=d}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((v,d)=>{v.isConnected||(this.observer.unobserve(v),this.elementsCache.delete(d))});return}const o=this.indexFromElement(i),f=this.options.getItemKey(o),c=this.elementsCache.get(f);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(f,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var f,c;if(i<0||i>=this.options.count)return;let v,d,g;const y=this._flatMeasurements;if(this.options.lanes===1&&y!==null)g=this.options.getItemKey(i),d=y[i*2],v=y[i*2+1];else{const B=this.measurementsCache[i];if(!B)return;g=B.key,d=B.start,v=B.size}const z=this.itemSizeCache.get(g)??v,x=o-z;if(x!==0){const B=this.options.anchorTo==="end"&&((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,U=B?this.getTotalSize():0,H=this.getScrollOffset()+this.scrollAdjustments,et=!this.itemSizeCache.has(g)?d[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const f=[];for(let c=0,v=i.length;cthis.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const f=this._flatMeasurements,c=this.options.lanes===1&&f!=null,v=ah(0,o.length-1,c?d=>f[d*2]:d=>Pd(o[d]).start,i);return Pd(o[v])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,f=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),v=this.getScrollOffset();o==="auto"&&(o=i>=v+c?"end":"start"),o==="center"?i+=(f-c)/2:o==="end"&&(i-=c);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const f=this.getSize(),c=this.getScrollOffset(),v=this.measurementsCache[i];if(!v)return;if(o==="auto")if(v.end>=c+f-this.options.scrollPaddingEnd)o="end";else if(v.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?v.end+this.options.scrollPaddingEnd:v.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,v.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),v=this.now();this.scrollState={index:null,align:o,behavior:f,startedAt:v,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[v,d]=c,g=this.now();this.scrollState={index:i,align:d,behavior:f,startedAt:g,lastTargetOffset:v,stableFrames:0},this._scrollToOffset(v,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const f=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let f;if(o.length===0)f=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,v=this._flatMeasurements;v!=null?f=v[c*2]+v[c*2+1]:f=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let v=o.length-1;for(;v>=0&&c.some(d=>d===null);){const d=o[v];c[d.lane]===null&&(c[d.lane]=d.end),v--}f=Math.max(...c.filter(d=>d!==null))}return Math.max(f-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const f of o)f&&this.itemSizeCache.has(f.key)&&i.push({index:f.index,key:f.key,start:f.start,size:f.size,end:f.end,lane:f.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:f})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:f,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Hc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,f=o?o[0]:this.scrollState.lastTargetOffset,c=1,v=f!==this.scrollState.lastTargetOffset;if(!v&&dp(f,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==f&&this._scrollToOffset(f,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,v){const d=this.getSize()||600,g=Math.abs(f-this.getScrollOffset()),y=this.scrollState.behavior==="smooth"&&g>d;this.scrollState.lastTargetOffset=f,y||(this.scrollState.behavior="auto"),this._scrollToOffset(f,{adjustments:void 0,behavior:y?"smooth":"auto"})}this.scheduleScrollReconcile()}}const ah=(m,a,i,o)=>{for(;m<=a;){const f=(m+a)/2|0,c=i(f);if(co)a=f-1;else return f}return m>0?m-1:0};function Ep(m,a,i){let o=0;for(;o<=a;){const f=(o+a)/2|0,c=m[f*2];if(ci)a=f-1;else return f}return o>0?o-1:0}function Np(m,a,i,o,f){const c=m.length-1;if(m.length<=o)return{startIndex:0,endIndex:c};if(o===1&&f!==null){const y=Ep(f,c,i);let z=y;const x=i+a;for(;zm[y].start,i),g=d;if(o===1)for(;g1){const y=Array(o).fill(0);for(;gx=0&&z.some(x=>x>=i);){const x=m[d];z[x.lane]=x.start,d--}d=Math.max(0,d-d%o),g=Math.min(c,g+(o-1-g%o))}return{startIndex:d,endIndex:g}}const Vc=typeof document<"u"?Z.useLayoutEffect:Z.useEffect;function Ap({useFlushSync:m=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const f=Z.useReducer(z=>z+1,0)[1],c=Z.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const v=z=>{const x=c.current;if(!x.enabled||!x.container)return;const B=z.getTotalSize();if(B!==x.lastSize){x.lastSize=B;const U=z.options.horizontal?"width":"height";x.container.style[U]=`${B}px`}},d=z=>{const x=c.current;if(!x.enabled||!x.container)return;v(z);const B=!!z.options.horizontal,U=x.mode==="transform",H=B?"left":"top",J=z.options.scrollMargin,et=z.getVirtualItems();for(const L of et){const Q=L.start-J,tt=z.elementsCache.get(L.key);tt&&x.lastPositions.get(tt)!==Q&&(x.lastPositions.set(tt,Q),U?tt.style.transform=B?`translate3d(${Q}px, 0, 0)`:`translate3d(0, ${Q}px, 0)`:tt.style[H]=`${Q}px`)}},g={...o,onChange:(z,x)=>{var B;const U=c.current;let H=!0;if(U.enabled){d(z);const J=z.range,et=U.prevRange;H=!et||et.isScrolling!==z.isScrolling||et.startIndex!==J?.startIndex||et.endIndex!==J?.endIndex,H&&(U.prevRange=J?{startIndex:J.startIndex,endIndex:J.endIndex,isScrolling:z.isScrolling}:null)}H&&(m&&x?Bm.flushSync(f):f()),(B=o.onChange)==null||B.call(o,z,x)}},[y]=Z.useState(()=>{const z=new zp(g);return Object.assign(z,{containerRef:x=>{const B=c.current;if(B.container=x,B.lastSize=null,x&&B.enabled){const U=z.getTotalSize();B.lastSize=U;const H=z.options.horizontal?"width":"height";x.style[H]=`${U}px`}}})});return y.setOptions(g),Vc(()=>y._didMount(),[]),Vc(()=>(v(y),y._willUpdate())),Vc(()=>{d(y)}),y}function Op(m){return Ap({observeElementRect:yp,observeElementOffset:bp,scrollToFn:kp,...m})}function Kn({value:m,depth:a=0}){return m===null?p.jsx("span",{className:"value-null",children:"null"}):typeof m=="string"?p.jsx("span",{className:"value-string",children:m}):typeof m=="number"||typeof m=="boolean"?p.jsx("span",{className:"value-scalar",children:String(m)}):Array.isArray(m)?p.jsx("ol",{className:"value-list",children:m.map((i,o)=>p.jsx("li",{children:p.jsx(Kn,{value:i,depth:a+1})},`${a}-${o}`))}):An(m)?m.kind==="predict_rlm_file"&&typeof m.path=="string"?p.jsxs("span",{className:"file-value",title:"Reported host path; contents are not copied",children:[p.jsx("span",{"aria-hidden":"true",children:"↗"}),p.jsxs("span",{children:[p.jsx("small",{children:"PredictRLM file"}),p.jsx("code",{children:m.path})]})]}):m.kind==="unavailable"&&typeof m.reason=="string"?p.jsxs("span",{className:"value-unavailable",children:["Unavailable · ",m.reason]}):p.jsx("dl",{className:"value-object",children:Object.entries(m).map(([i,o])=>p.jsxs("div",{children:[p.jsx("dt",{children:i}),p.jsx("dd",{children:p.jsx(Kn,{value:o,depth:a+1})})]},i))}):p.jsx("span",{className:"value-unavailable",children:"Unavailable"})}const xp=[],jp=[];function Yc({value:m}){return p.jsx("pre",{className:"json-block",children:JSON.stringify(m,null,2)})}function Dp(m){if(An(m))return An(m.data)?m.data:m}function _p({api:m,workflow:a,run:i,nodeId:o,liveEvents:f=xp,liveLogs:c=jp,onClose:v}){const[d,g]=Z.useState("overview"),[y,z]=Z.useState([]),[x,B]=Z.useState([]),[U,H]=Z.useState(),[J,et]=Z.useState(),[L,Q]=Z.useState(),[tt,ht]=Z.useState(!0),at=Z.useRef(new Map),Ut=Z.useRef(null),$=i?.nodes.find(w=>w.nodeId===o),Tt=i?void 0:eh(a?.agentMetadataJson[o??""]),re=i?nh(i.topology?.agentFieldSchemasJson[o??""]):void 0;Z.useEffect(()=>{if(g("overview"),z([]),B([]),H(void 0),et(void 0),ht(!0),at.current.clear(),!i||!o)return;let w=!0;return Promise.all([m.listAgentEvents(i,o),m.listLogs(i)]).then(([Y,bt])=>{w&&(z(Y),B(bt.filter(ct=>!ct.nodeId||ct.nodeId===o)))}).catch(Y=>{w&&Q(Y instanceof Error?Y.message:"Details unavailable")}),()=>{w=!1}},[m,o,i]);const Qt=Z.useMemo(()=>{const w=new Map;for(const Y of[...y,...f])w.set(Y.eventSequence,Y);return[...w.values()].sort((Y,bt)=>Number(Y.eventSequence)-Number(bt.eventSequence))},[y,f]),Ot=Qt.filter(w=>w.eventKind==="iteration.recorded"),Lt=Z.useMemo(()=>{const w=new Map;for(const Y of[...x,...c])w.set(Y.sequence,Y);return[...w.values()].sort((Y,bt)=>Number(Y.sequence)-Number(bt.sequence))},[c,x]),Zt=Z.useMemo(()=>{const w=$?.trace?.header?.usageJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.usageJson]),de=Z.useMemo(()=>{const w=$?.trace?.header?.telemetryJson;return w?JSON.parse(w):void 0},[$?.trace?.header?.telemetryJson]),he=d==="inputs"?re?.inputs:d==="output"?re?.outputs:void 0,_=Op({count:Ot.length,getScrollElement:()=>Ut.current,estimateSize:()=>64,overscan:6});if(Z.useEffect(()=>{!tt||!Ot.length||H(Ot.at(-1).eventSequence)},[tt,Ot]),Z.useEffect(()=>{const w=Qt.find(ct=>ct.eventSequence===U);if(!w?.bodyToken){et(void 0);return}const Y=at.current.get(w.bodyToken);if(Y!==void 0){at.current.delete(w.bodyToken),at.current.set(w.bodyToken,Y),et(Y);return}let bt=!0;return et(void 0),Q(void 0),m.readDetail(w.bodyToken).then(ct=>{if(bt){for(at.current.delete(w.bodyToken),at.current.set(w.bodyToken,ct);at.current.size>8;){const ot=at.current.keys().next().value;if(ot===void 0)break;at.current.delete(ot)}et(ct)}}).catch(ct=>{bt&&Q(ct instanceof Error?ct.message:"Detail unavailable")}),()=>{bt=!1}},[m,Qt,U]),Z.useEffect(()=>{const w=d==="inputs"?"run.started":d==="output"?"run.succeeded":void 0;if(!w)return;const Y=[...Qt].reverse().find(bt=>bt.eventKind===w);Y&&H(Y.eventSequence)},[Qt,d]),!i&&a&&o)return p.jsxs("aside",{className:"inspector","aria-label":"Node declaration",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Declaration"}),p.jsx("h2",{children:a.displayNames[o]||o})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),Tt?p.jsxs("div",{className:"inspector-body declaration",children:[p.jsxs("section",{children:[p.jsx("h3",{children:"Instructions"}),p.jsx("p",{className:"instructions",children:Tt.instructions||"No instructions"})]}),p.jsxs("section",{className:"signature-columns",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"Inputs"}),Tt.inputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]}),p.jsxs("div",{children:[p.jsx("h3",{children:"Outputs"}),Tt.outputs.map(w=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type}),p.jsx("p",{children:w.description})]},w.name))]})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Runtime"}),p.jsx(Yc,{value:Tt.runtime})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Models"}),p.jsx(Yc,{value:Tt.model})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Skills & tools"}),p.jsx(Yc,{value:{skills:Tt.skills,tools:Tt.tools}})]})]}):p.jsx("p",{className:"empty-copy",children:"This node has no agent declaration metadata."})]});if(!i||!$)return null;const q=Dp(J),K=d==="inputs"?"inputs":"outputs";return p.jsxs("aside",{className:"inspector","aria-label":"Run inspector",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Historical execution"}),p.jsx("h2",{children:$.name}),p.jsx("span",{className:`status-pill status-${$.status}`,children:$.status})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),p.jsx("nav",{className:"inspector-tabs","aria-label":"Run detail views",children:["overview","inputs","output","trace","logs"].map(w=>p.jsx("button",{type:"button",className:d===w?"active":"",onClick:()=>g(w),children:w},w))}),p.jsxs("div",{className:"inspector-body",children:[L&&p.jsx("p",{className:"error-banner",children:L}),d==="overview"&&p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:"metric-grid",children:[p.jsxs("div",{children:[p.jsx("small",{children:"Status"}),p.jsx("strong",{children:$.status})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Revision"}),p.jsx("strong",{children:$.revision})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Started"}),p.jsx("strong",{children:$.startedAt?"yes":"—"})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Duration"}),p.jsx("strong",{children:$.startedAt&&$.endedAt?`${Math.max(0,$.endedAt-$.startedAt).toFixed(2)}s`:"—"})]})]}),$.error&&p.jsx("p",{className:"node-failure",children:$.error}),$.trace&&p.jsxs("section",{children:[p.jsx("h3",{children:"Trace header"}),p.jsxs("dl",{className:"trace-header",children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Status"}),p.jsx("dd",{children:$.trace.status})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Events"}),p.jsx("dd",{children:$.trace.eventCount})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Size"}),p.jsxs("dd",{children:[$.trace.sizeBytes," B"]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Complete"}),p.jsx("dd",{children:$.trace.complete?"yes":"no"})]}),$.trace.header&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Model"}),p.jsx("dd",{children:$.trace.header.model})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Iterations"}),p.jsxs("dd",{children:[$.trace.header.iterations,"/",$.trace.header.maxIterations]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Duration"}),p.jsxs("dd",{children:[$.trace.header.durationMs," ms"]})]})]})]}),Zt!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Usage"}),p.jsx(Kn,{value:Zt})]}),de!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Telemetry"}),p.jsx(Kn,{value:de})]})]})]}),(d==="inputs"||d==="output")&&p.jsxs("section",{children:[p.jsx("h3",{children:d==="inputs"?"Invocation inputs":"Terminal output"}),he?.length?p.jsxs("div",{className:"declared-fields",children:[p.jsx("small",{children:"Declared fields"}),he.map(w=>p.jsxs("span",{children:[p.jsx("strong",{children:w.name}),p.jsx("code",{children:w.type})]},w.name))]}):null,q&&K in q?p.jsx(Kn,{value:q[K]}):p.jsxs("p",{className:"empty-copy",children:["No retained ",d," ",d==="output"?"is":"are"," available."]})]}),d==="trace"&&p.jsxs("section",{className:"trace-layout",children:[p.jsxs("div",{className:"trace-toolbar",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"RunTrace"}),p.jsxs("span",{children:[Ot.length," complete turns"]})]}),p.jsx("button",{type:"button",className:tt?"toggle active":"toggle",onClick:()=>ht(w=>!w),children:tt?"Following live":"Follow latest"})]}),p.jsx("div",{className:"turn-list",ref:Ut,children:p.jsx("div",{style:{height:_.getTotalSize(),position:"relative"},children:_.getVirtualItems().map(w=>{const Y=Ot[w.index];return p.jsxs("button",{type:"button",className:`turn-row ${U===Y.eventSequence?"active":""} ${Y.error?"failed":""}`,style:{transform:`translateY(${w.start}px)`},onClick:()=>{ht(!1),H(Y.eventSequence)},children:[p.jsxs("strong",{children:["Turn ",Y.iteration??w.index+1]}),p.jsx("span",{children:Y.durationMs?`${Y.durationMs} ms`:"—"}),p.jsxs("small",{children:[Y.toolCount," tools · ",Y.predictCount," predicts"]})]},Y.eventSequence)})})}),p.jsx("div",{className:"turn-detail",children:J!==void 0?p.jsx(Kn,{value:J}):p.jsx("p",{className:"empty-copy",children:"Select a turn."})})]}),d==="logs"&&p.jsxs("section",{children:[p.jsx("h3",{children:"Node logs"}),p.jsx("div",{className:"log-list",children:Lt.map(w=>p.jsxs("button",{type:"button",onClick:()=>{m.readDetail(w.bodyToken).then(et).catch(Y=>{Q(Y instanceof Error?Y.message:"Log unavailable")})},children:[p.jsx("span",{className:`log-level level-${w.level}`,children:w.level}),p.jsx("time",{children:new Date(w.timestamp*1e3).toLocaleTimeString()}),p.jsxs("span",{children:["#",w.sequence]})]},w.sequence))}),J!==void 0&&p.jsx(Kn,{value:J})]})]})]})}function Mp({value:m,onChange:a}){const i=Z.useRef(null);return Z.useEffect(()=>{if(!i.current)return;const o=new Da({parent:i.current,state:Lm.create({doc:m,extensions:[Hm(),Vm.of([]),Da.lineWrapping,Da.contentAttributes.of({"aria-label":"Workflow input JSON"}),Da.theme({"&":{backgroundColor:"#ffffff",color:"#17211c"},".cm-content":{caretColor:"#2563eb",minHeight:"110px"},".cm-gutters":{backgroundColor:"#f6f8f7",color:"#7b8680",border:"0"},"&.cm-focused":{outline:"1px solid #9bb6f5"}}),Da.updateListener.of(f=>{f.docChanged&&a(f.state.doc.toString())})]})});return()=>o.destroy()},[]),p.jsx("div",{className:"json-editor",ref:i})}function wp(m){const a=JSON.parse(m);if(!An(a))throw new Error("Run input must be a JSON object");return a}function Rp({workflow:m,run:a,pending:i,onStart:o,onCancel:f}){const[c,v]=Z.useState(!1),[d,g]=Z.useState("{}"),[y,z]=Z.useState(),x=a?.summary?.status==="pending"||a?.summary?.status==="running",B=async()=>{if(!m)return;z(void 0);let U;if(c)try{U=wp(d)}catch(H){z(H instanceof Error?H.message:"Run input is invalid JSON");return}try{await o(m.workflowId,U)}catch(H){z(H instanceof Error?H.message:"Operator rejected the run")}};return p.jsxs("div",{className:"run-controls",children:[m&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"run-button",disabled:i?.kind==="start",onClick:()=>{B()},children:i?.kind==="start"?"Requesting…":"Run"}),p.jsx("button",{type:"button",className:`input-toggle ${c?"active":""}`,onClick:()=>v(U=>!U),children:c?"Hide JSON input":"Add JSON input"})]}),x&&a?.summary&&p.jsx("button",{type:"button",className:"cancel-button",disabled:i?.kind==="cancel",onClick:()=>{z(void 0),f(a.summary.runId).catch(U=>{z(U instanceof Error?U.message:"Cancellation failed")})},children:i?.kind==="cancel"?"Cancelling…":"Cancel run"}),c&&m&&p.jsxs("div",{className:"input-popover",children:[p.jsxs("div",{children:[p.jsx("strong",{children:"Workflow input"}),p.jsx("span",{children:"Schema-blind JSON object"})]}),p.jsx(Mp,{value:d,onChange:g})]}),y&&p.jsx("div",{className:"action-error",children:y})]})}const ih={runs:{},liveEvents:{},liveLogs:{},operatorInstanceId:"",sequence:"0",connection:"connecting"};function Up(m,a){if(a.type==="baseline"){const g=Object.fromEntries(a.baseline.runs.filter(y=>y.summary).map(y=>[y.summary.runId,y]));return{...ih,catalog:a.baseline.catalog,runs:g,operatorInstanceId:a.baseline.catalog.operatorInstanceId,sequence:a.baseline.asOfSequence,connection:"live"}}if(a.type==="connection")return{...m,connection:a.connection,error:a.error};if(a.type==="action")return{...m,action:a.action};const{envelope:i}=a;if(i.operatorInstanceId!==m.operatorInstanceId)throw new Error("Operator epoch changed");if(i.payload.oneofKind!=="update")throw new Error("Operator requested a structural reset");const o=i.payload.update;if(BigInt(o.sequence)!==BigInt(m.sequence)+1n)throw new Error(`Operator update gap after sequence ${m.sequence}`);const f={...m,sequence:o.sequence,error:void 0},c=o.change;if(c.oneofKind==="catalogReplaced")return c.catalogReplaced.catalog&&(f.catalog=c.catalogReplaced.catalog),f;if(c.oneofKind==="runCreated"&&c.runCreated.summary){const g=c.runCreated.summary;return f.runs={...m.runs,[g.runId]:{operatorInstanceId:m.operatorInstanceId,asOfSequence:o.sequence,summary:g,nodes:c.runCreated.nodes,latestLogSequence:"0",logPageToken:"",topology:c.runCreated.topology}},f}const v=c.oneofKind==="runStatusChanged"?c.runStatusChanged.runId:c.oneofKind==="nodeStatusChanged"?c.nodeStatusChanged.runId:c.oneofKind==="logAppended"?c.logAppended.runId:c.oneofKind==="agentEventAppended"?c.agentEventAppended.runId:c.oneofKind==="traceFinalized"?c.traceFinalized.runId:"",d=m.runs[v];if(!d)throw new Error(`Operator update referenced unknown run ${v}`);if(c.oneofKind==="runStatusChanged"&&d.summary)f.runs={...m.runs,[v]:{...d,summary:{...d.summary,status:c.runStatusChanged.status,startedAt:c.runStatusChanged.startedAt,endedAt:c.runStatusChanged.endedAt,revision:c.runStatusChanged.revision}}};else if(c.oneofKind==="nodeStatusChanged"){const g=c.nodeStatusChanged;f.runs={...m.runs,[v]:{...d,nodes:d.nodes.map(y=>y.nodeId===g.nodeId?{...y,status:g.status,startedAt:g.startedAt,endedAt:g.endedAt,revision:g.revision,error:g.error}:y)}}}else if(c.oneofKind==="logAppended"&&c.logAppended.log)f.liveLogs={...m.liveLogs,[v]:[...m.liveLogs[v]??[],c.logAppended.log]};else if(c.oneofKind==="agentEventAppended"&&c.agentEventAppended.event){const g=`${v}:${c.agentEventAppended.nodeId}`;f.liveEvents={...m.liveEvents,[g]:[...m.liveEvents[g]??[],c.agentEventAppended.event]}}else c.oneofKind==="traceFinalized"&&c.traceFinalized.trace&&(f.runs={...m.runs,[v]:{...d,nodes:d.nodes.map(g=>g.nodeId===c.traceFinalized.nodeId?{...g,trace:c.traceFinalized.trace}:g)}});return f}function Bp(m){const[a,i]=Z.useReducer(Up,ih),o=Z.useRef(0),f=Z.useCallback(async()=>{const d=await m.loadBaseline();return i({type:"baseline",baseline:d}),d},[m]);Z.useEffect(()=>{const d=++o.current;let g=!1;return(async()=>{let z=250;for(;!g&&o.current===d;)try{i({type:"connection",connection:"connecting"});const x=await m.loadBaseline();if(g)return;i({type:"baseline",baseline:x}),z=250;let B=x.asOfSequence;for await(const U of m.streamUpdates(x.catalog.operatorInstanceId,B)){if(g)return;if(U.payload.oneofKind!=="update"||BigInt(U.payload.update.sequence)!==BigInt(B)+1n)break;i({type:"envelope",envelope:U}),B=U.payload.update.sequence}i({type:"connection",connection:"reconnecting"})}catch(x){if(g)return;i({type:"connection",connection:"reconnecting",error:x instanceof Error?x.message:"Operator connection failed"});const{promise:B,resolve:U}=Promise.withResolvers();window.setTimeout(U,z),await B,z=Math.min(z*2,4e3)}})(),()=>{g=!0,o.current+=1}},[m]);const c=Z.useCallback(async(d,g)=>{i({type:"action",action:{kind:"start",target:d}});try{return await m.startRun(d,g)}finally{i({type:"action",action:void 0})}},[m]),v=Z.useCallback(async d=>{i({type:"action",action:{kind:"cancel",target:d}});try{await m.cancelRun(d)}finally{i({type:"action",action:void 0})}},[m]);return{state:a,reconcile:f,startRun:c,cancelRun:v}}function qp({api:m}){const{state:a,startRun:i,cancelRun:o}=Bp(m),[f,c]=Z.useState(),[v,d]=Z.useState(),[g,y]=Z.useState(!1);Z.useEffect(()=>{const L=a.catalog?.workflows??[];if(!L.length){c(void 0);return}if(!f){c({kind:"workflow",workflowId:L[0].workflowId});return}L.some(Q=>Q.workflowId===f.workflowId)||c({kind:"workflow",workflowId:L[0].workflowId})},[f,a.catalog]);const z=a.catalog?.workflows.find(L=>L.workflowId===f?.workflowId),x=f?.kind==="run"?a.runs[f.runId]:void 0,B=Z.useMemo(()=>Object.values(a.runs).filter(L=>L.summary?.workflowId===z?.workflowId).sort((L,Q)=>Number(Q.summary.createdSequence)-Number(L.summary.createdSequence))[0],[a.runs,z?.workflowId]),U=Z.useCallback(L=>d(L),[]),H=Z.useCallback(L=>{c(L),d(void 0),y(!1)},[]),J=x??(f?.kind==="workflow"?B:void 0),et=x&&v?`${x.summary?.runId}:${v}`:"";return p.jsxs("div",{className:`app-shell ${g?"explorer-open":""}`,children:[p.jsxs("header",{className:"topbar",children:[p.jsxs("div",{className:"brand",children:[p.jsx("span",{className:"brand-mark","aria-hidden":"true",children:"A"}),p.jsxs("div",{children:[p.jsx("strong",{children:"Avalanche"}),p.jsx("span",{children:"Operator"})]})]}),p.jsxs("div",{className:"breadcrumb",children:[p.jsx("span",{children:z?.rootAlias||"Local operator"}),z&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:z.displayName})]}),x?.summary&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:x.summary.runId})]})]}),p.jsxs("div",{className:`connection connection-${a.connection}`,children:[p.jsx("span",{}),a.connection==="live"?"Live":a.connection,p.jsxs("small",{children:["seq ",a.sequence]})]}),p.jsx("button",{type:"button",className:"explorer-toggle","aria-controls":"operator-explorer","aria-expanded":g,onClick:()=>y(L=>!L),children:"Explorer"})]}),a.error&&p.jsx("div",{className:"connection-error",children:a.error}),p.jsxs("main",{className:`workspace ${v?"with-inspector":""}`,children:[p.jsx(up,{catalog:a.catalog,runs:a.runs,selection:f,onSelect:H}),p.jsxs("section",{className:"canvas-shell",children:[p.jsxs("header",{className:"view-header",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:x?"Historical run":"Current definition"}),p.jsx("h1",{children:x?.summary?.runId||z?.displayName||"Operator"}),p.jsx("p",{children:x?`Recorded topology · ${x.summary?.status??"unknown"}`:z?`${z.nodeIds.length} nodes · ${z.relativeFile}`:"Waiting for a workflow catalog"})]}),p.jsx(Rp,{workflow:x?void 0:z,run:x??J,pending:a.action,onStart:i,onCancel:o})]}),p.jsxs("div",{className:x?"canvas run-canvas":"canvas blueprint-canvas",children:[z||x?.topology?p.jsx(fp,{workflow:x?void 0:z,runTopology:x?.topology,runNodes:x?.nodes,onOpenNode:U}):p.jsxs("div",{className:"empty-state",children:[p.jsx("span",{children:"◇"}),p.jsx("h2",{children:"No workflows discovered"}),p.jsx("p",{children:"Catalog changes will appear here as the operator scans configured targets."})]}),x&&p.jsxs("div",{className:"historical-badge",children:[p.jsx("span",{children:"Immutable run snapshot"}),"Current workflow changes do not alter this canvas"]})]})]}),v&&p.jsx(_p,{api:m,workflow:z,run:x,nodeId:v,liveEvents:a.liveEvents[et],liveLogs:x?.summary?a.liveLogs[x.summary.runId]:void 0,onClose:()=>d(void 0)})]})]})}const uh=document.getElementById("root");if(!uh)throw new Error("Operator UI root element is missing");Km.createRoot(uh).render(p.jsx(Z.StrictMode,{children:p.jsx(qp,{api:new np})})); diff --git a/src/runtime/operator/web_assets/assets/index-C_A082W7.js b/src/runtime/operator/web_assets/assets/index-C_A082W7.js new file mode 100644 index 0000000..6946580 --- /dev/null +++ b/src/runtime/operator/web_assets/assets/index-C_A082W7.js @@ -0,0 +1,9 @@ +import{r as Mm,a as Rm,b as Z,j as p,H as Zd,P as Jd,M as wm,i as Um,B as Bm,C as qm,c as Cm}from"./graph-CoDTrhFP.js";import{S as Lm,M as $,r as W,U as w,W as S,s as Ee,G as Hm}from"./protobuf-BR9ifi4u.js";import{E as ja,a as Vm,j as Ym,k as Gm}from"./editor-Dh6wG2B-.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const c of f)if(c.type==="childList")for(const v of c.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function i(f){const c={};return f.integrity&&(c.integrity=f.integrity),f.referrerPolicy&&(c.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?c.credentials="include":f.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(f){if(f.ep)return;f.ep=!0;const c=i(f);fetch(f.href,c)}})();var kc={exports:{}},Da={},zc={exports:{}},Ec={};var $d;function Xm(){return $d||($d=1,(function(m){function a(D,q){var K=D.length;D.push(q);t:for(;0>>1,Y=D[R];if(0>>1;Rf(ot,K))Btf(xe,ot)?(D[R]=xe,D[Bt]=K,R=Bt):(D[R]=ot,D[ct]=K,R=ct);else if(Btf(xe,K))D[R]=xe,D[Bt]=K,R=Bt;else break t}}return q}function f(D,q){var K=D.sortIndex-q.sortIndex;return K!==0?K:D.id-q.id}if(m.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;m.unstable_now=function(){return c.now()}}else{var v=Date,d=v.now();m.unstable_now=function(){return v.now()-d}}var g=[],y=[],k=1,x=null,B=3,U=!1,H=!1,J=!1,et=!1,L=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,tt=typeof setImmediate<"u"?setImmediate:null;function ht(D){for(var q=i(y);q!==null;){if(q.callback===null)o(y);else if(q.startTime<=D)o(y),q.sortIndex=q.expirationTime,a(g,q);else break;q=i(y)}}function at(D){if(J=!1,ht(D),!H)if(i(g)!==null)H=!0,Ut||(Ut=!0,Lt());else{var q=i(y);q!==null&&he(at,q.startTime-D)}}var Ut=!1,F=-1,Tt=5,re=-1;function Qt(){return et?!0:!(m.unstable_now()-reD&&Qt());){var R=x.callback;if(typeof R=="function"){x.callback=null,B=x.priorityLevel;var Y=R(x.expirationTime<=D);if(D=m.unstable_now(),typeof Y=="function"){x.callback=Y,ht(D),q=!0;break e}x===i(g)&&o(g),ht(D)}else o(g);x=i(g)}if(x!==null)q=!0;else{var bt=i(y);bt!==null&&he(at,bt.startTime-D),q=!1}}break t}finally{x=null,B=K,U=!1}q=void 0}}finally{q?Lt():Ut=!1}}}var Lt;if(typeof tt=="function")Lt=function(){tt(Ot)};else if(typeof MessageChannel<"u"){var Zt=new MessageChannel,de=Zt.port2;Zt.port1.onmessage=Ot,Lt=function(){de.postMessage(null)}}else Lt=function(){L(Ot,0)};function he(D,q){F=L(function(){D(m.unstable_now())},q)}m.unstable_IdlePriority=5,m.unstable_ImmediatePriority=1,m.unstable_LowPriority=4,m.unstable_NormalPriority=3,m.unstable_Profiling=null,m.unstable_UserBlockingPriority=2,m.unstable_cancelCallback=function(D){D.callback=null},m.unstable_forceFrameRate=function(D){0>D||125R?(D.sortIndex=K,a(y,D),i(g)===null&&D===i(y)&&(J?(Q(F),F=-1):J=!0,he(at,K-R))):(D.sortIndex=Y,a(g,D),H||U||(H=!0,Ut||(Ut=!0,Lt()))),D},m.unstable_shouldYield=Qt,m.unstable_wrapCallback=function(D){var q=B;return function(){var K=B;B=q;try{return D.apply(this,arguments)}finally{B=K}}}})(Ec)),Ec}var Wd;function Qm(){return Wd||(Wd=1,zc.exports=Xm()),zc.exports}var Fd;function Km(){if(Fd)return Da;Fd=1;var m=Qm(),a=Mm(),i=Rm();function o(t){var e="https://react.dev/errors/"+t;if(1Y||(t.current=R[Y],R[Y]=null,Y--)}function ot(t,e){Y++,R[Y]=t.current,t.current=e}var Bt=bt(null),xe=bt(null),Ie=bt(null),wa=bt(null);function Ua(t,e){switch(ot(Ie,e),ot(xe,t),ot(Bt,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?yd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=yd(e),t=pd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ct(Bt),ot(Bt,t)}function Zn(){ct(Bt),ct(xe),ct(Ie)}function lu(t){t.memoizedState!==null&&ot(wa,t);var e=Bt.current,n=pd(e,t.type);e!==n&&(ot(xe,t),ot(Bt,n))}function Ba(t){xe.current===t&&(ct(Bt),ct(xe)),wa.current===t&&(ct(wa),Aa._currentValue=K)}var au,Xc;function On(t){if(au===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);au=e&&e[1]||"",Xc=-1)":-1u||b[l]!==N[u]){var _=` +`+b[l].replace(" at new "," at ");return t.displayName&&_.includes("")&&(_=_.replace("",t.displayName)),_}while(1<=l&&0<=u);break}}}finally{iu=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?On(n):""}function oh(t,e){switch(t.tag){case 26:case 27:case 5:return On(t.type);case 16:return On("Lazy");case 13:return t.child!==e&&e!==null?On("Suspense Fallback"):On("Suspense");case 19:return On("SuspenseList");case 0:case 15:return uu(t.type,!1);case 11:return uu(t.type.render,!1);case 1:return uu(t.type,!0);case 31:return On("Activity");default:return""}}function Qc(t){try{var e="",n=null;do e+=oh(t,n),n=t,t=t.return;while(t);return e}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}var su=Object.prototype.hasOwnProperty,cu=m.unstable_scheduleCallback,ou=m.unstable_cancelCallback,fh=m.unstable_shouldYield,rh=m.unstable_requestPaint,ee=m.unstable_now,dh=m.unstable_getCurrentPriorityLevel,Kc=m.unstable_ImmediatePriority,Zc=m.unstable_UserBlockingPriority,qa=m.unstable_NormalPriority,hh=m.unstable_LowPriority,Jc=m.unstable_IdlePriority,gh=m.log,mh=m.unstable_setDisableYieldValue,Cl=null,ne=null;function Pe(t){if(typeof gh=="function"&&mh(t),ne&&typeof ne.setStrictMode=="function")try{ne.setStrictMode(Cl,t)}catch{}}var le=Math.clz32?Math.clz32:vh,yh=Math.log,ph=Math.LN2;function vh(t){return t>>>=0,t===0?32:31-(yh(t)/ph|0)|0}var Ca=256,La=262144,Ha=4194304;function xn(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Va(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var u=0,s=t.suspendedLanes,r=t.pingedLanes;t=t.warmLanes;var h=l&134217727;return h!==0?(l=h&~s,l!==0?u=xn(l):(r&=h,r!==0?u=xn(r):n||(n=h&~t,n!==0&&(u=xn(n))))):(h=l&~s,h!==0?u=xn(h):r!==0?u=xn(r):n||(n=l&~t,n!==0&&(u=xn(n)))),u===0?0:e!==0&&e!==u&&(e&s)===0&&(s=u&-u,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:u}function Ll(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function bh(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $c(){var t=Ha;return Ha<<=1,(Ha&62914560)===0&&(Ha=4194304),t}function fu(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Hl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Sh(t,e,n,l,u,s){var r=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var h=t.entanglements,b=t.expirationTimes,N=t.hiddenUpdates;for(n=r&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Ah=/[\n"\\]/g;function me(t){return t.replace(Ah,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function yu(t,e,n,l,u,s,r,h){t.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?t.type=r:t.removeAttribute("type"),e!=null?r==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ge(e)):t.value!==""+ge(e)&&(t.value=""+ge(e)):r!=="submit"&&r!=="reset"||t.removeAttribute("value"),e!=null?pu(t,r,ge(e)):n!=null?pu(t,r,ge(n)):l!=null&&t.removeAttribute("value"),u==null&&s!=null&&(t.defaultChecked=!!s),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+ge(h):t.removeAttribute("name")}function co(t,e,n,l,u,s,r,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){mu(t);return}n=n!=null?""+ge(n):"",e=e!=null?""+ge(e):n,h||e===t.value||(t.value=e),t.defaultValue=e}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=h?t.checked:!!l,t.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.name=r),mu(t)}function pu(t,e,n){e==="number"&&Xa(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Pn(t,e,n,l){if(t=t.options,e){e={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ku=!1;if(Ue)try{var Xl={};Object.defineProperty(Xl,"passive",{get:function(){ku=!0}}),window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{ku=!1}var en=null,zu=null,Ka=null;function yo(){if(Ka)return Ka;var t,e=zu,n=e.length,l,u="value"in en?en.value:en.textContent,s=u.length;for(t=0;t=Zl),ko=" ",zo=!1;function Eo(t,e){switch(t){case"keyup":return tg.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function No(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ll=!1;function ng(t,e){switch(t){case"compositionend":return No(e);case"keypress":return e.which!==32?null:(zo=!0,ko);case"textInput":return t=e.data,t===ko&&zo?null:t;default:return null}}function lg(t,e){if(ll)return t==="compositionend"||!xu&&Eo(t,e)?(t=yo(),Ka=zu=en=null,ll=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Ro(n)}}function Uo(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Uo(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Bo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Xa(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Xa(t.document)}return e}function Du(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var rg=Ue&&"documentMode"in document&&11>=document.documentMode,al=null,Mu=null,Fl=null,Ru=!1;function qo(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ru||al==null||al!==Xa(l)||(l=al,"selectionStart"in l&&Du(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Fl&&Wl(Fl,l)||(Fl=l,l=Li(Mu,"onSelect"),0>=r,u-=r,_e=1<<32-le(e)+u|n<P?(ut=V,V=null):ut=V.sibling;var rt=A(z,V,E[P],j);if(rt===null){V===null&&(V=ut);break}t&&V&&rt.alternate===null&&e(z,V),T=s(rt,T,P),ft===null?G=rt:ft.sibling=rt,ft=rt,V=ut}if(P===E.length)return n(z,V),st&&qe(z,P),G;if(V===null){for(;PP?(ut=V,V=null):ut=V.sibling;var En=A(z,V,rt.value,j);if(En===null){V===null&&(V=ut);break}t&&V&&En.alternate===null&&e(z,V),T=s(En,T,P),ft===null?G=En:ft.sibling=En,ft=En,V=ut}if(rt.done)return n(z,V),st&&qe(z,P),G;if(V===null){for(;!rt.done;P++,rt=E.next())rt=M(z,rt.value,j),rt!==null&&(T=s(rt,T,P),ft===null?G=rt:ft.sibling=rt,ft=rt);return st&&qe(z,P),G}for(V=l(V);!rt.done;P++,rt=E.next())rt=O(V,z,P,rt.value,j),rt!==null&&(t&&rt.alternate!==null&&V.delete(rt.key===null?P:rt.key),T=s(rt,T,P),ft===null?G=rt:ft.sibling=rt,ft=rt);return t&&V.forEach(function(Dm){return e(z,Dm)}),st&&qe(z,P),G}function vt(z,T,E,j){if(typeof E=="object"&&E!==null&&E.type===J&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case U:t:{for(var G=E.key;T!==null;){if(T.key===G){if(G=E.type,G===J){if(T.tag===7){n(z,T.sibling),j=u(T,E.props.children),j.return=z,z=j;break t}}else if(T.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Tt&&Ln(G)===T.type){n(z,T.sibling),j=u(T,E.props),la(j,E),j.return=z,z=j;break t}n(z,T);break}else e(z,T);T=T.sibling}E.type===J?(j=wn(E.props.children,z.mode,j,E.key),j.return=z,z=j):(j=ni(E.type,E.key,E.props,null,z.mode,j),la(j,E),j.return=z,z=j)}return r(z);case H:t:{for(G=E.key;T!==null;){if(T.key===G)if(T.tag===4&&T.stateNode.containerInfo===E.containerInfo&&T.stateNode.implementation===E.implementation){n(z,T.sibling),j=u(T,E.children||[]),j.return=z,z=j;break t}else{n(z,T);break}else e(z,T);T=T.sibling}j=Hu(E,z.mode,j),j.return=z,z=j}return r(z);case Tt:return E=Ln(E),vt(z,T,E,j)}if(he(E))return C(z,T,E,j);if(Lt(E)){if(G=Lt(E),typeof G!="function")throw Error(o(150));return E=G.call(E),X(z,T,E,j)}if(typeof E.then=="function")return vt(z,T,oi(E),j);if(E.$$typeof===tt)return vt(z,T,ii(z,E),j);fi(z,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,T!==null&&T.tag===6?(n(z,T.sibling),j=u(T,E),j.return=z,z=j):(n(z,T),j=Lu(E,z.mode,j),j.return=z,z=j),r(z)):n(z,T)}return function(z,T,E,j){try{na=0;var G=vt(z,T,E,j);return ml=null,G}catch(V){if(V===gl||V===si)throw V;var ft=ie(29,V,null,z.mode);return ft.lanes=j,ft.return=z,ft}}}var Vn=sf(!0),cf=sf(!1),sn=!1;function Iu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pu(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function on(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(dt&2)!==0){var u=l.pending;return u===null?e.next=e:(e.next=u.next,u.next=e),l.pending=e,e=ei(t),Xo(t,null,n),e}return ti(t,l,e,n),ei(t)}function aa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Fc(t,n)}}function ts(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var u=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?u=s=r:s=s.next=r,n=n.next}while(n!==null);s===null?u=s=e:s=s.next=e}else u=s=e;n={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var es=!1;function ia(){if(es){var t=hl;if(t!==null)throw t}}function ua(t,e,n,l){es=!1;var u=t.updateQueue;sn=!1;var s=u.firstBaseUpdate,r=u.lastBaseUpdate,h=u.shared.pending;if(h!==null){u.shared.pending=null;var b=h,N=b.next;b.next=null,r===null?s=N:r.next=N,r=b;var _=t.alternate;_!==null&&(_=_.updateQueue,h=_.lastBaseUpdate,h!==r&&(h===null?_.firstBaseUpdate=N:h.next=N,_.lastBaseUpdate=b))}if(s!==null){var M=u.baseState;r=0,_=N=b=null,h=s;do{var A=h.lane&-536870913,O=A!==h.lane;if(O?(it&A)===A:(l&A)===A){A!==0&&A===dl&&(es=!0),_!==null&&(_=_.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var C=t,X=h;A=e;var vt=n;switch(X.tag){case 1:if(C=X.payload,typeof C=="function"){M=C.call(vt,M,A);break t}M=C;break t;case 3:C.flags=C.flags&-65537|128;case 0:if(C=X.payload,A=typeof C=="function"?C.call(vt,M,A):C,A==null)break t;M=x({},M,A);break t;case 2:sn=!0}}A=h.callback,A!==null&&(t.flags|=64,O&&(t.flags|=8192),O=u.callbacks,O===null?u.callbacks=[A]:O.push(A))}else O={lane:A,tag:h.tag,payload:h.payload,callback:h.callback,next:null},_===null?(N=_=O,b=M):_=_.next=O,r|=A;if(h=h.next,h===null){if(h=u.shared.pending,h===null)break;O=h,h=O.next,O.next=null,u.lastBaseUpdate=O,u.shared.pending=null}}while(!0);_===null&&(b=M),u.baseState=b,u.firstBaseUpdate=N,u.lastBaseUpdate=_,s===null&&(u.shared.lanes=0),gn|=r,t.lanes=r,t.memoizedState=M}}function of(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function ff(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;ts?s:8;var r=D.T,h={};D.T=h,Ss(t,!1,e,n);try{var b=u(),N=D.S;if(N!==null&&N(h,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var _=Sg(b,l);oa(t,e,_,fe(t))}else oa(t,e,l,fe(t))}catch(M){oa(t,e,{then:function(){},status:"rejected",reason:M},fe())}finally{q.p=s,r!==null&&h.types!==null&&(r.types=h.types),D.T=r}}function Ag(){}function vs(t,e,n,l){if(t.tag!==5)throw Error(o(476));var u=Yf(t).queue;Vf(t,u,e,K,n===null?Ag:function(){return Gf(t),n(l)})}function Yf(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:K},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ve,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Gf(t){var e=Yf(t);e.next===null&&(e=t.alternate.memoizedState),oa(t,e.next.queue,{},fe())}function bs(){return Yt(Aa)}function Xf(){return _t().memoizedState}function Qf(){return _t().memoizedState}function Og(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=fe();t=cn(n);var l=on(e,t,n);l!==null&&(te(l,e,n),aa(l,e,n)),e={cache:Ju()},t.payload=e;return}e=e.return}}function xg(t,e,n){var l=fe();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Si(t)?Zf(e,n):(n=qu(t,e,n,l),n!==null&&(te(n,t,l),Jf(n,e,l)))}function Kf(t,e,n){var l=fe();oa(t,e,n,l)}function oa(t,e,n,l){var u={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Si(t))Zf(e,u);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var r=e.lastRenderedState,h=s(r,n);if(u.hasEagerState=!0,u.eagerState=h,ae(h,r))return ti(t,e,u,0),St===null&&Pa(),!1}catch{}if(n=qu(t,e,u,l),n!==null)return te(n,t,l),Jf(n,e,l),!0}return!1}function Ss(t,e,n,l){if(l={lane:2,revertLane:Is(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Si(t)){if(e)throw Error(o(479))}else e=qu(t,n,l,2),e!==null&&te(e,t,2)}function Si(t){var e=t.alternate;return t===I||e!==null&&e===I}function Zf(t,e){pl=hi=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Jf(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Fc(t,n)}}var fa={readContext:Yt,use:yi,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};fa.useEffectEvent=Nt;var $f={readContext:Yt,use:yi,useCallback:function(t,e){return Kt().memoizedState=[t,e===void 0?null:e],t},useContext:Yt,useEffect:Mf,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,vi(4194308,4,Bf.bind(null,e,t),n)},useLayoutEffect:function(t,e){return vi(4194308,4,t,e)},useInsertionEffect:function(t,e){vi(4,2,t,e)},useMemo:function(t,e){var n=Kt();e=e===void 0?null:e;var l=t();if(Yn){Pe(!0);try{t()}finally{Pe(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=Kt();if(n!==void 0){var u=n(e);if(Yn){Pe(!0);try{n(e)}finally{Pe(!1)}}}else u=e;return l.memoizedState=l.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},l.queue=t,t=t.dispatch=xg.bind(null,I,t),[l.memoizedState,t]},useRef:function(t){var e=Kt();return t={current:t},e.memoizedState=t},useState:function(t){t=hs(t);var e=t.queue,n=Kf.bind(null,I,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(t,e){var n=Kt();return ps(n,t,e)},useTransition:function(){var t=hs(!1);return t=Vf.bind(null,I,t.queue,!0,!1),Kt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=I,u=Kt();if(st){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),St===null)throw Error(o(349));(it&127)!==0||yf(l,e,n)}u.memoizedState=n;var s={value:n,getSnapshot:e};return u.queue=s,Mf(vf.bind(null,l,s,t),[t]),l.flags|=2048,bl(9,{destroy:void 0},pf.bind(null,l,s,n,e),null),n},useId:function(){var t=Kt(),e=St.identifierPrefix;if(st){var n=je,l=_e;n=(l&~(1<<32-le(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=gi++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?r.createElement(u,{is:l.is}):r.createElement(u)}}s[Ht]=e,s[Jt]=l;t:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)s.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break t;for(;r.sibling===null;){if(r.return===null||r.return===e)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=s;t:switch(Xt(s,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&Ge(e)}}return zt(e),ws(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Ge(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(o(166));if(t=Ie.current,fl(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,u=Vt,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}t[Ht]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||gd(t.nodeValue,n)),t||an(e,!0)}else t=Hi(t).createTextNode(l),t[Ht]=e,e.stateNode=t}return zt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=fl(e),n!==null){if(t===null){if(!l)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Ht]=e}else Un(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;zt(e),t=!1}else n=Xu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(se(e),e):(se(e),null);if((e.flags&128)!==0)throw Error(o(558))}return zt(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=fl(e),l!==null&&l.dehydrated!==null){if(t===null){if(!u)throw Error(o(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Ht]=e}else Un(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;zt(e),u=!1}else u=Xu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return e.flags&256?(se(e),e):(se(e),null)}return se(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Ni(e,e.updateQueue),zt(e),null);case 4:return Zn(),t===null&&nc(e.stateNode.containerInfo),zt(e),null;case 10:return Le(e.type),zt(e),null;case 19:if(ct(xt),l=e.memoizedState,l===null)return zt(e),null;if(u=(e.flags&128)!==0,s=l.rendering,s===null)if(u)da(l,!1);else{if(At!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=di(t),s!==null){for(e.flags|=128,da(l,!1),t=s.updateQueue,e.updateQueue=t,Ni(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Qo(n,t),n=n.sibling;return ot(xt,xt.current&1|2),st&&qe(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&ee()>ji&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304)}else{if(!u)if(t=di(s),t!==null){if(e.flags|=128,u=!0,t=t.updateQueue,e.updateQueue=t,Ni(e,t),da(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!st)return zt(e),null}else 2*ee()-l.renderingStartTime>ji&&n!==536870912&&(e.flags|=128,u=!0,da(l,!1),e.lanes=4194304);l.isBackwards?(s.sibling=e.child,e.child=s):(t=l.last,t!==null?t.sibling=s:e.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ee(),t.sibling=null,n=xt.current,ot(xt,u?n&1|2:n&1),st&&qe(e,l.treeForkCount),t):(zt(e),null);case 22:case 23:return se(e),ls(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(zt(e),e.subtreeFlags&6&&(e.flags|=8192)):zt(e),n=e.updateQueue,n!==null&&Ni(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&ct(Cn),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Le(jt),zt(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function Rg(t,e){switch(Yu(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Le(jt),Zn(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ba(e),null;case 31:if(e.memoizedState!==null){if(se(e),e.alternate===null)throw Error(o(340));Un()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(se(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));Un()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(xt),null;case 4:return Zn(),null;case 10:return Le(e.type),null;case 22:case 23:return se(e),ls(),t!==null&&ct(Cn),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Le(jt),null;case 25:return null;default:return null}}function br(t,e){switch(Yu(e),e.tag){case 3:Le(jt),Zn();break;case 26:case 27:case 5:Ba(e);break;case 4:Zn();break;case 31:e.memoizedState!==null&&se(e);break;case 13:se(e);break;case 19:ct(xt);break;case 10:Le(e.type);break;case 22:case 23:se(e),ls(),t!==null&&ct(Cn);break;case 24:Le(jt)}}function ha(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var u=l.next;n=u;do{if((n.tag&t)===t){l=void 0;var s=n.create,r=n.inst;l=s(),r.destroy=l}n=n.next}while(n!==u)}}catch(h){mt(e,e.return,h)}}function dn(t,e,n){try{var l=e.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var s=u.next;l=s;do{if((l.tag&t)===t){var r=l.inst,h=r.destroy;if(h!==void 0){r.destroy=void 0,u=e;var b=n,N=h;try{N()}catch(_){mt(u,b,_)}}}l=l.next}while(l!==s)}}catch(_){mt(e,e.return,_)}}function Sr(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{ff(e,n)}catch(l){mt(t,t.return,l)}}}function Tr(t,e,n){n.props=Gn(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){mt(t,e,l)}}function ga(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(u){mt(t,e,u)}}function De(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(u){mt(t,e,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){mt(t,e,u)}else n.current=null}function kr(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(u){mt(t,t.return,u)}}function Us(t,e,n){try{var l=t.stateNode;em(l,t.type,n,e),l[Jt]=e}catch(u){mt(t,t.return,u)}}function zr(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bn(t.type)||t.tag===4}function Bs(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||zr(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function qs(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=we));else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(qs(t,e,n),t=t.sibling;t!==null;)qs(t,e,n),t=t.sibling}function Ai(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&bn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ai(t,e,n),t=t.sibling;t!==null;)Ai(t,e,n),t=t.sibling}function Er(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,u=e.attributes;u.length;)e.removeAttributeNode(u[0]);Xt(e,l,n),e[Ht]=t,e[Jt]=n}catch(s){mt(t,t.return,s)}}var Xe=!1,Rt=!1,Cs=!1,Nr=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function wg(t,e){if(t=t.containerInfo,ic=Zi,t=Bo(t),Du(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var u=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var r=0,h=-1,b=-1,N=0,_=0,M=t,A=null;e:for(;;){for(var O;M!==n||u!==0&&M.nodeType!==3||(h=r+u),M!==s||l!==0&&M.nodeType!==3||(b=r+l),M.nodeType===3&&(r+=M.nodeValue.length),(O=M.firstChild)!==null;)A=M,M=O;for(;;){if(M===t)break e;if(A===n&&++N===u&&(h=r),A===s&&++_===l&&(b=r),(O=M.nextSibling)!==null)break;M=A,A=M.parentNode}M=O}n=h===-1||b===-1?null:{start:h,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(uc={focusedElem:t,selectionRange:n},Zi=!1,Ct=e;Ct!==null;)if(e=Ct,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ct=t;else for(;Ct!==null;){switch(e=Ct,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),Xt(s,l,n),s[Ht]=t,qt(s),l=s;break t;case"link":var r=Dd("link","href",u).get(l+(n.href||""));if(r){for(var h=0;hvt&&(r=vt,vt=X,X=r);var z=wo(h,X),T=wo(h,vt);if(z&&T&&(O.rangeCount!==1||O.anchorNode!==z.node||O.anchorOffset!==z.offset||O.focusNode!==T.node||O.focusOffset!==T.offset)){var E=M.createRange();E.setStart(z.node,z.offset),O.removeAllRanges(),X>vt?(O.addRange(E),O.extend(T.node,T.offset)):(E.setEnd(T.node,T.offset),O.addRange(E))}}}}for(M=[],O=h;O=O.parentNode;)O.nodeType===1&&M.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;hn?32:n,D.T=null,n=Qs,Qs=null;var s=yn,r=$e;if(wt=0,El=yn=null,$e=0,(dt&6)!==0)throw Error(o(331));var h=dt;if(dt|=4,Br(s.current),Rr(s,s.current,r,n),dt=h,Sa(0,!1),ne&&typeof ne.onPostCommitFiberRoot=="function")try{ne.onPostCommitFiberRoot(Cl,s)}catch{}return!0}finally{q.p=u,D.T=l,td(t,e)}}function nd(t,e,n){e=pe(n,e),e=Es(t.stateNode,e,2),t=on(t,e,2),t!==null&&(Hl(t,2),Me(t))}function mt(t,e,n){if(t.tag===3)nd(t,t,n);else for(;e!==null;){if(e.tag===3){nd(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(mn===null||!mn.has(l))){t=pe(n,t),n=lr(2),l=on(e,n,2),l!==null&&(ar(n,l,e,t),Hl(l,2),Me(l));break}}e=e.return}}function $s(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new qg;var u=new Set;l.set(e,u)}else u=l.get(e),u===void 0&&(u=new Set,l.set(e,u));u.has(n)||(Vs=!0,u.add(n),t=Yg.bind(null,t,e,n),e.then(t,t))}function Yg(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,St===t&&(it&n)===n&&(At===4||At===3&&(it&62914560)===it&&300>ee()-_i?(dt&2)===0&&Nl(t,0):Ys|=n,zl===it&&(zl=0)),Me(t)}function ld(t,e){e===0&&(e=$c()),t=Rn(t,e),t!==null&&(Hl(t,e),Me(t))}function Gg(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),ld(t,n)}function Xg(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(e),ld(t,n)}function Qg(t,e){return cu(t,e)}var Bi=null,Ol=null,Ws=!1,qi=!1,Fs=!1,vn=0;function Me(t){t!==Ol&&t.next===null&&(Ol===null?Bi=Ol=t:Ol=Ol.next=t),qi=!0,Ws||(Ws=!0,Zg())}function Sa(t,e){if(!Fs&&qi){Fs=!0;do for(var n=!1,l=Bi;l!==null;){if(t!==0){var u=l.pendingLanes;if(u===0)var s=0;else{var r=l.suspendedLanes,h=l.pingedLanes;s=(1<<31-le(42|t)+1)-1,s&=u&~(r&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,sd(l,s))}else s=it,s=Va(l,l===St?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Ll(l,s)||(n=!0,sd(l,s));l=l.next}while(n);Fs=!1}}function Kg(){ad()}function ad(){qi=Ws=!1;var t=0;vn!==0&&lm()&&(t=vn);for(var e=ee(),n=null,l=Bi;l!==null;){var u=l.next,s=id(l,e);s===0?(l.next=null,n===null?Bi=u:n.next=u,u===null&&(Ol=n)):(n=l,(t!==0||(s&3)!==0)&&(qi=!0)),l=u}wt!==0&&wt!==5||Sa(t),vn!==0&&(vn=0)}function id(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,u=t.expirationTimes,s=t.pendingLanes&-62914561;0h)break;var _=b.transferSize,M=b.initiatorType;_&&md(M)&&(b=b.responseEnd,r+=_*(b"u"?null:document;function Od(t,e,n){var l=xl;if(l&&typeof e=="string"&&e){var u=me(e);u='link[rel="'+t+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Ad.has(u)||(Ad.add(u),t={rel:t,crossOrigin:n,href:e},l.querySelector(u)===null&&(e=l.createElement("link"),Xt(e,"link",t),qt(e),l.head.appendChild(e)))}}function dm(t){We.D(t),Od("dns-prefetch",t,null)}function hm(t,e){We.C(t,e),Od("preconnect",t,e)}function gm(t,e,n){We.L(t,e,n);var l=xl;if(l&&t&&e){var u='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+me(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+me(n.imageSizes)+'"]')):u+='[href="'+me(t)+'"]';var s=u;switch(e){case"style":s=_l(t);break;case"script":s=jl(t)}ze.has(s)||(t=x({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),ze.set(s,t),l.querySelector(u)!==null||e==="style"&&l.querySelector(Ea(s))||e==="script"&&l.querySelector(Na(s))||(e=l.createElement("link"),Xt(e,"link",t),qt(e),l.head.appendChild(e)))}}function mm(t,e){We.m(t,e);var n=xl;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",u='link[rel="modulepreload"][as="'+me(l)+'"][href="'+me(t)+'"]',s=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=jl(t)}if(!ze.has(s)&&(t=x({rel:"modulepreload",href:t},e),ze.set(s,t),n.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Na(s)))return}l=n.createElement("link"),Xt(l,"link",t),qt(l),n.head.appendChild(l)}}}function ym(t,e,n){We.S(t,e,n);var l=xl;if(l&&t){var u=Fn(l).hoistableStyles,s=_l(t);e=e||"default";var r=u.get(s);if(!r){var h={loading:0,preload:null};if(r=l.querySelector(Ea(s)))h.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":e},n),(n=ze.get(s))&&hc(t,n);var b=r=l.createElement("link");qt(b),Xt(b,"link",t),b._p=new Promise(function(N,_){b.onload=N,b.onerror=_}),b.addEventListener("load",function(){h.loading|=1}),b.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Yi(r,e,l)}r={type:"stylesheet",instance:r,count:1,state:h},u.set(s,r)}}}function pm(t,e){We.X(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=jl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=x({src:t,async:!0},e),(e=ze.get(u))&&gc(t,e),s=n.createElement("script"),qt(s),Xt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function vm(t,e){We.M(t,e);var n=xl;if(n&&t){var l=Fn(n).hoistableScripts,u=jl(t),s=l.get(u);s||(s=n.querySelector(Na(u)),s||(t=x({src:t,async:!0,type:"module"},e),(e=ze.get(u))&&gc(t,e),s=n.createElement("script"),qt(s),Xt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(u,s))}}function xd(t,e,n,l){var u=(u=Ie.current)?Vi(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=_l(n.href),n=Fn(u).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=_l(n.href);var s=Fn(u).hoistableStyles,r=s.get(t);if(r||(u=u.ownerDocument||u,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,r),(s=u.querySelector(Ea(t)))&&!s._p&&(r.instance=s,r.state.loading=5),ze.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ze.set(t,n),s||bm(u,t,n,r.state))),e&&l===null)throw Error(o(528,""));return r}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=jl(n),n=Fn(u).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function _l(t){return'href="'+me(t)+'"'}function Ea(t){return'link[rel="stylesheet"]['+t+"]"}function _d(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function bm(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),Xt(e,"link",n),qt(e),t.head.appendChild(e))}function jl(t){return'[src="'+me(t)+'"]'}function Na(t){return"script[async]"+t}function jd(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+me(n.href)+'"]');if(l)return e.instance=l,qt(l),l;var u=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),qt(l),Xt(l,"style",u),Yi(l,n.precedence,t),e.instance=l;case"stylesheet":u=_l(n.href);var s=t.querySelector(Ea(u));if(s)return e.state.loading|=4,e.instance=s,qt(s),s;l=_d(n),(u=ze.get(u))&&hc(l,u),s=(t.ownerDocument||t).createElement("link"),qt(s);var r=s;return r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Xt(s,"link",l),e.state.loading|=4,Yi(s,n.precedence,t),e.instance=s;case"script":return s=jl(n.src),(u=t.querySelector(Na(s)))?(e.instance=u,qt(u),u):(l=n,(u=ze.get(s))&&(l=x({},n),gc(l,u)),t=t.ownerDocument||t,u=t.createElement("script"),qt(u),Xt(u,"link",l),t.head.appendChild(u),e.instance=u);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,Yi(l,n.precedence,t));return e.instance}function Yi(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,s=u,r=0;r title"):null)}function Sm(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Rd(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Tm(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=_l(l.href),s=e.querySelector(Ea(u));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Xi.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,qt(s);return}s=e.ownerDocument||e,l=_d(l),(u=ze.get(u))&&hc(l,u),s=s.createElement("link"),qt(s);var r=s;r._p=new Promise(function(h,b){r.onload=h,r.onerror=b}),Xt(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Xi.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var mc=0;function km(t,e){return t.stylesheets&&t.count===0&&Ki(t,t.stylesheets),0mc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Xi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ki(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Qi=null;function Ki(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Qi=new Map,e.forEach(zm,t),Qi=null,Xi.call(t))}function zm(t,e){if(!(e.state.loading&4)){var n=Qi.get(t);if(n)var l=n.get(null);else{n=new Map,Qi.set(t,n);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(m)}catch(a){console.error(a)}}return m(),kc.exports=Km(),kc.exports}var Jm=Zm(),Ra=(m=>(m[m.FORWARD=0]="FORWARD",m[m.NEWEST_FIRST=1]="NEWEST_FIRST",m))(Ra||{});class $m extends ${constructor(){super("avalanche.operator.Empty",[])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNc},{no:6,name:"run_id",kind:"scalar",T:9},{no:7,name:"workflow_selector",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.flowName="",i.inputJson="",i.contextJson="",i.inputFiles=[],i.runId="",i.workflowSelector="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.pos["avalanche.operator.DescriptorPageOrder",Ra,"DESCRIPTOR_PAGE_ORDER_"]}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.pageToken="",i.afterSequence="0",i.pageSize=0,i.beforeSequence="0",i.nodeId="",i.order=0,a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.pos["avalanche.operator.DescriptorPageOrder",Ra,"DESCRIPTOR_PAGE_ORDER_"]}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.pageToken="",i.afterEventSequence="0",i.pageSize=0,i.beforeEventSequence="0",i.order=0,a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:3,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"agent_field_schemas_json",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.agentFieldSchemasJson={},a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posNn}},{no:5,name:"node_types",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"display_names",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"cron",kind:"scalar",T:9},{no:8,name:"next_run_at",kind:"scalar",T:1},{no:9,name:"last_run_at",kind:"scalar",T:1},{no:10,name:"workflow_id",kind:"scalar",T:9},{no:11,name:"display_name",kind:"scalar",T:9},{no:12,name:"root_alias",kind:"scalar",T:9},{no:13,name:"relative_file",kind:"scalar",T:9},{no:14,name:"builder_symbol",kind:"scalar",T:9},{no:15,name:"agent_node_ids",kind:"scalar",repeat:2,T:9},{no:16,name:"agent_metadata_json",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:17,name:"webhook_path",kind:"scalar",T:9},{no:18,name:"webhook_url",kind:"scalar",T:9},{no:19,name:"webhook_active",kind:"scalar",T:8}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.name="",i.filePath="",i.nodeIds=[],i.graph={},i.nodeTypes={},i.displayNames={},i.cron="",i.nextRunAt=0,i.lastRunAt=0,i.workflowId="",i.displayName="",i.rootAlias="",i.relativeFile="",i.builderSymbol="",i.agentNodeIds=[],i.agentMetadataJson={},i.webhookPath="",i.webhookUrl="",i.webhookActive=!1,a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posAc},{no:5,name:"scan_targets",kind:"message",repeat:2,T:()=>xc},{no:6,name:"diagnostics",kind:"message",repeat:2,T:()=>Oc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.revision="0",i.workflows=[],i.scanTargets=[],i.diagnostics=[],a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.pos_c}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.valueJson="",i.files=[],a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posjc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.status="",i.revision="0",i.available=!1,i.complete=!1,i.eventCount="0",i.sizeBytes="0",i.latestEventSequence="0",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl},{no:8,name:"revision",kind:"scalar",T:4},{no:9,name:"event_page_token",kind:"scalar",T:9},{no:10,name:"error",kind:"scalar",opt:!0,T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodeId="",i.name="",i.nodeType="",i.status="",i.startedAt=0,i.endedAt=0,i.revision="0",i.eventPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:5,name:"latest_log_sequence",kind:"scalar",T:4},{no:6,name:"log_page_token",kind:"scalar",T:9},{no:7,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.nodes=[],i.latestLogSequence="0",i.logPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runs=[],i.nextPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl},{no:4,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.logs=[],i.nextPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql},{no:6,name:"next_page_token",kind:"scalar",T:9}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.asOfSequence="0",i.runId="",i.nodeId="",i.events=[],i.nextPageToken="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posFe},{no:2,name:"nodes",kind:"message",repeat:2,T:()=>Ul},{no:3,name:"topology",kind:"message",T:()=>Rl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.nodes=[],a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posBl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posql}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.poswl}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.runId="",i.nodeId="",a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.postu}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posDc},{no:3,name:"run_status_changed",kind:"message",oneof:"change",T:()=>Mc},{no:4,name:"node_status_changed",kind:"message",oneof:"change",T:()=>Rc},{no:5,name:"log_appended",kind:"message",oneof:"change",T:()=>wc},{no:6,name:"agent_event_appended",kind:"message",oneof:"change",T:()=>Uc},{no:7,name:"trace_finalized",kind:"message",oneof:"change",T:()=>Bc},{no:8,name:"catalog_replaced",kind:"message",oneof:"change",T:()=>qc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.sequence="0",i.change={oneofKind:void 0},a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posCc},{no:3,name:"reset_required",kind:"message",oneof:"payload",T:()=>Lc}])}create(a){const i=globalThis.Object.create(this.messagePrototype);return i.operatorInstanceId="",i.payload={oneofKind:void 0},a!==void 0&&W(this,i,a),i}internalBinaryRead(a,i,o,f){let c=f??this.create(),v=a.pos+i;for(;a.posawait this.client.getRunSnapshot({runId:g.runId,operatorInstanceId:f,asOfSequence:c}).response)),d=await this.getCatalog();if(a.operatorInstanceId!==f||d.operatorInstanceId!==f||a.revision!==d.revision||BigInt(a.asOfSequence)>BigInt(c)||BigInt(d.asOfSequence)d.nodeId===i);if(!o?.eventPageToken)return[];const f=[];let c=o.eventPageToken,v="0";do{const d=await this.client.listAgentEvents({pageToken:c,afterEventSequence:v,pageSize:100,beforeEventSequence:"0",order:Ra.FORWARD}).response;f.push(...d.events),d.events.length&&(v=d.events.at(-1).eventSequence),c=d.nextPageToken}while(c);return f}async listLogs(a){if(!a.logPageToken)return[];const i=[];let o=a.logPageToken,f="0";do{const c=await this.client.listLogs({pageToken:o,afterSequence:f,pageSize:100,beforeSequence:"0",nodeId:"",order:Ra.FORWARD}).response;i.push(...c.logs),c.logs.length&&(f=c.logs.at(-1).sequence),o=c.nextPageToken}while(o);return i}async readDetail(a){const i=[];for await(const v of this.client.readDetail({bodyToken:a}).responses)i.push(v.data);const o=i.reduce((v,d)=>v+d.length,0),f=new Uint8Array(o);let c=0;for(const v of i)f.set(v,c),c+=v.length;return JSON.parse(new TextDecoder().decode(f))}async startRun(a,i){return(await this.client.startRun({flowName:"",workflowSelector:a,runId:"",inputJson:i===void 0?"":JSON.stringify(i),contextJson:"",inputFiles:[]}).response).runId}async cancelRun(a){await this.client.cancelRun({runId:a}).response}}function up(m){return m==="success"?"✓":m==="failed"?"!":m==="running"?"●":"·"}function sp({workflow:m,runs:a,selection:i,onSelect:o}){const[f,c]=Z.useState(!0);return p.jsxs("div",{className:"workflow-branch",children:[p.jsxs("div",{className:"tree-row",children:[p.jsx("button",{type:"button",className:"tree-disclosure",onClick:()=>c(v=>!v),"aria-label":`${f?"Collapse":"Expand"} ${m.displayName}`,children:f?"⌄":"›"}),p.jsxs("button",{type:"button",className:i?.kind==="workflow"&&i.workflowId===m.workflowId?"tree-select active":"tree-select",onClick:()=>o({kind:"workflow",workflowId:m.workflowId}),children:[p.jsx("span",{className:"workflow-glyph",children:"◇"}),p.jsxs("span",{children:[p.jsx("strong",{children:m.displayName}),p.jsx("small",{children:m.relativeFile})]})]})]}),f&&p.jsxs("div",{className:"run-branches",children:[a.map(v=>{const d=v.summary;return p.jsxs("button",{type:"button",className:i?.kind==="run"&&i.runId===d.runId?"run-select active":"run-select",onClick:()=>o({kind:"run",workflowId:m.workflowId,runId:d.runId}),children:[p.jsx("span",{className:`run-dot status-${d.status}`,children:up(d.status)}),p.jsxs("span",{children:[p.jsx("strong",{children:d.runId}),p.jsx("small",{children:d.startedAt?`Created at sequence ${d.createdSequence}`:"Awaiting start"})]})]},d.runId)}),!a.length&&p.jsx("span",{className:"no-runs",children:"No runs yet"})]})]})}function cp(m,a){return m.workflows.filter(i=>i.rootAlias===a.alias)}function op({catalog:m,runs:a,selection:i,onSelect:o}){const[f,c]=Z.useState({});if(!m)return p.jsxs("aside",{id:"operator-explorer",className:"explorer skeleton","aria-label":"Explorer",children:[p.jsx("div",{}),p.jsx("div",{}),p.jsx("div",{})]});const v=m.scanTargets.length?m.scanTargets:[{alias:"workflows",targetPath:"Configured workflows",kind:"directory"}];return p.jsxs("aside",{id:"operator-explorer",className:"explorer","aria-label":"Explorer",children:[p.jsxs("header",{children:[p.jsx("span",{className:"eyebrow",children:"Navigator"}),p.jsx("h2",{children:"Explorer"}),p.jsxs("span",{className:"catalog-revision",children:["catalog r",m.revision]})]}),m.diagnostics.length>0&&p.jsxs("details",{className:"diagnostics",open:!0,children:[p.jsxs("summary",{children:[m.diagnostics.length," reload issue",m.diagnostics.length===1?"":"s"]}),m.diagnostics.map(d=>p.jsxs("div",{children:[p.jsx("strong",{children:d.kind.replaceAll("_"," ")}),p.jsx("span",{children:d.path}),p.jsx("p",{children:d.message})]},`${d.path}-${d.kind}`))]}),p.jsx("div",{className:"target-list",children:v.map(d=>{const g=d.alias==="workflows"?m.workflows:cp(m,d),y=!!f[d.alias];return p.jsxs("section",{className:"target",children:[p.jsxs("button",{type:"button",className:"target-heading",onClick:()=>c(k=>{const x={...k};return x[d.alias]?delete x[d.alias]:x[d.alias]=!0,x}),children:[p.jsx("span",{children:y?"›":"⌄"}),p.jsx("span",{className:"target-kind",children:d.kind==="file"?"F":"D"}),p.jsxs("span",{children:[p.jsx("strong",{children:d.alias}),p.jsx("small",{title:d.targetPath,children:d.targetPath})]})]}),!y&&p.jsx("div",{className:"workflow-list",children:g.map(k=>p.jsx(sp,{workflow:k,runs:Object.values(a).filter(x=>x.summary?.workflowId===k.workflowId).sort((x,B)=>Number(B.summary.createdSequence)-Number(x.summary.createdSequence)),selection:i,onSelect:o},k.workflowId))})]},d.alias)})})]})}function An(m){return typeof m=="object"&&m!==null&&!Array.isArray(m)}function eu(m){return Array.isArray(m)?m.flatMap(a=>!An(a)||typeof a.name!="string"?[]:[{name:a.name,type:typeof a.type=="string"?a.type:void 0,description:typeof a.description=="string"?a.description:void 0}]):[]}function lh(m){if(m)try{const a=JSON.parse(m);if(!An(a))return;const i=An(a.signature)?a.signature:{};return{instructions:typeof i.instructions=="string"?i.instructions:"",inputs:eu(i.inputs),outputs:eu(i.outputs),model:a.models,runtime:a.runtime,skills:a.skills,tools:a.tools}}catch{return}}function ah(m){if(m)try{const a=JSON.parse(m);return An(a)?{inputs:eu(a.inputs),outputs:eu(a.outputs)}:void 0}catch{return}}const ih=Z.memo(({data:m})=>p.jsxs("button",{type:"button",className:`node-card ${m.status?`status-${m.status}`:"blueprint"}`,onClick:m.onOpen,"aria-label":`Inspect ${m.label}${m.identity?` ${m.identity}`:""}`,children:[p.jsx(Zd,{type:"target",position:Jd.Left,isConnectable:!1}),p.jsx("span",{className:"node-kicker",children:m.nodeType}),p.jsx("strong",{children:m.label}),m.identity&&p.jsx("span",{className:"node-identity",children:m.identity}),m.status&&p.jsx("span",{className:"node-status",children:m.status}),m.duration&&p.jsx("span",{className:"node-duration",children:m.duration}),m.error&&p.jsx("span",{className:"node-error",children:m.error}),m.declaration&&p.jsxs("span",{className:"field-grid",children:[p.jsxs("span",{children:[p.jsx("small",{children:"Inputs"}),m.declaration.inputs.map(a=>p.jsx("span",{className:"field",children:a.name},`input-${a.name}`))]}),p.jsxs("span",{children:[p.jsx("small",{children:"Outputs"}),m.declaration.outputs.map(a=>p.jsx("span",{className:"field",children:a.name},`output-${a.name}`))]})]}),p.jsx(Zd,{type:"source",position:Jd.Right,isConnectable:!1})]}));ih.displayName="WorkflowNodeCard";function fp(m){const a=Object.fromEntries(m.nodeIds.map(c=>[c,0]));for(const c of Object.values(m.graph))for(const v of c.children)a[v]=(a[v]??0)+1;const i={},o=m.nodeIds.filter(c=>a[c]===0);for(const c of o)i[c]=0;for(let c=0;cv.map((d,g)=>[d,{x:Number(c)*330,y:g*220-(v.length-1)*110}])))}function rp(m){if(!m.startedAt)return;const a=m.endedAt||Date.now()/1e3,i=Math.max(0,a-m.startedAt);return i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m`}function dp(m,a){const i=m.startsWith(`${a}_`)?m.slice(a.length+1):"";return i&&/^\d+$/.test(i)?`#${i}`:m}function hp({workflow:m,runTopology:a,runNodes:i=[],onOpenNode:o}){const f=Z.useMemo(()=>{if(a)return a;if(m)return{nodeIds:m.nodeIds,graph:m.graph,nodeTypes:m.nodeTypes,displayNames:m.displayNames}},[a,m]),c=Z.useMemo(()=>{if(!f)return{nodes:[],edges:[]};const v=fp(f),d=Object.fromEntries(i.map(U=>[U.nodeId,U])),g=Object.fromEntries(f.nodeIds.map(U=>[U,f.displayNames[U]||d[U]?.name||U])),y=Object.values(g).reduce((U,H)=>({...U,[H]:(U[H]??0)+1}),{}),k=f.nodeIds.map(U=>{const H=d[U];return{id:U,type:"workflow",position:v[U],data:{label:g[U],identity:y[g[U]]>1?dp(U,g[U]):void 0,nodeType:f.nodeTypes[U]||H?.nodeType||"step",status:H?.status,error:H?.error,duration:H?rp(H):void 0,declaration:a?ah(a.agentFieldSchemasJson[U]):lh(m?.agentMetadataJson[U]),onOpen:()=>o(U)}}}),x=new Set,B=[];for(const[U,H]of Object.entries(f.graph))for(const J of H.children){const et=`${U}->${J}`;x.has(et)||(x.add(et),B.push({id:et,source:U,target:J,markerEnd:{type:wm.ArrowClosed},className:"dag-edge"}))}return{nodes:k,edges:B}},[o,i,a,f,m]);return p.jsxs(Um,{nodes:c.nodes,edges:c.edges,nodeTypes:{workflow:ih},fitView:!0,fitViewOptions:{padding:.24},minZoom:.25,maxZoom:1.8,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,proOptions:{hideAttribution:!0},children:[p.jsx(Bm,{color:"rgba(255,255,255,.06)",gap:24,size:1}),p.jsx(qm,{showInteractive:!1})]})}function gp(m,a,i){const o=new Array(m);return new Proxy(o,{get(f,c,v){if(typeof c=="string"){const d=c.charCodeAt(0);if(d>=48&&d<=57){const g=+c;if(Number.isInteger(g)&&g>=0&&go[k]!==y))&&(o=d,f=a(...d),i?.onChange&&!(c&&i.skipInitialOnChange)&&i.onChange(f),c=!1),f}return v.updateDeps=d=>{o=d},v}function eh(m,a){if(m===void 0)throw new Error("Unexpected undefined");return m}const mp=(m,a)=>Math.abs(m-a)<1.01,yp=(m,a,i)=>{let o;return function(...f){m.clearTimeout(o),o=m.setTimeout(()=>a.apply(this,f),i)}};let Ma;const Vc=()=>{if(Ma!==void 0)return Ma;if(typeof navigator>"u")return Ma=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ma=!0;const m=navigator.maxTouchPoints;return Ma=navigator.platform==="MacIntel"&&m!==void 0&&m>0},nh=m=>{const{offsetWidth:a,offsetHeight:i}=m;return{width:a,height:i}},pp=m=>m,vp=m=>{const a=Math.max(m.startIndex-m.overscan,0),o=Math.min(m.endIndex+m.overscan,m.count-1)-a+1,f=new Array(o);for(let c=0;c{const i=m.scrollElement;if(!i)return;const o=m.targetWindow;if(!o)return;const f=v=>{const{width:d,height:g}=v;a({width:Math.round(d),height:Math.round(g)})};if(f(nh(i)),!o.ResizeObserver)return()=>{};const c=new o.ResizeObserver(v=>{const d=()=>{const g=v[0];if(g?.borderBoxSize){const y=g.borderBoxSize[0];if(y){f({width:y.inlineSize,height:y.blockSize});return}}f(nh(i))};m.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return c.observe(i,{box:"border-box"}),()=>{c.unobserve(i)}},nu={passive:!0},Sp=typeof window>"u"?!0:"onscrollend"in window,Tp=(m,a,i)=>{const o=m.scrollElement;if(!o)return;const f=m.targetWindow;if(!f)return;const c=m.options.useScrollendEvent&&Sp;let v=0;const d=c?null:yp(f,()=>a(v,!1),m.options.isScrollingResetDelay),g=x=>()=>{v=i(o),d?.(),a(v,x)},y=g(!0),k=g(!1);return o.addEventListener("scroll",y,nu),c&&o.addEventListener("scrollend",k,nu),()=>{o.removeEventListener("scroll",y),c&&o.removeEventListener("scrollend",k)}},kp=(m,a)=>Tp(m,a,i=>{const{horizontal:o,isRtl:f}=m.options;return o?i.scrollLeft*(f&&-1||1):i.scrollTop}),zp=(m,a,i)=>{if(i.options.useCachedMeasurements){const o=i.indexFromElement(m),f=i.options.getItemKey(o);return i.itemSizeCache.get(f)??i.options.estimateSize(o)}if(a?.borderBoxSize){const o=a.borderBoxSize[0];if(o)return Math.round(o[i.options.horizontal?"inlineSize":"blockSize"])}if(!a){const o=i.indexFromElement(m),f=i.options.getItemKey(o),c=i.itemSizeCache.get(f);if(c!==void 0)return c}return m[i.options.horizontal?"offsetWidth":"offsetHeight"]},Ep=(m,{adjustments:a=0,behavior:i},o)=>{var f,c;(c=(f=o.scrollElement)==null?void 0:f.scrollTo)==null||c.call(f,{[o.options.horizontal?"left":"top"]:m+a,behavior:i})},Np=Ep;class Ap{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var i,o,f;return((f=(o=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:o.now)==null?void 0:f.call(o))??Date.now()},this.observer=(()=>{let i=null;const o=()=>i||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:i=new this.targetWindow.ResizeObserver(f=>{f.forEach(c=>{const v=()=>{const d=c.target,g=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[y,k]of this.elementsCache)if(k===d){this.elementsCache.delete(y);break}return}this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(d,c,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(v):v()})}));return{disconnect:()=>{var f;(f=o())==null||f.disconnect(),i=null},observe:f=>{var c;return(c=o())==null?void 0:c.observe(f,{box:"border-box"})},unobserve:f=>{var c;return(c=o())==null?void 0:c.unobserve(f)}}})(),this.range=null,this.setOptions=i=>{var o,f;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:pp,rangeExtractor:vp,onChange:()=>{},measureElement:zp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const B in i){const U=i[B];U!==void 0&&(c[B]=U)}const v=this.options;let d=null,g=null,y=!1;if(v!==void 0&&v.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const B=v.count,U=c.count,H=this.getMeasurements(),J=B>0?((o=H[0])==null?void 0:o.key)??v.getItemKey(0):null,et=B>0?((f=H[B-1])==null?void 0:f.key)??v.getItemKey(B-1):null;if(U!==B||B>0&&U>0&&(c.getItemKey(0)!==J||c.getItemKey(U-1)!==et)){y=!0;const tt=B>0?this.getVirtualItemForOffset(this.getScrollOffset())??H[0]:null;tt&&(d=[tt.key,this.getScrollOffset()-tt.start]);const ht=c.followOnAppend===!0?"auto":c.followOnAppend||null;ht&&U>B&&this.isAtEnd(v.scrollEndThreshold)&&(B===0||c.getItemKey(U-1)!==et)&&(g=ht)}}this.options=c,y&&(this.pendingMin=0,this.itemSizeCacheVersion++);let k=!1,x=0;if(d&&this.scrollOffset!==null){const[B,U]=d,H=this.getMeasurements(),{count:J,getItemKey:et}=this.options;let L=0;for(;L{var o,f;(f=(o=this.options).onChange)==null||f.call(o,this,i)},this.maybeNotify=Ml(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(i=>i()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(c=>{this.observer.observe(c)}),this.unsubs.push(this.options.observeElementRect(this,c=>{this.scrollRect=c,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(c,v)=>{if(v&&this._intendedScrollOffset===null&&c===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(c-this._intendedScrollOffset)<1.5&&(c=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=v?d===c?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Vc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};c.addEventListener("touchstart",v,nu),c.addEventListener("touchend",d,nu),this.unsubs.push(()=>{c.removeEventListener("touchstart",v),c.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const f=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,f&&this.scrollElement&&this.options.enabled){const[c,v,d,g]=f;c!==null&&!d&&(Vc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?g!==0&&(this._iosDeferredAdjustment+=g):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const i=this.getScrollOffset(),o=this.getMaxScrollOffset();if(i<0||i>o)return;if(this._iosDeferredAdjustment<0&&i>=o-1){this._iosDeferredAdjustment=0;return}const f=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(i,{adjustments:this.scrollAdjustments+=f,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ml(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,o,f,c,v,d,g,y)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:y}),{key:!1}),this.getMeasurements=Ml(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:o,scrollMargin:f,getItemKey:c,enabled:v,lanes:d,laneAssignmentMode:g,gap:y},k)=>{const x=this.itemSizeCache;if(!v)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(const L of this.laneAssignments.keys())L>=i&&this.laneAssignments.delete(L);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(L=>{this.itemSizeCache.set(L.key,L.size)}));const B=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),d===1){const L=i*2;let Q=this._flatMeasurements;if(!Q||Q.length0&&at.set(Q.subarray(0,B*2)),Q=at,this._flatMeasurements=Q}let tt;if(B===0)tt=o+f;else{const at=B-1;tt=Q[at*2]+Q[at*2+1]+y}for(let at=B;at1){ht=tt;const Qt=H[ht],Ot=Qt!==void 0?U[Qt]:void 0;at=Ot?Ot.end+y:o+f}else if(et===d){let Qt=0,Ot=J[0],Lt=H[0];for(let Zt=1;Ztthis.options.debug}),this.calculateRange=Ml(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,o,f,c)=>i.length===0||o===0?(this.range=null,null):(this.range=xp(i,o,f,c,c===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ml(()=>{let i=null,o=null;const f=this.calculateRange();return f&&(i=f.startIndex,o=f.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,o]},(i,o,f,c,v)=>c===null||v===null?[]:i({startIndex:c,endIndex:v,overscan:o,count:f}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{const o=this.options.indexAttribute,f=i.getAttribute(o);return f?parseInt(f,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const f=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(f!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),v=Math.max(0,f-c),d=Math.min(this.options.count-1,f+c);return i>=v&&i<=d}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((v,d)=>{v.isConnected||(this.observer.unobserve(v),this.elementsCache.delete(d))});return}const o=this.indexFromElement(i),f=this.options.getItemKey(o),c=this.elementsCache.get(f);c!==i&&(c&&this.observer.unobserve(c),this.observer.observe(i),this.elementsCache.set(f,i)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,o)=>{var f,c;if(i<0||i>=this.options.count)return;let v,d,g;const y=this._flatMeasurements;if(this.options.lanes===1&&y!==null)g=this.options.getItemKey(i),d=y[i*2],v=y[i*2+1];else{const B=this.measurementsCache[i];if(!B)return;g=B.key,d=B.start,v=B.size}const k=this.itemSizeCache.get(g)??v,x=o-k;if(x!==0){const B=this.options.anchorTo==="end"&&((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,U=B?this.getTotalSize():0,H=this.getScrollOffset()+this.scrollAdjustments,et=!this.itemSizeCache.has(g)?d[this.getVirtualIndexes(),this.getMeasurements()],(i,o)=>{const f=[];for(let c=0,v=i.length;cthis.options.debug}),this.getVirtualItemForOffset=i=>{const o=this.getMeasurements();if(o.length===0)return;const f=this._flatMeasurements,c=this.options.lanes===1&&f!=null,v=uh(0,o.length-1,c?d=>f[d*2]:d=>eh(o[d]).start,i);return eh(o[v])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const i=this.scrollElement.document.documentElement;return this.options.horizontal?i.scrollWidth-this.scrollElement.innerWidth:i.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,o,f=0)=>{if(!this.scrollElement)return 0;const c=this.getSize(),v=this.getScrollOffset();o==="auto"&&(o=i>=v+c?"end":"start"),o==="center"?i+=(f-c)/2:o==="end"&&(i-=c);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,i),0)},this.getOffsetForIndex=(i,o="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));const f=this.getSize(),c=this.getScrollOffset(),v=this.measurementsCache[i];if(!v)return;if(o==="auto")if(v.end>=c+f-this.options.scrollPaddingEnd)o="end";else if(v.start<=c+this.options.scrollPaddingStart)o="start";else return[c,o];if(o==="end"&&i===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?v.end+this.options.scrollPaddingEnd:v.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,v.size),o]},this.scrollToOffset=(i,{align:o="start",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0;const c=this.getOffsetForAlignment(i,o),v=this.now();this.scrollState={index:null,align:o,behavior:f,startedAt:v,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollToIndex=(i,{align:o="auto",behavior:f="auto"}={})=>{this._iosDeferredAdjustment=0,i=Math.max(0,Math.min(i,this.options.count-1));const c=this.getOffsetForIndex(i,o);if(!c)return;const[v,d]=c,g=this.now();this.scrollState={index:i,align:d,behavior:f,startedAt:g,lastTargetOffset:v,stableFrames:0},this._scrollToOffset(v,{adjustments:void 0,behavior:f}),this.scheduleScrollReconcile()},this.scrollBy=(i,{behavior:o="auto"}={})=>{const f=this.getScrollOffset()+i,c=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:c,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:i});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.getTotalSize=()=>{var i;const o=this.getMeasurements();let f;if(o.length===0)f=this.options.paddingStart;else if(this.options.lanes===1){const c=o.length-1,v=this._flatMeasurements;v!=null?f=v[c*2]+v[c*2+1]:f=((i=o[c])==null?void 0:i.end)??0}else{const c=Array(this.options.lanes).fill(null);let v=o.length-1;for(;v>=0&&c.some(d=>d===null);){const d=o[v];c[d.lane]===null&&(c[d.lane]=d.end),v--}f=Math.max(...c.filter(d=>d!==null))}return Math.max(f-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const i=[];if(this.itemSizeCache.size===0)return i;const o=this.getMeasurements();for(const f of o)f&&this.itemSizeCache.has(f.key)&&i.push({index:f.index,key:f.key,start:f.start,size:f.size,end:f.end,lane:f.lane});return i},this._scrollToOffset=(i,{adjustments:o,behavior:f})=>{this._intendedScrollOffset=i+(o??0),this.options.scrollToFn(i,{behavior:f,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(a)}applyScrollAdjustment(a,i){return a===0?!1:Vc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=a,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:i}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,f=o?o[0]:this.scrollState.lastTargetOffset,c=1,v=f!==this.scrollState.lastTargetOffset;if(!v&&mp(f,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=c){this.getScrollOffset()!==f&&this._scrollToOffset(f,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,v){const d=this.getSize()||600,g=Math.abs(f-this.getScrollOffset()),y=this.scrollState.behavior==="smooth"&&g>d;this.scrollState.lastTargetOffset=f,y||(this.scrollState.behavior="auto"),this._scrollToOffset(f,{adjustments:void 0,behavior:y?"smooth":"auto"})}this.scheduleScrollReconcile()}}const uh=(m,a,i,o)=>{for(;m<=a;){const f=(m+a)/2|0,c=i(f);if(co)a=f-1;else return f}return m>0?m-1:0};function Op(m,a,i){let o=0;for(;o<=a;){const f=(o+a)/2|0,c=m[f*2];if(ci)a=f-1;else return f}return o>0?o-1:0}function xp(m,a,i,o,f){const c=m.length-1;if(m.length<=o)return{startIndex:0,endIndex:c};if(o===1&&f!==null){const y=Op(f,c,i);let k=y;const x=i+a;for(;km[y].start,i),g=d;if(o===1)for(;g1){const y=Array(o).fill(0);for(;gx=0&&k.some(x=>x>=i);){const x=m[d];k[x.lane]=x.start,d--}d=Math.max(0,d-d%o),g=Math.min(c,g+(o-1-g%o))}return{startIndex:d,endIndex:g}}const Yc=typeof document<"u"?Z.useLayoutEffect:Z.useEffect;function _p({useFlushSync:m=!0,directDomUpdates:a=!1,directDomUpdatesMode:i="transform",...o}){const f=Z.useReducer(k=>k+1,0)[1],c=Z.useRef({enabled:a,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});c.current.enabled=a,c.current.mode=i;const v=k=>{const x=c.current;if(!x.enabled||!x.container)return;const B=k.getTotalSize();if(B!==x.lastSize){x.lastSize=B;const U=k.options.horizontal?"width":"height";x.container.style[U]=`${B}px`}},d=k=>{const x=c.current;if(!x.enabled||!x.container)return;v(k);const B=!!k.options.horizontal,U=x.mode==="transform",H=B?"left":"top",J=k.options.scrollMargin,et=k.getVirtualItems();for(const L of et){const Q=L.start-J,tt=k.elementsCache.get(L.key);tt&&x.lastPositions.get(tt)!==Q&&(x.lastPositions.set(tt,Q),U?tt.style.transform=B?`translate3d(${Q}px, 0, 0)`:`translate3d(0, ${Q}px, 0)`:tt.style[H]=`${Q}px`)}},g={...o,onChange:(k,x)=>{var B;const U=c.current;let H=!0;if(U.enabled){d(k);const J=k.range,et=U.prevRange;H=!et||et.isScrolling!==k.isScrolling||et.startIndex!==J?.startIndex||et.endIndex!==J?.endIndex,H&&(U.prevRange=J?{startIndex:J.startIndex,endIndex:J.endIndex,isScrolling:k.isScrolling}:null)}H&&(m&&x?Cm.flushSync(f):f()),(B=o.onChange)==null||B.call(o,k,x)}},[y]=Z.useState(()=>{const k=new Ap(g);return Object.assign(k,{containerRef:x=>{const B=c.current;if(B.container=x,B.lastSize=null,x&&B.enabled){const U=k.getTotalSize();B.lastSize=U;const H=k.options.horizontal?"width":"height";x.style[H]=`${U}px`}}})});return y.setOptions(g),Yc(()=>y._didMount(),[]),Yc(()=>(v(y),y._willUpdate())),Yc(()=>{d(y)}),y}function jp(m){return _p({observeElementRect:bp,observeElementOffset:kp,scrollToFn:Np,...m})}function Kn({value:m,depth:a=0}){return m===null?p.jsx("span",{className:"value-null",children:"null"}):typeof m=="string"?p.jsx("span",{className:"value-string",children:m}):typeof m=="number"||typeof m=="boolean"?p.jsx("span",{className:"value-scalar",children:String(m)}):Array.isArray(m)?p.jsx("ol",{className:"value-list",children:m.map((i,o)=>p.jsx("li",{children:p.jsx(Kn,{value:i,depth:a+1})},`${a}-${o}`))}):An(m)?m.kind==="predict_rlm_file"&&typeof m.path=="string"?p.jsxs("span",{className:"file-value",title:"Reported host path; contents are not copied",children:[p.jsx("span",{"aria-hidden":"true",children:"↗"}),p.jsxs("span",{children:[p.jsx("small",{children:"PredictRLM file"}),p.jsx("code",{children:m.path})]})]}):m.kind==="unavailable"&&typeof m.reason=="string"?p.jsxs("span",{className:"value-unavailable",children:["Unavailable · ",m.reason]}):p.jsx("dl",{className:"value-object",children:Object.entries(m).map(([i,o])=>p.jsxs("div",{children:[p.jsx("dt",{children:i}),p.jsx("dd",{children:p.jsx(Kn,{value:o,depth:a+1})})]},i))}):p.jsx("span",{className:"value-unavailable",children:"Unavailable"})}const Dp=[],Mp=[];function Gc({value:m}){return p.jsx("pre",{className:"json-block",children:JSON.stringify(m,null,2)})}function Rp(m){if(An(m))return An(m.data)?m.data:m}function wp({api:m,workflow:a,run:i,nodeId:o,liveEvents:f=Dp,liveLogs:c=Mp,onClose:v}){const[d,g]=Z.useState("overview"),[y,k]=Z.useState([]),[x,B]=Z.useState([]),[U,H]=Z.useState(),[J,et]=Z.useState(),[L,Q]=Z.useState(),[tt,ht]=Z.useState(!0),at=Z.useRef(new Map),Ut=Z.useRef(null),F=i?.nodes.find(R=>R.nodeId===o),Tt=i?void 0:lh(a?.agentMetadataJson[o??""]),re=i?ah(i.topology?.agentFieldSchemasJson[o??""]):void 0;Z.useEffect(()=>{if(g("overview"),k([]),B([]),H(void 0),et(void 0),ht(!0),at.current.clear(),!i||!o)return;let R=!0;return Promise.all([m.listAgentEvents(i,o),m.listLogs(i)]).then(([Y,bt])=>{R&&(k(Y),B(bt.filter(ct=>!ct.nodeId||ct.nodeId===o)))}).catch(Y=>{R&&Q(Y instanceof Error?Y.message:"Details unavailable")}),()=>{R=!1}},[m,o,i]);const Qt=Z.useMemo(()=>{const R=new Map;for(const Y of[...y,...f])R.set(Y.eventSequence,Y);return[...R.values()].sort((Y,bt)=>Number(Y.eventSequence)-Number(bt.eventSequence))},[y,f]),Ot=Qt.filter(R=>R.eventKind==="iteration.recorded"),Lt=Z.useMemo(()=>{const R=new Map;for(const Y of[...x,...c])R.set(Y.sequence,Y);return[...R.values()].sort((Y,bt)=>Number(Y.sequence)-Number(bt.sequence))},[c,x]),Zt=Z.useMemo(()=>{const R=F?.trace?.header?.usageJson;return R?JSON.parse(R):void 0},[F?.trace?.header?.usageJson]),de=Z.useMemo(()=>{const R=F?.trace?.header?.telemetryJson;return R?JSON.parse(R):void 0},[F?.trace?.header?.telemetryJson]),he=d==="inputs"?re?.inputs:d==="output"?re?.outputs:void 0,D=jp({count:Ot.length,getScrollElement:()=>Ut.current,estimateSize:()=>64,overscan:6});if(Z.useEffect(()=>{!tt||!Ot.length||H(Ot.at(-1).eventSequence)},[tt,Ot]),Z.useEffect(()=>{const R=Qt.find(ct=>ct.eventSequence===U);if(!R?.bodyToken){et(void 0);return}const Y=at.current.get(R.bodyToken);if(Y!==void 0){at.current.delete(R.bodyToken),at.current.set(R.bodyToken,Y),et(Y);return}let bt=!0;return et(void 0),Q(void 0),m.readDetail(R.bodyToken).then(ct=>{if(bt){for(at.current.delete(R.bodyToken),at.current.set(R.bodyToken,ct);at.current.size>8;){const ot=at.current.keys().next().value;if(ot===void 0)break;at.current.delete(ot)}et(ct)}}).catch(ct=>{bt&&Q(ct instanceof Error?ct.message:"Detail unavailable")}),()=>{bt=!1}},[m,Qt,U]),Z.useEffect(()=>{const R=d==="inputs"?"run.started":d==="output"?"run.succeeded":void 0;if(!R)return;const Y=[...Qt].reverse().find(bt=>bt.eventKind===R);Y&&H(Y.eventSequence)},[Qt,d]),!i&&a&&o)return p.jsxs("aside",{className:"inspector","aria-label":"Node declaration",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Declaration"}),p.jsx("h2",{children:a.displayNames[o]||o})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),Tt?p.jsxs("div",{className:"inspector-body declaration",children:[p.jsxs("section",{children:[p.jsx("h3",{children:"Instructions"}),p.jsx("p",{className:"instructions",children:Tt.instructions||"No instructions"})]}),p.jsxs("section",{className:"signature-columns",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"Inputs"}),Tt.inputs.map(R=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:R.name}),p.jsx("code",{children:R.type}),p.jsx("p",{children:R.description})]},R.name))]}),p.jsxs("div",{children:[p.jsx("h3",{children:"Outputs"}),Tt.outputs.map(R=>p.jsxs("div",{className:"field-detail",children:[p.jsx("strong",{children:R.name}),p.jsx("code",{children:R.type}),p.jsx("p",{children:R.description})]},R.name))]})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Runtime"}),p.jsx(Gc,{value:Tt.runtime})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Models"}),p.jsx(Gc,{value:Tt.model})]}),p.jsxs("section",{children:[p.jsx("h3",{children:"Skills & tools"}),p.jsx(Gc,{value:{skills:Tt.skills,tools:Tt.tools}})]})]}):p.jsx("p",{className:"empty-copy",children:"This node has no agent declaration metadata."})]});if(!i||!F)return null;const q=Rp(J),K=d==="inputs"?"inputs":"outputs";return p.jsxs("aside",{className:"inspector","aria-label":"Run inspector",children:[p.jsxs("header",{children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"Historical execution"}),p.jsx("h2",{children:F.name}),p.jsx("span",{className:`status-pill status-${F.status}`,children:F.status})]}),p.jsx("button",{type:"button",className:"icon-button",onClick:v,"aria-label":"Close",children:"×"})]}),p.jsx("nav",{className:"inspector-tabs","aria-label":"Run detail views",children:["overview","inputs","output","trace","logs"].map(R=>p.jsx("button",{type:"button",className:d===R?"active":"",onClick:()=>g(R),children:R},R))}),p.jsxs("div",{className:"inspector-body",children:[L&&p.jsx("p",{className:"error-banner",children:L}),d==="overview"&&p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:"metric-grid",children:[p.jsxs("div",{children:[p.jsx("small",{children:"Status"}),p.jsx("strong",{children:F.status})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Revision"}),p.jsx("strong",{children:F.revision})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Started"}),p.jsx("strong",{children:F.startedAt?"yes":"—"})]}),p.jsxs("div",{children:[p.jsx("small",{children:"Duration"}),p.jsx("strong",{children:F.startedAt&&F.endedAt?`${Math.max(0,F.endedAt-F.startedAt).toFixed(2)}s`:"—"})]})]}),F.error&&p.jsx("p",{className:"node-failure",children:F.error}),F.trace&&p.jsxs("section",{children:[p.jsx("h3",{children:"Trace header"}),p.jsxs("dl",{className:"trace-header",children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Status"}),p.jsx("dd",{children:F.trace.status})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Events"}),p.jsx("dd",{children:F.trace.eventCount})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Size"}),p.jsxs("dd",{children:[F.trace.sizeBytes," B"]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Complete"}),p.jsx("dd",{children:F.trace.complete?"yes":"no"})]}),F.trace.header&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("dt",{children:"Model"}),p.jsx("dd",{children:F.trace.header.model})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Iterations"}),p.jsxs("dd",{children:[F.trace.header.iterations,"/",F.trace.header.maxIterations]})]}),p.jsxs("div",{children:[p.jsx("dt",{children:"Duration"}),p.jsxs("dd",{children:[F.trace.header.durationMs," ms"]})]})]})]}),Zt!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Usage"}),p.jsx(Kn,{value:Zt})]}),de!==void 0&&p.jsxs("div",{className:"trace-summary",children:[p.jsx("h3",{children:"Telemetry"}),p.jsx(Kn,{value:de})]})]})]}),(d==="inputs"||d==="output")&&p.jsxs("section",{children:[p.jsx("h3",{children:d==="inputs"?"Invocation inputs":"Terminal output"}),he?.length?p.jsxs("div",{className:"declared-fields",children:[p.jsx("small",{children:"Declared fields"}),he.map(R=>p.jsxs("span",{children:[p.jsx("strong",{children:R.name}),p.jsx("code",{children:R.type})]},R.name))]}):null,q&&K in q?p.jsx(Kn,{value:q[K]}):p.jsxs("p",{className:"empty-copy",children:["No retained ",d," ",d==="output"?"is":"are"," available."]})]}),d==="trace"&&p.jsxs("section",{className:"trace-layout",children:[p.jsxs("div",{className:"trace-toolbar",children:[p.jsxs("div",{children:[p.jsx("h3",{children:"RunTrace"}),p.jsxs("span",{children:[Ot.length," complete turns"]})]}),p.jsx("button",{type:"button",className:tt?"toggle active":"toggle",onClick:()=>ht(R=>!R),children:tt?"Following live":"Follow latest"})]}),p.jsx("div",{className:"turn-list",ref:Ut,children:p.jsx("div",{style:{height:D.getTotalSize(),position:"relative"},children:D.getVirtualItems().map(R=>{const Y=Ot[R.index];return p.jsxs("button",{type:"button",className:`turn-row ${U===Y.eventSequence?"active":""} ${Y.error?"failed":""}`,style:{transform:`translateY(${R.start}px)`},onClick:()=>{ht(!1),H(Y.eventSequence)},children:[p.jsxs("strong",{children:["Turn ",Y.iteration??R.index+1]}),p.jsx("span",{children:Y.durationMs?`${Y.durationMs} ms`:"—"}),p.jsxs("small",{children:[Y.toolCount," tools · ",Y.predictCount," predicts"]})]},Y.eventSequence)})})}),p.jsx("div",{className:"turn-detail",children:J!==void 0?p.jsx(Kn,{value:J}):p.jsx("p",{className:"empty-copy",children:"Select a turn."})})]}),d==="logs"&&p.jsxs("section",{children:[p.jsx("h3",{children:"Node logs"}),p.jsx("div",{className:"log-list",children:Lt.map(R=>p.jsxs("button",{type:"button",onClick:()=>{m.readDetail(R.bodyToken).then(et).catch(Y=>{Q(Y instanceof Error?Y.message:"Log unavailable")})},children:[p.jsx("span",{className:`log-level level-${R.level}`,children:R.level}),p.jsx("time",{children:new Date(R.timestamp*1e3).toLocaleTimeString()}),p.jsxs("span",{children:["#",R.sequence]})]},R.sequence))}),J!==void 0&&p.jsx(Kn,{value:J})]})]})]})}function Up({value:m,onChange:a}){const i=Z.useRef(null);return Z.useEffect(()=>{if(!i.current)return;const o=new ja({parent:i.current,state:Vm.create({doc:m,extensions:[Ym(),Gm.of([]),ja.lineWrapping,ja.contentAttributes.of({"aria-label":"Workflow input JSON"}),ja.theme({"&":{backgroundColor:"#ffffff",color:"#17211c"},".cm-content":{caretColor:"#2563eb",minHeight:"110px"},".cm-gutters":{backgroundColor:"#f6f8f7",color:"#7b8680",border:"0"},"&.cm-focused":{outline:"1px solid #9bb6f5"}}),ja.updateListener.of(f=>{f.docChanged&&a(f.state.doc.toString())})]})});return()=>o.destroy()},[]),p.jsx("div",{className:"json-editor",ref:i})}function Bp(m){const a=JSON.parse(m);if(!An(a))throw new Error("Run input must be a JSON object");return a}function qp({workflow:m,run:a,pending:i,onStart:o,onCancel:f}){const[c,v]=Z.useState(!1),[d,g]=Z.useState("{}"),[y,k]=Z.useState(),x=a?.summary?.status==="pending"||a?.summary?.status==="running",B=async()=>{if(!m)return;k(void 0);let U;if(c)try{U=Bp(d)}catch(H){k(H instanceof Error?H.message:"Run input is invalid JSON");return}try{await o(m.workflowId,U)}catch(H){k(H instanceof Error?H.message:"Operator rejected the run")}};return p.jsxs("div",{className:"run-controls",children:[m&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"run-button",disabled:i?.kind==="start",onClick:()=>{B()},children:i?.kind==="start"?"Requesting…":"Run"}),p.jsx("button",{type:"button",className:`input-toggle ${c?"active":""}`,onClick:()=>v(U=>!U),children:c?"Hide JSON input":"Add JSON input"})]}),x&&a?.summary&&p.jsx("button",{type:"button",className:"cancel-button",disabled:i?.kind==="cancel",onClick:()=>{k(void 0),f(a.summary.runId).catch(U=>{k(U instanceof Error?U.message:"Cancellation failed")})},children:i?.kind==="cancel"?"Cancelling…":"Cancel run"}),c&&m&&p.jsxs("div",{className:"input-popover",children:[p.jsxs("div",{children:[p.jsx("strong",{children:"Workflow input"}),p.jsx("span",{children:"Schema-blind JSON object"})]}),p.jsx(Up,{value:d,onChange:g})]}),y&&p.jsx("div",{className:"action-error",children:y})]})}const sh={runs:{},liveEvents:{},liveLogs:{},operatorInstanceId:"",sequence:"0",connection:"connecting"};function Cp(m,a){if(a.type==="baseline"){const g=Object.fromEntries(a.baseline.runs.filter(y=>y.summary).map(y=>[y.summary.runId,y]));return{...sh,catalog:a.baseline.catalog,runs:g,operatorInstanceId:a.baseline.catalog.operatorInstanceId,sequence:a.baseline.asOfSequence,connection:"live"}}if(a.type==="connection")return{...m,connection:a.connection,error:a.error};if(a.type==="action")return{...m,action:a.action};const{envelope:i}=a;if(i.operatorInstanceId!==m.operatorInstanceId)throw new Error("Operator epoch changed");if(i.payload.oneofKind!=="update")throw new Error("Operator requested a structural reset");const o=i.payload.update;if(BigInt(o.sequence)!==BigInt(m.sequence)+1n)throw new Error(`Operator update gap after sequence ${m.sequence}`);const f={...m,sequence:o.sequence,error:void 0},c=o.change;if(c.oneofKind==="catalogReplaced")return c.catalogReplaced.catalog&&(f.catalog=c.catalogReplaced.catalog),f;if(c.oneofKind==="runCreated"&&c.runCreated.summary){const g=c.runCreated.summary;return f.runs={...m.runs,[g.runId]:{operatorInstanceId:m.operatorInstanceId,asOfSequence:o.sequence,summary:g,nodes:c.runCreated.nodes,latestLogSequence:"0",logPageToken:"",topology:c.runCreated.topology}},f}const v=c.oneofKind==="runStatusChanged"?c.runStatusChanged.runId:c.oneofKind==="nodeStatusChanged"?c.nodeStatusChanged.runId:c.oneofKind==="logAppended"?c.logAppended.runId:c.oneofKind==="agentEventAppended"?c.agentEventAppended.runId:c.oneofKind==="traceFinalized"?c.traceFinalized.runId:"",d=m.runs[v];if(!d)throw new Error(`Operator update referenced unknown run ${v}`);if(c.oneofKind==="runStatusChanged"&&d.summary)f.runs={...m.runs,[v]:{...d,summary:{...d.summary,status:c.runStatusChanged.status,startedAt:c.runStatusChanged.startedAt,endedAt:c.runStatusChanged.endedAt,revision:c.runStatusChanged.revision}}};else if(c.oneofKind==="nodeStatusChanged"){const g=c.nodeStatusChanged;f.runs={...m.runs,[v]:{...d,nodes:d.nodes.map(y=>y.nodeId===g.nodeId?{...y,status:g.status,startedAt:g.startedAt,endedAt:g.endedAt,revision:g.revision,error:g.error}:y)}}}else if(c.oneofKind==="logAppended"&&c.logAppended.log)f.liveLogs={...m.liveLogs,[v]:[...m.liveLogs[v]??[],c.logAppended.log]};else if(c.oneofKind==="agentEventAppended"&&c.agentEventAppended.event){const g=`${v}:${c.agentEventAppended.nodeId}`;f.liveEvents={...m.liveEvents,[g]:[...m.liveEvents[g]??[],c.agentEventAppended.event]}}else c.oneofKind==="traceFinalized"&&c.traceFinalized.trace&&(f.runs={...m.runs,[v]:{...d,nodes:d.nodes.map(g=>g.nodeId===c.traceFinalized.nodeId?{...g,trace:c.traceFinalized.trace}:g)}});return f}function Lp(m){const[a,i]=Z.useReducer(Cp,sh),o=Z.useRef(0),f=Z.useCallback(async()=>{const d=await m.loadBaseline();return i({type:"baseline",baseline:d}),d},[m]);Z.useEffect(()=>{const d=++o.current;let g=!1;return(async()=>{let k=250;for(;!g&&o.current===d;)try{i({type:"connection",connection:"connecting"});const x=await m.loadBaseline();if(g)return;i({type:"baseline",baseline:x}),k=250;let B=x.asOfSequence;for await(const U of m.streamUpdates(x.catalog.operatorInstanceId,B)){if(g)return;if(U.payload.oneofKind!=="update"||BigInt(U.payload.update.sequence)!==BigInt(B)+1n)break;i({type:"envelope",envelope:U}),B=U.payload.update.sequence}i({type:"connection",connection:"reconnecting"})}catch(x){if(g)return;i({type:"connection",connection:"reconnecting",error:x instanceof Error?x.message:"Operator connection failed"});const{promise:B,resolve:U}=Promise.withResolvers();window.setTimeout(U,k),await B,k=Math.min(k*2,4e3)}})(),()=>{g=!0,o.current+=1}},[m]);const c=Z.useCallback(async(d,g)=>{i({type:"action",action:{kind:"start",target:d}});try{return await m.startRun(d,g)}finally{i({type:"action",action:void 0})}},[m]),v=Z.useCallback(async d=>{i({type:"action",action:{kind:"cancel",target:d}});try{await m.cancelRun(d)}finally{i({type:"action",action:void 0})}},[m]);return{state:a,reconcile:f,startRun:c,cancelRun:v}}function Hp({api:m}){const{state:a,startRun:i,cancelRun:o}=Lp(m),[f,c]=Z.useState(),[v,d]=Z.useState(),[g,y]=Z.useState(!1);Z.useEffect(()=>{const L=a.catalog?.workflows??[];if(!L.length){c(void 0);return}if(!f){c({kind:"workflow",workflowId:L[0].workflowId});return}L.some(Q=>Q.workflowId===f.workflowId)||c({kind:"workflow",workflowId:L[0].workflowId})},[f,a.catalog]);const k=a.catalog?.workflows.find(L=>L.workflowId===f?.workflowId),x=f?.kind==="run"?a.runs[f.runId]:void 0,B=Z.useMemo(()=>Object.values(a.runs).filter(L=>L.summary?.workflowId===k?.workflowId).sort((L,Q)=>Number(Q.summary.createdSequence)-Number(L.summary.createdSequence))[0],[a.runs,k?.workflowId]),U=Z.useCallback(L=>d(L),[]),H=Z.useCallback(L=>{c(L),d(void 0),y(!1)},[]),J=x??(f?.kind==="workflow"?B:void 0),et=x&&v?`${x.summary?.runId}:${v}`:"";return p.jsxs("div",{className:`app-shell ${g?"explorer-open":""}`,children:[p.jsxs("header",{className:"topbar",children:[p.jsxs("div",{className:"brand",children:[p.jsx("span",{className:"brand-mark","aria-hidden":"true",children:"A"}),p.jsxs("div",{children:[p.jsx("strong",{children:"Avalanche"}),p.jsx("span",{children:"Operator"})]})]}),p.jsxs("div",{className:"breadcrumb",children:[p.jsx("span",{children:k?.rootAlias||"Local operator"}),k&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:k.displayName})]}),x?.summary&&p.jsxs(p.Fragment,{children:[p.jsx("i",{children:"/"}),p.jsx("strong",{children:x.summary.runId})]})]}),p.jsxs("div",{className:`connection connection-${a.connection}`,children:[p.jsx("span",{}),a.connection==="live"?"Live":a.connection,p.jsxs("small",{children:["seq ",a.sequence]})]}),p.jsx("button",{type:"button",className:"explorer-toggle","aria-controls":"operator-explorer","aria-expanded":g,onClick:()=>y(L=>!L),children:"Explorer"})]}),a.error&&p.jsx("div",{className:"connection-error",children:a.error}),p.jsxs("main",{className:`workspace ${v?"with-inspector":""}`,children:[p.jsx(op,{catalog:a.catalog,runs:a.runs,selection:f,onSelect:H}),p.jsxs("section",{className:"canvas-shell",children:[p.jsxs("header",{className:"view-header",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:x?"Historical run":"Current definition"}),p.jsx("h1",{children:x?.summary?.runId||k?.displayName||"Operator"}),p.jsx("p",{children:x?`Recorded topology · ${x.summary?.status??"unknown"}`:k?`${k.nodeIds.length} nodes · ${k.relativeFile}`:"Waiting for a workflow catalog"})]}),p.jsx(qp,{workflow:x?void 0:k,run:x??J,pending:a.action,onStart:i,onCancel:o})]}),p.jsxs("div",{className:x?"canvas run-canvas":"canvas blueprint-canvas",children:[k||x?.topology?p.jsx(hp,{workflow:x?void 0:k,runTopology:x?.topology,runNodes:x?.nodes,onOpenNode:U}):p.jsxs("div",{className:"empty-state",children:[p.jsx("span",{children:"◇"}),p.jsx("h2",{children:"No workflows discovered"}),p.jsx("p",{children:"Catalog changes will appear here as the operator scans configured targets."})]}),x&&p.jsxs("div",{className:"historical-badge",children:[p.jsx("span",{children:"Immutable run snapshot"}),"Current workflow changes do not alter this canvas"]})]})]}),v&&p.jsx(wp,{api:m,workflow:k,run:x,nodeId:v,liveEvents:a.liveEvents[et],liveLogs:x?.summary?a.liveLogs[x.summary.runId]:void 0,onClose:()=>d(void 0)})]})]})}const ch=document.getElementById("root");if(!ch)throw new Error("Operator UI root element is missing");Jm.createRoot(ch).render(p.jsx(Z.StrictMode,{children:p.jsx(Hp,{api:new ip})})); diff --git a/src/runtime/operator/web_assets/index.html b/src/runtime/operator/web_assets/index.html index 46acef9..856583a 100644 --- a/src/runtime/operator/web_assets/index.html +++ b/src/runtime/operator/web_assets/index.html @@ -5,7 +5,7 @@ Avalanche Operator - + diff --git a/web/operator/src/api.ts b/web/operator/src/api.ts index 6a646e0..0dc3862 100644 --- a/web/operator/src/api.ts +++ b/web/operator/src/api.ts @@ -1,5 +1,7 @@ import { GrpcWebFetchTransport } from "@protobuf-ts/grpcweb-transport"; +import { DescriptorPageOrder } from "./generated/operator"; + import { OperatorServiceClient } from "./generated/operator.client"; import type { AgentEventDescriptorMsg, @@ -108,6 +110,8 @@ export class GrpcWebOperatorApi implements OperatorApi { pageToken, afterEventSequence, pageSize: 100, + beforeEventSequence: "0", + order: DescriptorPageOrder.FORWARD, }).response; events.push(...page.events); if (page.events.length) { @@ -128,6 +132,9 @@ export class GrpcWebOperatorApi implements OperatorApi { pageToken, afterSequence, pageSize: 100, + beforeSequence: "0", + nodeId: "", + order: DescriptorPageOrder.FORWARD, }).response; logs.push(...page.logs); if (page.logs.length) afterSequence = page.logs.at(-1)!.sequence; diff --git a/web/operator/src/generated/operator.client.ts b/web/operator/src/generated/operator.client.ts index ef79845..1e40f33 100644 --- a/web/operator/src/generated/operator.client.ts +++ b/web/operator/src/generated/operator.client.ts @@ -15,6 +15,7 @@ import type { AgentEventPage } from "./operator"; import type { ListAgentEventsRequest } from "./operator"; import type { LogPage } from "./operator"; import type { ListLogsRequest } from "./operator"; +import type { GetLatestRunSnapshotRequest } from "./operator"; import type { RunSnapshotMsg } from "./operator"; import type { GetRunSnapshotRequest } from "./operator"; import type { RunSummaryPage } from "./operator"; @@ -63,6 +64,10 @@ export interface IOperatorServiceClient { * @generated from protobuf rpc: GetRunSnapshot */ getRunSnapshot(input: GetRunSnapshotRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: GetLatestRunSnapshot + */ + getLatestRunSnapshot(input: GetLatestRunSnapshotRequest, options?: RpcOptions): UnaryCall; /** * @generated from protobuf rpc: ListLogs */ @@ -141,39 +146,46 @@ export class OperatorServiceClient implements IOperatorServiceClient, ServiceInf const method = this.methods[5], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } + /** + * @generated from protobuf rpc: GetLatestRunSnapshot + */ + getLatestRunSnapshot(input: GetLatestRunSnapshotRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[6], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } /** * @generated from protobuf rpc: ListLogs */ listLogs(input: ListLogsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[6], opt = this._transport.mergeOptions(options); + const method = this.methods[7], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** * @generated from protobuf rpc: ListAgentEvents */ listAgentEvents(input: ListAgentEventsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[7], opt = this._transport.mergeOptions(options); + const method = this.methods[8], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** * @generated from protobuf rpc: ReadTrace */ readTrace(input: ReadTraceRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[8], opt = this._transport.mergeOptions(options); + const method = this.methods[9], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } /** * @generated from protobuf rpc: ReadDetail */ readDetail(input: ReadDetailRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[9], opt = this._transport.mergeOptions(options); + const method = this.methods[10], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } /** * @generated from protobuf rpc: StreamOperatorUpdates */ streamOperatorUpdates(input: StreamOperatorUpdatesRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[10], opt = this._transport.mergeOptions(options); + const method = this.methods[11], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } } diff --git a/web/operator/src/generated/operator.ts b/web/operator/src/generated/operator.ts index 094bd95..e32d8c4 100644 --- a/web/operator/src/generated/operator.ts +++ b/web/operator/src/generated/operator.ts @@ -133,6 +133,19 @@ export interface GetRunSnapshotRequest { */ asOfSequence: string; } +/** + * @generated from protobuf message avalanche.operator.GetLatestRunSnapshotRequest + */ +export interface GetLatestRunSnapshotRequest { + /** + * @generated from protobuf field: string run_id = 1 + */ + runId: string; + /** + * @generated from protobuf field: string operator_instance_id = 2 + */ + operatorInstanceId: string; +} /** * Page tokens are opaque bearer references issued by GetRunSnapshot. The current * loopback transport does not sign them; authenticated deployments must sign or @@ -142,13 +155,13 @@ export interface GetRunSnapshotRequest { */ export interface ListLogsRequest { /** - * Required snapshot-issued token. after_sequence is relative to this snapshot. + * Required snapshot-issued token. Cursors and filters are relative to this snapshot. * * @generated from protobuf field: string page_token = 1 */ pageToken: string; /** - * Exclusive log cursor within the snapshot identified by page_token. + * Exclusive lower log bound for forward and incremental hydration. * * @generated from protobuf field: uint64 after_sequence = 2 */ @@ -157,19 +170,35 @@ export interface ListLogsRequest { * @generated from protobuf field: uint32 page_size = 3 */ pageSize: number; + /** + * Exclusive upper log bound for newest-first hydration; zero starts at the snapshot end. + * + * @generated from protobuf field: uint64 before_sequence = 4 + */ + beforeSequence: string; + /** + * Optional exact node filter. Continuation tokens bind this filter. + * + * @generated from protobuf field: string node_id = 5 + */ + nodeId: string; + /** + * @generated from protobuf field: avalanche.operator.DescriptorPageOrder order = 6 + */ + order: DescriptorPageOrder; } /** * @generated from protobuf message avalanche.operator.ListAgentEventsRequest */ export interface ListAgentEventsRequest { /** - * Required snapshot-issued token. after_event_sequence is relative to this snapshot. + * Required snapshot-issued token. Cursors are relative to this snapshot. * * @generated from protobuf field: string page_token = 1 */ pageToken: string; /** - * Exclusive event cursor within the snapshot identified by page_token. + * Exclusive lower event bound for forward and incremental hydration. * * @generated from protobuf field: uint64 after_event_sequence = 2 */ @@ -178,6 +207,16 @@ export interface ListAgentEventsRequest { * @generated from protobuf field: uint32 page_size = 3 */ pageSize: number; + /** + * Exclusive upper event bound for newest-first hydration; zero starts at the snapshot end. + * + * @generated from protobuf field: uint64 before_event_sequence = 4 + */ + beforeEventSequence: string; + /** + * @generated from protobuf field: avalanche.operator.DescriptorPageOrder order = 5 + */ + order: DescriptorPageOrder; } /** * @generated from protobuf message avalanche.operator.ReadTraceRequest @@ -1064,6 +1103,19 @@ export interface OperatorUpdateEnvelope { oneofKind: undefined; }; } +/** + * @generated from protobuf enum avalanche.operator.DescriptorPageOrder + */ +export enum DescriptorPageOrder { + /** + * @generated from protobuf enum value: DESCRIPTOR_PAGE_ORDER_FORWARD = 0; + */ + FORWARD = 0, + /** + * @generated from protobuf enum value: DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST = 1; + */ + NEWEST_FIRST = 1 +} // @generated message type with reflection information, may provide speed optimized methods class Empty$Type extends MessageType { constructor() { @@ -1536,12 +1588,70 @@ class GetRunSnapshotRequest$Type extends MessageType { */ export const GetRunSnapshotRequest = new GetRunSnapshotRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods +class GetLatestRunSnapshotRequest$Type extends MessageType { + constructor() { + super("avalanche.operator.GetLatestRunSnapshotRequest", [ + { no: 1, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "operator_instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): GetLatestRunSnapshotRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.runId = ""; + message.operatorInstanceId = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetLatestRunSnapshotRequest): GetLatestRunSnapshotRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string run_id */ 1: + message.runId = reader.string(); + break; + case /* string operator_instance_id */ 2: + message.operatorInstanceId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: GetLatestRunSnapshotRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string run_id = 1; */ + if (message.runId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.runId); + /* string operator_instance_id = 2; */ + if (message.operatorInstanceId !== "") + writer.tag(2, WireType.LengthDelimited).string(message.operatorInstanceId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message avalanche.operator.GetLatestRunSnapshotRequest + */ +export const GetLatestRunSnapshotRequest = new GetLatestRunSnapshotRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods class ListLogsRequest$Type extends MessageType { constructor() { super("avalanche.operator.ListLogsRequest", [ { no: 1, name: "page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "after_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "page_size", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + { no: 3, name: "page_size", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "before_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 5, name: "node_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "order", kind: "enum", T: () => ["avalanche.operator.DescriptorPageOrder", DescriptorPageOrder, "DESCRIPTOR_PAGE_ORDER_"] } ]); } create(value?: PartialMessage): ListLogsRequest { @@ -1549,6 +1659,9 @@ class ListLogsRequest$Type extends MessageType { message.pageToken = ""; message.afterSequence = "0"; message.pageSize = 0; + message.beforeSequence = "0"; + message.nodeId = ""; + message.order = 0; if (value !== undefined) reflectionMergePartial(this, message, value); return message; @@ -1567,6 +1680,15 @@ class ListLogsRequest$Type extends MessageType { case /* uint32 page_size */ 3: message.pageSize = reader.uint32(); break; + case /* uint64 before_sequence */ 4: + message.beforeSequence = reader.uint64().toString(); + break; + case /* string node_id */ 5: + message.nodeId = reader.string(); + break; + case /* avalanche.operator.DescriptorPageOrder order */ 6: + message.order = reader.int32(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -1588,6 +1710,15 @@ class ListLogsRequest$Type extends MessageType { /* uint32 page_size = 3; */ if (message.pageSize !== 0) writer.tag(3, WireType.Varint).uint32(message.pageSize); + /* uint64 before_sequence = 4; */ + if (message.beforeSequence !== "0") + writer.tag(4, WireType.Varint).uint64(message.beforeSequence); + /* string node_id = 5; */ + if (message.nodeId !== "") + writer.tag(5, WireType.LengthDelimited).string(message.nodeId); + /* avalanche.operator.DescriptorPageOrder order = 6; */ + if (message.order !== 0) + writer.tag(6, WireType.Varint).int32(message.order); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -1604,7 +1735,9 @@ class ListAgentEventsRequest$Type extends MessageType { super("avalanche.operator.ListAgentEventsRequest", [ { no: 1, name: "page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "after_event_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "page_size", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + { no: 3, name: "page_size", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "before_event_sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 5, name: "order", kind: "enum", T: () => ["avalanche.operator.DescriptorPageOrder", DescriptorPageOrder, "DESCRIPTOR_PAGE_ORDER_"] } ]); } create(value?: PartialMessage): ListAgentEventsRequest { @@ -1612,6 +1745,8 @@ class ListAgentEventsRequest$Type extends MessageType { message.pageToken = ""; message.afterEventSequence = "0"; message.pageSize = 0; + message.beforeEventSequence = "0"; + message.order = 0; if (value !== undefined) reflectionMergePartial(this, message, value); return message; @@ -1630,6 +1765,12 @@ class ListAgentEventsRequest$Type extends MessageType { case /* uint32 page_size */ 3: message.pageSize = reader.uint32(); break; + case /* uint64 before_event_sequence */ 4: + message.beforeEventSequence = reader.uint64().toString(); + break; + case /* avalanche.operator.DescriptorPageOrder order */ 5: + message.order = reader.int32(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -1651,6 +1792,12 @@ class ListAgentEventsRequest$Type extends MessageType { /* uint32 page_size = 3; */ if (message.pageSize !== 0) writer.tag(3, WireType.Varint).uint32(message.pageSize); + /* uint64 before_event_sequence = 4; */ + if (message.beforeEventSequence !== "0") + writer.tag(4, WireType.Varint).uint64(message.beforeEventSequence); + /* avalanche.operator.DescriptorPageOrder order = 5; */ + if (message.order !== 0) + writer.tag(5, WireType.Varint).int32(message.order); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -4440,6 +4587,7 @@ export const OperatorService = new ServiceType("avalanche.operator.OperatorServi { name: "GetRunResult", options: {}, I: GetRunRequest, O: RunResultMsg }, { name: "ListRunSummaries", options: {}, I: ListRunSummariesRequest, O: RunSummaryPage }, { name: "GetRunSnapshot", options: {}, I: GetRunSnapshotRequest, O: RunSnapshotMsg }, + { name: "GetLatestRunSnapshot", options: {}, I: GetLatestRunSnapshotRequest, O: RunSnapshotMsg }, { name: "ListLogs", options: {}, I: ListLogsRequest, O: LogPage }, { name: "ListAgentEvents", options: {}, I: ListAgentEventsRequest, O: AgentEventPage }, { name: "ReadTrace", serverStreaming: true, options: {}, I: ReadTraceRequest, O: TraceChunk }, From 4730f8a1a409f02c314b4d312d30cec060239790 Mon Sep 17 00:00:00 2001 From: Emile Riberdy <38288472+magix022@users.noreply.github.com> Date: Mon, 3 Aug 2026 19:17:32 +0000 Subject: [PATCH 13/25] perf(operator): bound browser data hydration --- src/runtime/operator/client.py | 20 + src/runtime/operator/operator.py | 251 ++++++- src/runtime/operator/server.py | 17 + src/runtime/operator/web.py | 4 + test/operator_tests/test_grpc.py | 248 +++++++ test/operator_tests/test_state_detail.py | 358 ++++++++- web/operator/src/App.test.tsx | 239 ++++-- web/operator/src/App.tsx | 135 ++-- web/operator/src/Explorer.test.tsx | 168 ++++- web/operator/src/Explorer.tsx | 249 +++++-- web/operator/src/api.test.ts | 253 +++++++ web/operator/src/api.ts | 311 +++++--- web/operator/src/state.test.ts | 880 ++++++++++++++++++++--- web/operator/src/state.ts | 599 +++++++++++---- 14 files changed, 3203 insertions(+), 529 deletions(-) create mode 100644 web/operator/src/api.test.ts diff --git a/src/runtime/operator/client.py b/src/runtime/operator/client.py index 8ef04bb..2e08162 100644 --- a/src/runtime/operator/client.py +++ b/src/runtime/operator/client.py @@ -400,6 +400,21 @@ def _validate_page_accumulation(self, count: int, item_name: str) -> None: f"client {item_name} exceed the configured pagination item limit", ) + def get_latest_run_snapshot( + self, + run_id: str, + operator_instance_id: str, + ) -> RunSnapshot: + """Fetch one latest structural snapshot pinned to an operator epoch.""" + response = self._call( + self._stub.GetLatestRunSnapshot, + pb.GetLatestRunSnapshotRequest( + run_id=run_id, + operator_instance_id=operator_instance_id, + ), + ) + return run_snapshot_from_proto(response) + def get_run(self, run_id: str) -> RunState | None: """Fetch one pinned structural snapshot and lazily hydrate its details.""" last_race: _DetailHydrationRaceError | None = None @@ -668,6 +683,9 @@ def _read_log_pages( page_token=token, after_sequence=cursor, page_size=DETAIL_HYDRATION_PAGE_SIZE, + before_sequence=0, + node_id="", + order=pb.DESCRIPTOR_PAGE_ORDER_FORWARD, ), ) self._validate_detail_page( @@ -726,6 +744,8 @@ def _read_agent_event_pages( page_token=token, after_event_sequence=cursor, page_size=DETAIL_HYDRATION_PAGE_SIZE, + before_event_sequence=0, + order=pb.DESCRIPTOR_PAGE_ORDER_FORWARD, ), ) self._validate_detail_page( diff --git a/src/runtime/operator/operator.py b/src/runtime/operator/operator.py index 68cf8da..89f8676 100644 --- a/src/runtime/operator/operator.py +++ b/src/runtime/operator/operator.py @@ -94,6 +94,8 @@ _PROCESS_GROUP_POLL_INTERVAL_SECONDS = 0.02 DETAIL_PAGE_SIZE = 100 MAX_DETAIL_PAGE_SIZE = 500 +_DESCRIPTOR_PAGE_ORDER_FORWARD = 0 +_DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST = 1 STRUCTURAL_BASELINE_CAPACITY = 8 SUBSCRIBER_QUEUE_CAPACITY = 256 MAX_RUN_ID_BYTES = 256 @@ -309,6 +311,7 @@ def __init__( self._run_revisions: dict[str, int] = {} self._node_revisions: dict[tuple[str, str], int] = {} self._logs: dict[str, list[SequencedLogEntry]] = {} + self._log_sequences_by_node: dict[str, dict[str, list[int]]] = {} self._agent_events: dict[tuple[str, str], list[AgentEvent]] = {} self._trace_descriptors: dict[tuple[str, str], TraceDescriptor] = {} self._trace_bodies: dict[tuple[str, str], dict[int, bytes]] = {} @@ -498,6 +501,28 @@ def get_run_snapshot( baseline = self._retained_structural_baseline_locked(as_of_sequence) return baseline.snapshots.get(run_id) + def get_latest_run_snapshot( + self, + run_id: str, + *, + operator_instance_id: str, + ) -> RunSnapshot | None: + """Return the latest structural run and detail watermarks atomically.""" + with self._lock: + if operator_instance_id != self._operator_instance_id: + raise StructuralBaselineUnavailableError( + "Operator instance changed; restart snapshot synchronization" + ) + run = self._runs.get(run_id) + if run is None: + return None + as_of_sequence = self._sequence + return self._run_snapshot_locked( + run, + summary=self._run_summary_locked(run), + as_of_sequence=as_of_sequence, + ) + def list_logs( self, run_id: str = "", @@ -505,9 +530,23 @@ def list_logs( page_token: str = "", after_sequence: int = 0, page_size: int = 0, + before_sequence: int = 0, + node_id: str = "", + order: int = _DESCRIPTOR_PAGE_ORDER_FORWARD, ) -> LogPage: """Return a byte-bounded page of immutable log body descriptors.""" size = _bounded_page_size(page_size) + order = _validated_descriptor_page_order(order) + after_sequence = _validated_descriptor_cursor( + after_sequence, "after_sequence" + ) + before_sequence = _validated_descriptor_cursor( + before_sequence, "before_sequence" + ) + if order == _DESCRIPTOR_PAGE_ORDER_FORWARD and before_sequence: + raise ValueError("before_sequence is only valid for newest-first pages") + if order == _DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST and after_sequence: + raise ValueError("after_sequence is only valid for forward pages") with self._lock: token = ( _decode_transport_token(page_token, "logs") @@ -517,20 +556,77 @@ def list_logs( self._validate_transport_token_locked(token) run_id = token["run_id"] through_sequence = token["through_sequence"] - cursor = token.get("cursor", after_sequence) + if "cursor" in token: + if token["order"] != order: + raise ValueError("Page order does not match the continuation token") + if token["node_id"] != node_id: + raise ValueError("Log node filter does not match the continuation token") + requested_cursor = ( + after_sequence + if order == _DESCRIPTOR_PAGE_ORDER_FORWARD + else before_sequence + ) + if requested_cursor and requested_cursor != token["cursor"]: + raise ValueError("Page cursor does not match the continuation token") + cursor = token["cursor"] + else: + cursor = ( + after_sequence + if order == _DESCRIPTOR_PAGE_ORDER_FORWARD + else before_sequence or through_sequence + 1 + ) logs = self._logs.get(run_id) if logs is None and run_id not in self._runs: raise KeyError(run_id) logs = logs or [] - start = min(cursor, len(logs)) - stop = min(start + size + 1, through_sequence, len(logs)) - candidates = logs[start:stop] - descriptors = [self._log_descriptor_locked(run_id, item) for item in candidates] + candidates: list[SequencedLogEntry] + if node_id: + run_node_sequences = self._log_sequences_by_node.get(run_id) + node_sequences = ( + () + if run_node_sequences is None + else run_node_sequences.get(node_id, ()) + ) + if order == _DESCRIPTOR_PAGE_ORDER_FORWARD: + start = bisect_right(node_sequences, cursor) + stop = bisect_right(node_sequences, through_sequence) + selected_sequences = node_sequences[ + start : min(start + size + 1, stop) + ] + else: + stop = bisect_right( + node_sequences, + min(cursor - 1, through_sequence), + ) + start = max(0, stop - size - 1) + selected_sequences = reversed(node_sequences[start:stop]) + candidates = [logs[sequence - 1] for sequence in selected_sequences] + elif order == _DESCRIPTOR_PAGE_ORDER_FORWARD: + start = min(cursor, len(logs)) + stop = min(start + size + 1, through_sequence, len(logs)) + candidates = logs[start:stop] + else: + start = min(cursor - 1, through_sequence, len(logs)) - 1 + stop = max(-1, start - size - 1) + candidates = [logs[index] for index in range(start, stop, -1)] + descriptors = [ + self._log_descriptor_locked( + run_id, + item, + as_of_sequence=token["as_of_sequence"], + ) + for item in candidates + ] selected = _take_bounded_descriptors(descriptors, size) next_page_token = "" - if selected and selected[-1].sequence < through_sequence: + if selected and len(selected) < len(descriptors): next_page_token = _encode_transport_token( - **{**token, "cursor": selected[-1].sequence} + **{ + **token, + "node_id": node_id, + "order": order, + "cursor": selected[-1].sequence, + } ) return LogPage( operator_instance_id=self._operator_instance_id, @@ -547,9 +643,26 @@ def list_agent_events( page_token: str = "", after_event_sequence: int = 0, page_size: int = 0, + before_event_sequence: int = 0, + order: int = _DESCRIPTOR_PAGE_ORDER_FORWARD, ) -> AgentEventPage: """Return a byte-bounded page of immutable event body descriptors.""" size = _bounded_page_size(page_size) + order = _validated_descriptor_page_order(order) + after_event_sequence = _validated_descriptor_cursor( + after_event_sequence, "after_event_sequence" + ) + before_event_sequence = _validated_descriptor_cursor( + before_event_sequence, "before_event_sequence" + ) + if order == _DESCRIPTOR_PAGE_ORDER_FORWARD and before_event_sequence: + raise ValueError( + "before_event_sequence is only valid for newest-first pages" + ) + if order == _DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST and after_event_sequence: + raise ValueError( + "after_event_sequence is only valid for forward pages" + ) with self._lock: token = ( _decode_transport_token(page_token, "events") @@ -560,30 +673,66 @@ def list_agent_events( run_id = token["run_id"] node_id = token["node_id"] through_sequence = token["through_sequence"] - cursor = token.get("cursor", after_event_sequence) + if "cursor" in token: + if token["order"] != order: + raise ValueError("Page order does not match the continuation token") + requested_cursor = ( + after_event_sequence + if order == _DESCRIPTOR_PAGE_ORDER_FORWARD + else before_event_sequence + ) + if requested_cursor and requested_cursor != token["cursor"]: + raise ValueError("Page cursor does not match the continuation token") + cursor = token["cursor"] + else: + cursor = ( + after_event_sequence + if order == _DESCRIPTOR_PAGE_ORDER_FORWARD + else before_event_sequence or through_sequence + 1 + ) run = self._runs.get(run_id) if run is None: raise KeyError(run_id) if node_id not in run.nodes: raise KeyError(node_id) events = self._agent_events.get((run_id, node_id), []) - start = bisect_right( - events, - cursor, - key=lambda item: item.event_sequence, - ) - stop = min(start + size + 1, len(events)) - candidates = events[start:stop] + if order == _DESCRIPTOR_PAGE_ORDER_FORWARD: + start = bisect_right( + events, + cursor, + key=lambda item: item.event_sequence, + ) + stop = min(start + size + 1, len(events)) + candidates = [ + item + for item in events[start:stop] + if item.event_sequence <= through_sequence + ] + else: + upper = bisect_right( + events, + min(cursor - 1, through_sequence), + key=lambda item: item.event_sequence, + ) + candidates = list(reversed(events[max(0, upper - size - 1) : upper])) descriptors = [ - self._agent_event_descriptor_locked(run_id, node_id, item) + self._agent_event_descriptor_locked( + run_id, + node_id, + item, + as_of_sequence=token["as_of_sequence"], + ) for item in candidates - if item.event_sequence <= through_sequence ] selected = _take_bounded_descriptors(descriptors, size) next_page_token = "" - if selected and selected[-1].event_sequence < through_sequence: + if selected and len(selected) < len(descriptors): next_page_token = _encode_transport_token( - **{**token, "cursor": selected[-1].event_sequence} + **{ + **token, + "order": order, + "cursor": selected[-1].event_sequence, + } ) return AgentEventPage( operator_instance_id=self._operator_instance_id, @@ -792,13 +941,15 @@ def _validate_transport_token_locked(self, token: Mapping[str, Any]) -> None: if run is None: raise KeyError(run_id) node_id = token.get("node_id") - if node_id is not None and node_id not in run.nodes: + if node_id and node_id not in run.nodes: raise KeyError(node_id) def _log_descriptor_locked( self, run_id: str, item: SequencedLogEntry, + *, + as_of_sequence: int, ) -> LogRecordDescriptor: return LogRecordDescriptor( sequence=item.sequence, @@ -809,7 +960,7 @@ def _log_descriptor_locked( body_token=_encode_transport_token( kind="log-body", operator_instance_id=self._operator_instance_id, - as_of_sequence=self._sequence, + as_of_sequence=as_of_sequence, run_id=run_id, sequence=item.sequence, ), @@ -820,6 +971,8 @@ def _agent_event_descriptor_locked( run_id: str, node_id: str, item: AgentEvent, + *, + as_of_sequence: int, ) -> AgentEventDescriptor: return AgentEventDescriptor( invocation_id=item.invocation_id, @@ -828,7 +981,7 @@ def _agent_event_descriptor_locked( body_token=_encode_transport_token( kind="event-body", operator_instance_id=self._operator_instance_id, - as_of_sequence=self._sequence, + as_of_sequence=as_of_sequence, run_id=run_id, node_id=node_id, sequence=item.event_sequence, @@ -1044,6 +1197,7 @@ def start_run( # Reserve the ID before releasing the lock so concurrent callers # cannot create a second coordinator with the same caller-owned ID. self._active_runs[run_id] = handle + self._log_sequences_by_node.pop(run_id, None) try: with self._lock: if self._closed: @@ -1085,6 +1239,7 @@ def start_run( _teardown_process_group(process, windows_job) with self._lock: self._runs.pop(run_id, None) + self._log_sequences_by_node.pop(run_id, None) self._stored_results.pop(run_id, None) self._active_runs.pop(run_id, None) self._result_store.discard(result_bundle) @@ -1949,13 +2104,16 @@ def _append_log_unchecked_locked( size_bytes: int, ) -> None: logs = self._logs.setdefault(run.run_id, []) + sequence = len(logs) + 1 logs.append( SequencedLogEntry( - sequence=len(logs) + 1, + sequence=sequence, entry=deepcopy(entry), size_bytes=size_bytes, ) ) + node_sequences = self._log_sequences_by_node.setdefault(run.run_id, {}) + node_sequences.setdefault(entry.node_id, []).append(sequence) self._run_log_bytes[run.run_id] = self._run_log_bytes.get(run.run_id, 0) + size_bytes self._run_detail_bytes[run.run_id] = ( self._run_detail_bytes.get(run.run_id, 0) + size_bytes @@ -2163,7 +2321,11 @@ def _publish_run_locked( changes.append( LogAppended( run_id=run.run_id, - log=self._log_descriptor_locked(run.run_id, log_item), + log=self._log_descriptor_locked( + run.run_id, + log_item, + as_of_sequence=publication_sequence, + ), ) ) for node_id, event in agent_events.items(): @@ -2175,6 +2337,7 @@ def _publish_run_locked( run.run_id, node_id, event, + as_of_sequence=publication_sequence, ), ) ) @@ -2353,6 +2516,21 @@ def _bounded_page_size(page_size: int) -> int: return min(page_size or DETAIL_PAGE_SIZE, MAX_DETAIL_PAGE_SIZE) +def _validated_descriptor_page_order(order: int) -> int: + if type(order) is not int or order not in { + _DESCRIPTOR_PAGE_ORDER_FORWARD, + _DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST, + }: + raise ValueError("Invalid descriptor page order") + return order + + +def _validated_descriptor_cursor(cursor: int, field_name: str) -> int: + if type(cursor) is not int or cursor < 0: + raise ValueError(f"{field_name} must be a non-negative integer") + return cursor + + def _encode_page_token( *, operator_instance_id: str, @@ -2429,13 +2607,30 @@ def _decode_transport_token( or type(value.get("run_id")) is not str ): raise ValueError("Invalid detail token") + if value["as_of_sequence"] < 0: + raise ValueError("Invalid detail token") if value["kind"] in {"logs", "events"}: - if type(value.get("through_sequence")) is not int: - raise ValueError("Invalid detail token") - if "cursor" in value and type(value["cursor"]) is not int: + if ( + type(value.get("through_sequence")) is not int + or value["through_sequence"] < 0 + ): raise ValueError("Invalid detail token") + if "cursor" in value: + if ( + type(value["cursor"]) is not int + or value["cursor"] < 0 + or type(value.get("order")) is not int + or value["order"] + not in { + _DESCRIPTOR_PAGE_ORDER_FORWARD, + _DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST, + } + ): + raise ValueError("Invalid detail token") + if value["kind"] == "logs" and type(value.get("node_id")) is not str: + raise ValueError("Invalid detail token") else: - if type(value.get("sequence")) is not int: + if type(value.get("sequence")) is not int or value["sequence"] < 1: raise ValueError("Invalid detail token") if value["kind"] in {"events", "event-body"} and type(value.get("node_id")) is not str: raise ValueError("Invalid detail token") diff --git a/src/runtime/operator/server.py b/src/runtime/operator/server.py index 52f652e..0a52228 100644 --- a/src/runtime/operator/server.py +++ b/src/runtime/operator/server.py @@ -133,6 +133,18 @@ def GetRunSnapshot(self, request, context): # noqa: N802 context.abort(grpc.StatusCode.NOT_FOUND, f"Run {request.run_id} not found") return run_snapshot_to_proto(snapshot) + def GetLatestRunSnapshot(self, request, context): # noqa: N802 + try: + snapshot = self._op.get_latest_run_snapshot( + request.run_id, + operator_instance_id=request.operator_instance_id, + ) + except StructuralBaselineUnavailableError as exc: + context.abort(grpc.StatusCode.FAILED_PRECONDITION, str(exc)) + if snapshot is None: + context.abort(grpc.StatusCode.NOT_FOUND, f"Run {request.run_id} not found") + return run_snapshot_to_proto(snapshot) + def ListLogs(self, request, context): # noqa: N802 if not request.page_token: context.abort( @@ -144,6 +156,9 @@ def ListLogs(self, request, context): # noqa: N802 page_token=request.page_token, after_sequence=request.after_sequence, page_size=request.page_size, + before_sequence=request.before_sequence, + node_id=request.node_id, + order=request.order, ) except StructuralBaselineUnavailableError as exc: context.abort(grpc.StatusCode.FAILED_PRECONDITION, str(exc)) @@ -169,6 +184,8 @@ def ListAgentEvents(self, request, context): # noqa: N802 page_token=request.page_token, after_event_sequence=request.after_event_sequence, page_size=request.page_size, + before_event_sequence=request.before_event_sequence, + order=request.order, ) except StructuralBaselineUnavailableError as exc: context.abort(grpc.StatusCode.FAILED_PRECONDITION, str(exc)) diff --git a/src/runtime/operator/web.py b/src/runtime/operator/web.py index bafa6cb..9263735 100644 --- a/src/runtime/operator/web.py +++ b/src/runtime/operator/web.py @@ -48,6 +48,10 @@ class _RpcMethod: "GetRunResult": _RpcMethod(pb.GetRunRequest, pb.RunResultMsg), "ListRunSummaries": _RpcMethod(pb.ListRunSummariesRequest, pb.RunSummaryPage), "GetRunSnapshot": _RpcMethod(pb.GetRunSnapshotRequest, pb.RunSnapshotMsg), + "GetLatestRunSnapshot": _RpcMethod( + pb.GetLatestRunSnapshotRequest, + pb.RunSnapshotMsg, + ), "ListLogs": _RpcMethod(pb.ListLogsRequest, pb.LogPage), "ListAgentEvents": _RpcMethod(pb.ListAgentEventsRequest, pb.AgentEventPage), "ReadTrace": _RpcMethod(pb.ReadTraceRequest, pb.TraceChunk, server_streaming=True), diff --git a/test/operator_tests/test_grpc.py b/test/operator_tests/test_grpc.py index e0562e1..f24b8d0 100644 --- a/test/operator_tests/test_grpc.py +++ b/test/operator_tests/test_grpc.py @@ -44,6 +44,7 @@ from runtime.operator._grpc import MAX_GRPC_MESSAGE_BYTES from runtime.operator.client import _DetailHydrationRaceError, _run_from_snapshot from runtime.operator.proto import operator_pb2 as pb +from runtime.operator.proto import operator_pb2_grpc as pb_grpc from runtime.operator.results import ( MAX_ATTACHMENT_MEDIA_TYPE_LENGTH, MAX_ATTACHMENT_NAME_LENGTH, @@ -118,6 +119,83 @@ def test_result_file_wire_preserves_empty_metadata_presence(): assert empty.media_type == "" +def test_latest_run_snapshot_client_returns_typed_snapshot_without_mutating_baseline(): + latest = RunSnapshot( + operator_instance_id="operator-1", + as_of_sequence=8, + summary=RunSummary( + run_id="run-selected", + flow_name="flow", + workflow_id="flow", + workflow_display_name="flow", + status=RunStatus.RUNNING, + created_sequence=2, + revision=8, + ), + ) + + class LatestSnapshotStub: + def __init__(self): + self.request = None + + def GetLatestRunSnapshot(self, request, **kwargs): # noqa: N802 + self.request = request + return run_snapshot_to_proto(latest) + + provider = GrpcStateProvider("localhost:1") + stub = LatestSnapshotStub() + provider._stub = stub + retained = RunState( + run_id="run-retained", + flow_name="flow", + operator_instance_id="operator-1", + ) + provider._install_structural_baseline("operator-1", 4, {retained.run_id: retained}) + try: + snapshot = provider.get_latest_run_snapshot("run-selected", "operator-1") + finally: + provider.close() + + assert isinstance(snapshot, RunSnapshot) + assert snapshot == latest + assert stub.request.run_id == "run-selected" + assert stub.request.operator_instance_id == "operator-1" + assert provider._cursor.operator_instance_id == "operator-1" + assert provider._cursor.sequence == 4 + assert set(provider._runs_by_id) == {"run-retained"} + + +def test_latest_run_snapshot_client_preserves_operator_epoch_failure(): + class EpochFailure(grpc.RpcError): + def code(self): + return grpc.StatusCode.FAILED_PRECONDITION + + def details(self): + return "operator instance changed" + + class RestartedStub: + def __init__(self): + self.request = None + + def GetLatestRunSnapshot(self, request, **kwargs): # noqa: N802 + self.request = request + raise EpochFailure() + + provider = GrpcStateProvider("localhost:1") + stub = RestartedStub() + provider._stub = stub + try: + with pytest.raises(OperatorCallError) as error: + provider.get_latest_run_snapshot("run-selected", "operator-old") + finally: + provider.close() + + assert error.value.status is grpc.StatusCode.FAILED_PRECONDITION + assert error.value.details == "operator instance changed" + assert stub.request.run_id == "run-selected" + assert stub.request.operator_instance_id == "operator-old" + + def test_grpc_envelope_includes_bounded_worst_case_metadata_headroom(): worst_case_metadata_bytes = MAX_RESULT_ATTACHMENTS * ( 4 * MAX_ATTACHMENT_NAME_LENGTH + 4 * MAX_ATTACHMENT_MEDIA_TYPE_LENGTH + 256 @@ -819,6 +897,9 @@ def GetRunSnapshot(self, request, **kwargs): # noqa: N802 ) def ListLogs(self, request, **kwargs): # noqa: N802 + assert request.before_sequence == 0 + assert request.node_id == "" + assert request.order == pb.DESCRIPTOR_PAGE_ORDER_FORWARD sequence = request.after_sequence + 1 return pb.LogPage( operator_instance_id="operator-1", @@ -837,6 +918,8 @@ def ListLogs(self, request, **kwargs): # noqa: N802 ) def ListAgentEvents(self, request, **kwargs): # noqa: N802 + assert request.before_event_sequence == 0 + assert request.order == pb.DESCRIPTOR_PAGE_ORDER_FORWARD sequence = request.after_event_sequence + 1 return pb.AgentEventPage( operator_instance_id="operator-1", @@ -2162,6 +2245,18 @@ def GetRunSnapshot(self, request, *, timeout, **kwargs): # noqa: N802 ), ) + def GetLatestRunSnapshot(self, request, *, timeout, **kwargs): # noqa: N802 + self._capture("latest", timeout) + return pb.RunSnapshotMsg( + operator_instance_id=request.operator_instance_id, + as_of_sequence=2, + summary=pb.RunSummaryMsg( + run_id=request.run_id, + flow_name="flow", + status="running", + ), + ) + def ListRunSummaries(self, request, *, timeout, **kwargs): # noqa: N802 self._capture("cursor" if request.page_size == 1 else "runs", timeout) return pb.RunSummaryPage( @@ -2179,6 +2274,7 @@ def CancelRun(self, request, *, timeout, **kwargs): # noqa: N802 provider.list_workflows() provider.start_run("flow") provider.get_run("run_1") + provider.get_latest_run_snapshot("run_1", "operator-1") provider.list_runs("flow") provider.cancel_run("run_1") finally: @@ -2189,6 +2285,7 @@ def CancelRun(self, request, *, timeout, **kwargs): # noqa: N802 ("start", 3.5), ("cursor", 3.5), ("get", 3.5), + ("latest", 3.5), ("runs", 3.5), ("cancel", 3.5), ] @@ -2468,6 +2565,152 @@ def _seed_hydration_run(operator, run_id: str) -> RunState: return run +def test_grpc_latest_snapshot_and_newest_pages_preserve_status_contract(): + operator = Operator([], watch=False, schedule=False) + server = None + channel = None + try: + run = _seed_hydration_run(operator, "run-latest-page") + baseline = operator.list_run_summaries(page_size=10) + retained = operator.get_run_snapshot( + run.run_id, + operator_instance_id=baseline.operator_instance_id, + as_of_sequence=baseline.as_of_sequence, + ) + assert retained is not None + operator._apply_event( + run.run_id, + _event_handle(), + {"type": "running", "timestamp": 1.0}, + ) + + port = _unused_port() + server = serve(operator, port=port, block=False) + channel = grpc.insecure_channel(f"localhost:{port}") + grpc.channel_ready_future(channel).result(timeout=5) + stub = pb_grpc.OperatorServiceStub(channel) + + latest = stub.GetLatestRunSnapshot( + pb.GetLatestRunSnapshotRequest( + run_id=run.run_id, + operator_instance_id=operator.operator_instance_id, + ) + ) + exact = stub.GetRunSnapshot( + pb.GetRunSnapshotRequest( + run_id=run.run_id, + operator_instance_id=baseline.operator_instance_id, + as_of_sequence=baseline.as_of_sequence, + ) + ) + assert latest.as_of_sequence > exact.as_of_sequence + assert latest.summary.status == RunStatus.RUNNING.value + assert exact.summary.status == retained.summary.status.value + + class CountingLogs(list): + def __init__(self, entries): + super().__init__(entries) + self.item_reads = 0 + + def __getitem__(self, index): + if isinstance(index, int): + self.item_reads += 1 + return super().__getitem__(index) + + with operator._lock: + counted_logs = CountingLogs(operator._logs[run.run_id]) + operator._logs[run.run_id] = counted_logs + + first_logs = stub.ListLogs( + pb.ListLogsRequest( + page_token=latest.log_page_token, + page_size=2, + node_id="agent-1", + order=pb.DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST, + ) + ) + assert [item.sequence for item in first_logs.logs] == sorted( + (item.sequence for item in first_logs.logs), + reverse=True, + ) + assert first_logs.next_page_token + second_logs = stub.ListLogs( + pb.ListLogsRequest( + page_token=first_logs.next_page_token, + page_size=2, + before_sequence=first_logs.logs[-1].sequence, + node_id="agent-1", + order=pb.DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST, + ) + ) + assert { + item.sequence for item in first_logs.logs + }.isdisjoint(item.sequence for item in second_logs.logs) + reads_before_missing_page = counted_logs.item_reads + missing_logs = stub.ListLogs( + pb.ListLogsRequest( + page_token=latest.log_page_token, + page_size=2, + node_id="missing-agent", + order=pb.DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST, + ) + ) + assert list(missing_logs.logs) == [] + assert counted_logs.item_reads == reads_before_missing_page + + first_events = stub.ListAgentEvents( + pb.ListAgentEventsRequest( + page_token=latest.nodes[0].event_page_token, + page_size=2, + order=pb.DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST, + ) + ) + assert [item.event_sequence for item in first_events.events] == sorted( + (item.event_sequence for item in first_events.events), + reverse=True, + ) + + with pytest.raises(grpc.RpcError) as cursor_error: + stub.ListLogs( + pb.ListLogsRequest( + page_token=first_logs.next_page_token, + page_size=2, + before_sequence=first_logs.logs[-1].sequence - 1, + node_id="agent-1", + order=pb.DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST, + ) + ) + assert cursor_error.value.code() is grpc.StatusCode.INVALID_ARGUMENT + + with pytest.raises(grpc.RpcError) as stale_error: + stub.GetLatestRunSnapshot( + pb.GetLatestRunSnapshotRequest( + run_id=run.run_id, + operator_instance_id="stale-operator", + ) + ) + assert stale_error.value.code() is grpc.StatusCode.FAILED_PRECONDITION + + with pytest.raises(grpc.RpcError) as missing_error: + stub.GetLatestRunSnapshot( + pb.GetLatestRunSnapshotRequest( + run_id="missing-run", + operator_instance_id=operator.operator_instance_id, + ) + ) + assert missing_error.value.code() is grpc.StatusCode.NOT_FOUND + + with pytest.raises(grpc.RpcError) as token_error: + stub.ListLogs(pb.ListLogsRequest(page_token="not-a-token")) + assert token_error.value.code() is grpc.StatusCode.INVALID_ARGUMENT + finally: + if channel is not None: + channel.close() + if server is not None: + server.stop(grace=0).wait() + operator.close() + + def test_grpc_lazily_hydrates_paged_details_and_chunked_trace( monkeypatch, ): @@ -2496,10 +2739,15 @@ def __getattr__(self, name): return getattr(delegate, name) def ListLogs(self, request, **kwargs): # noqa: N802 + assert request.before_sequence == 0 + assert request.node_id == "" + assert request.order == pb.DESCRIPTOR_PAGE_ORDER_FORWARD self.log_cursors.append(request.after_sequence) return delegate.ListLogs(request, **kwargs) def ListAgentEvents(self, request, **kwargs): # noqa: N802 + assert request.before_event_sequence == 0 + assert request.order == pb.DESCRIPTOR_PAGE_ORDER_FORWARD self.event_cursors.append(request.after_event_sequence) return delegate.ListAgentEvents(request, **kwargs) diff --git a/test/operator_tests/test_state_detail.py b/test/operator_tests/test_state_detail.py index aef1f7c..e5d81e2 100644 --- a/test/operator_tests/test_state_detail.py +++ b/test/operator_tests/test_state_detail.py @@ -11,7 +11,7 @@ import pytest from avalanche.operator import Operator -from avalanche.operator.client import GrpcStateProvider, StreamState +from avalanche.operator.client import GrpcStateProvider, OperatorCallError, StreamState from avalanche.operator.convert import operator_update_envelope_to_proto from avalanche.operator.models import ( AgentEvent, @@ -27,6 +27,7 @@ SequencedLogEntry, ) from avalanche.operator.server import TRACE_CHUNK_BYTES, serve +from runtime.operator.operator import _decode_transport_token, _encode_transport_token from runtime.operator.proto import operator_pb2 as pb from runtime.operator.proto import operator_pb2_grpc as pb_grpc from runtime.operator.scheduler import Scheduler @@ -199,6 +200,50 @@ def test_structural_snapshot_excludes_detail_bodies_while_explicit_read_material operator.close() +def test_latest_run_snapshot_client_is_typed_and_rejects_a_stale_operator_epoch(): + stale_operator = Operator(watch=False, schedule=False) + stale_operator_instance_id = stale_operator.operator_instance_id + stale_operator.close() + operator = Operator(watch=False, schedule=False) + server = None + provider = None + try: + run = _add_run(operator, "run-latest") + port = _unused_port() + server = serve(operator, port=port, block=False) + provider = GrpcStateProvider(f"localhost:{port}") + + initial = provider.get_latest_run_snapshot( + run.run_id, + operator.operator_instance_id, + ) + operator._apply_event( + run.run_id, + _event_handle(), + {"type": "running", "timestamp": 1.0}, + ) + latest = provider.get_latest_run_snapshot( + run.run_id, + operator.operator_instance_id, + ) + + assert initial.summary.run_id == run.run_id + assert initial.summary.status is RunStatus.PENDING + assert latest.operator_instance_id == operator.operator_instance_id + assert latest.as_of_sequence > initial.as_of_sequence + assert latest.summary.status is RunStatus.RUNNING + + with pytest.raises(OperatorCallError) as error: + provider.get_latest_run_snapshot(run.run_id, stale_operator_instance_id) + assert error.value.status is grpc.StatusCode.FAILED_PRECONDITION + finally: + if provider is not None: + provider.close() + if server is not None: + server.stop(grace=0).wait() + operator.close() + + def test_log_and_agent_event_pagination_use_exclusive_deduplicating_cursors(): operator = Operator(watch=False, schedule=False) try: @@ -242,6 +287,301 @@ def test_log_and_agent_event_pagination_use_exclusive_deduplicating_cursors(): operator.close() +def test_exact_node_log_pages_use_the_append_only_node_index(): + class CountingLogs(list): + def __init__(self, entries): + super().__init__(entries) + self.item_reads = 0 + + def __getitem__(self, index): + if isinstance(index, int): + self.item_reads += 1 + return super().__getitem__(index) + + operator = Operator(watch=False, schedule=False) + try: + run = _add_run(operator, "run-sparse-logs") + timestamp = datetime.now() + target_entry = LogEntry( + timestamp=timestamp, + level=LogLevel.INFO, + node_id="agent_1", + message="", + ) + other_entry = LogEntry( + timestamp=timestamp, + level=LogLevel.INFO, + node_id="other", + message="", + ) + with operator._lock: + for sequence in range(1, 100_001): + entry = ( + target_entry + if sequence == 50_000 or sequence == 100_000 + else other_entry + ) + operator._append_log_unchecked_locked(run, entry, 0) + counted_logs = CountingLogs(operator._logs[run.run_id]) + operator._logs[run.run_id] = counted_logs + + missing = operator.list_logs( + run.run_id, + page_size=1, + node_id="missing", + ) + assert missing.logs == () + assert counted_logs.item_reads <= 1 + + first = operator.list_logs( + run.run_id, + page_size=1, + node_id="agent_1", + ) + second = operator.list_logs( + page_token=first.next_page_token, + after_sequence=first.logs[-1].sequence, + page_size=1, + node_id="agent_1", + ) + newest = operator.list_logs( + run.run_id, + page_size=2, + node_id="agent_1", + order=pb.DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST, + ) + + assert [item.sequence for item in first.logs] == [50_000] + assert [item.sequence for item in second.logs] == [100_000] + assert [item.sequence for item in newest.logs] == [100_000, 50_000] + assert counted_logs.item_reads <= 8 + finally: + operator.close() + + +def test_failed_run_publication_discards_its_log_sequence_index(): + class FailingPublicationOperator(Operator): + def _publish_run_locked(self, run, *args, **kwargs): + self._log_sequences_by_node[run.run_id] = {"agent_1": [1]} + raise RuntimeError("publication failed") + + fixture = Path(__file__).parents[1] / "fixtures" / "sample_workflows.py" + operator = FailingPublicationOperator( + workflow_paths=[str(fixture)], + watch=False, + schedule=False, + ) + try: + with pytest.raises(RuntimeError, match="publication failed"): + operator.start_run("simple_workflow", run_id="run-failed-publication") + + assert "run-failed-publication" not in operator._log_sequences_by_node + finally: + operator.close() + + +def test_newest_first_pages_reconstruct_filtered_snapshot_without_duplicates(): + operator = Operator(watch=False, schedule=False) + try: + run = _add_run(operator, "run-newest") + with operator._lock: + run.nodes["agent_2"] = NodeState( + node_id="agent_2", + name="Other", + node_type="step", + ) + for sequence in range(1, 6): + operator._apply_event( + run.run_id, + _event_handle(), + { + "type": "log", + "timestamp": float(sequence), + "level": logging.INFO, + "node_id": "agent_1" if sequence % 2 else "agent_2", + "message": f"log-{sequence}", + }, + ) + operator._apply_event( + run.run_id, + _event_handle(), + _evidence(sequence), + ) + + snapshot = operator.get_latest_run_snapshot( + run.run_id, + operator_instance_id=operator.operator_instance_id, + ) + assert snapshot is not None + operator._apply_event( + run.run_id, + _event_handle(), + { + "type": "log", + "timestamp": 100.0, + "level": logging.INFO, + "node_id": "agent_1", + "message": "after-snapshot", + }, + ) + operator._apply_event(run.run_id, _event_handle(), _evidence(6)) + + forward_logs = operator.list_logs( + page_token=snapshot.log_page_token, + page_size=100, + node_id="agent_1", + ) + newest_log_sequences = [] + newest_log_descriptors = [] + token = snapshot.log_page_token + before_sequence = 0 + while token: + page = operator.list_logs( + page_token=token, + page_size=2, + before_sequence=before_sequence, + node_id="agent_1", + order=pb.DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST, + ) + newest_log_sequences.extend(item.sequence for item in page.logs) + newest_log_descriptors.extend(page.logs) + before_sequence = page.logs[-1].sequence if page.logs else 0 + token = page.next_page_token + + forward_events = operator.list_agent_events( + page_token=snapshot.nodes[0].event_page_token, + page_size=100, + ) + newest_event_sequences = [] + token = snapshot.nodes[0].event_page_token + before_event_sequence = 0 + while token: + page = operator.list_agent_events( + page_token=token, + page_size=2, + before_event_sequence=before_event_sequence, + order=pb.DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST, + ) + newest_event_sequences.extend( + item.event_sequence for item in page.events + ) + before_event_sequence = ( + page.events[-1].event_sequence if page.events else 0 + ) + token = page.next_page_token + + forward_log_sequences = [item.sequence for item in forward_logs.logs] + forward_event_sequences = [ + item.event_sequence for item in forward_events.events + ] + assert newest_log_sequences[::-1] == forward_log_sequences + assert newest_event_sequences[::-1] == forward_event_sequences + assert len(newest_log_sequences) == len(set(newest_log_sequences)) + assert len(newest_event_sequences) == len(set(newest_event_sequences)) + assert {item.node_id for item in newest_log_descriptors} == {"agent_1"} + assert all( + sequence <= snapshot.latest_log_sequence + for sequence in newest_log_sequences + ) + bodies = [] + for descriptor in newest_log_descriptors: + body_token = _decode_transport_token( + descriptor.body_token, + "log-body", + ) + assert body_token["as_of_sequence"] == snapshot.as_of_sequence + bodies.append(operator.read_detail(descriptor.body_token)) + assert b"after-snapshot" not in bodies + finally: + operator.close() + + +def test_detail_continuations_reject_cursor_filter_and_direction_changes(): + operator = Operator(watch=False, schedule=False) + try: + run = _add_run(operator, "run-cursors") + for sequence in range(1, 4): + operator._apply_event( + run.run_id, + _event_handle(), + { + "type": "log", + "timestamp": float(sequence), + "level": logging.INFO, + "node_id": "agent_1", + "message": f"log-{sequence}", + }, + ) + operator._apply_event(run.run_id, _event_handle(), _evidence(sequence)) + snapshot = operator.get_latest_run_snapshot( + run.run_id, + operator_instance_id=operator.operator_instance_id, + ) + assert snapshot is not None + + first_log_page = operator.list_logs( + page_token=snapshot.log_page_token, + page_size=1, + node_id="agent_1", + ) + assert first_log_page.next_page_token + with pytest.raises(ValueError, match="cursor"): + operator.list_logs( + page_token=first_log_page.next_page_token, + after_sequence=first_log_page.logs[-1].sequence + 1, + page_size=1, + node_id="agent_1", + ) + with pytest.raises(ValueError, match="filter"): + operator.list_logs( + page_token=first_log_page.next_page_token, + after_sequence=first_log_page.logs[-1].sequence, + page_size=1, + node_id="agent_2", + ) + + newest_log_page = operator.list_logs( + page_token=snapshot.log_page_token, + page_size=1, + node_id="agent_1", + order=pb.DESCRIPTOR_PAGE_ORDER_NEWEST_FIRST, + ) + assert newest_log_page.next_page_token + with pytest.raises(ValueError, match="order"): + operator.list_logs( + page_token=newest_log_page.next_page_token, + page_size=1, + node_id="agent_1", + ) + + first_event_page = operator.list_agent_events( + page_token=snapshot.nodes[0].event_page_token, + page_size=1, + ) + assert first_event_page.next_page_token + with pytest.raises(ValueError, match="cursor"): + operator.list_agent_events( + page_token=first_event_page.next_page_token, + after_event_sequence=first_event_page.events[-1].event_sequence + 1, + page_size=1, + ) + + decoded = _decode_transport_token( + first_event_page.next_page_token, + "events", + ) + decoded["future_token_field"] = {"version": 2} + compatible_token = _encode_transport_token(**decoded) + compatible_page = operator.list_agent_events( + page_token=compatible_token, + after_event_sequence=first_event_page.events[-1].event_sequence, + page_size=1, + ) + assert compatible_page.events + finally: + operator.close() + + def test_detail_pagination_requires_snapshot_issued_page_tokens(): operator = Operator(watch=False, schedule=False) server = None @@ -482,14 +822,18 @@ def apply_event() -> None: apply_errors.append(exc) def read_detail() -> None: - page = operator.list_run_summaries() - observed["snapshot"] = operator.get_run_snapshot( + snapshot = operator.get_latest_run_snapshot( run.run_id, - operator_instance_id=page.operator_instance_id, - as_of_sequence=page.as_of_sequence, + operator_instance_id=operator.operator_instance_id, + ) + observed["snapshot"] = snapshot + assert snapshot is not None + observed["logs"] = operator.list_logs( + page_token=snapshot.log_page_token, + ) + observed["events"] = operator.list_agent_events( + page_token=snapshot.nodes[0].event_page_token, ) - observed["logs"] = operator.list_logs(run.run_id) - observed["events"] = operator.list_agent_events(run.run_id, "agent_1") reader_done.set() publisher = threading.Thread(target=apply_event) diff --git a/web/operator/src/App.test.tsx b/web/operator/src/App.test.tsx index 86d0d1e..eb6e5e9 100644 --- a/web/operator/src/App.test.tsx +++ b/web/operator/src/App.test.tsx @@ -1,55 +1,139 @@ import { fireEvent, render, screen } from "@testing-library/react"; -import { describe, expect, it, vi } from "vitest"; +import { beforeEach, describe, expect, it, vi } from "vitest"; -vi.mock("./GraphCanvas", () => ({ - GraphCanvas: () =>
Workflow graph
, +vi.mock("@tanstack/react-virtual", () => ({ + useVirtualizer: ({ count }: { count: number }) => ({ + getTotalSize: () => count * 44, + getVirtualItems: () => + Array.from({ length: Math.min(count, 120) }, (_, index) => ({ + index, + size: 44, + start: index * 44, + })), + }), })); -vi.mock("./state", () => ({ - useOperatorProjection: () => ({ - state: { - catalog: { - operatorInstanceId: "operator-1", - asOfSequence: "1", - revision: "1", - workflows: [ - { - workflowId: "flow.py::demo", - displayName: "demo", - rootAlias: "examples", - relativeFile: "flow.py", - nodeIds: [], - graph: {}, - nodeTypes: {}, - displayNames: {}, - agentNodeIds: [], - agentMetadataJson: {}, - }, - ], - scanTargets: [ - { - alias: "examples", - targetPath: "/workspace/examples", - kind: "directory", - }, - ], - diagnostics: [], - }, - runs: {}, - liveEvents: {}, - liveLogs: {}, + +const projectionHarness = vi.hoisted(() => ({ + state: { + catalog: { operatorInstanceId: "operator-1", - sequence: "1", - connection: "live", + asOfSequence: "1", + revision: "1", + workflows: [ + { + workflowId: "flow.py::demo", + displayName: "demo", + rootAlias: "examples", + relativeFile: "flow.py", + nodeIds: ["node-1"], + graph: { "node-1": { children: [] } }, + nodeTypes: { "node-1": "task" }, + displayNames: { "node-1": "Current node" }, + agentNodeIds: [], + agentMetadataJson: {}, + }, + ], + scanTargets: [ + { + alias: "examples", + targetPath: "/workspace/examples", + kind: "directory", + }, + ], + diagnostics: [], }, - startRun: vi.fn(async () => "run-1"), - cancelRun: vi.fn(async () => undefined), - }), + runs: {} as Record, + selectedRun: undefined as unknown, + selectedRunId: undefined as string | undefined, + selectedRunStatus: "idle", + selectedRunError: undefined as string | undefined, + liveEvents: {}, + liveLogs: {}, + liveEventRepairWatermarks: {}, + liveLogRepairWatermarks: {}, + operatorInstanceId: "operator-1", + sequence: "1", + connection: "live", + }, + selectRun: vi.fn(async (_runId?: string) => undefined), + startRun: vi.fn(async () => "run-1"), + cancelRun: vi.fn(async () => undefined), +})); + +vi.mock("./GraphCanvas", () => ({ + GraphCanvas: ({ + runTopology, + onOpenNode, + }: { + runTopology?: { displayNames: Record }; + onOpenNode: (nodeId: string) => void; + }) => ( + + ), +})); +vi.mock("./Inspector", () => ({ + Inspector: ({ + run, + liveLogs, + }: { + run?: { summary?: { runId: string } }; + liveLogs?: { sequence: string }[]; + }) => ( +
+ {`Inspector ${run?.summary?.runId ?? "workflow"}`} + {`Live logs ${liveLogs?.map((log) => log.sequence).join(",") ?? "none"}`} +
+ ), +})); +vi.mock("./state", () => ({ + useOperatorProjection: () => projectionHarness, })); import { App } from "./App"; import { GrpcWebOperatorApi } from "./api"; +import { RunSnapshotMsg, RunSummaryMsg, WorkflowTopologyMsg } from "./generated/operator"; + +const summary = RunSummaryMsg.create({ + runId: "run-1", + workflowId: "flow.py::demo", + workflowDisplayName: "demo", + status: "running", + startedAt: 1, + createdSequence: "2", +}); + +function selectedSnapshot(runId: string, nodeName: string) { + return RunSnapshotMsg.create({ + operatorInstanceId: "operator-1", + asOfSequence: "2", + summary: RunSummaryMsg.create({ ...summary, runId }), + topology: WorkflowTopologyMsg.create({ + nodeIds: ["node-1"], + graph: { "node-1": { children: [] } }, + nodeTypes: { "node-1": "task" }, + displayNames: { "node-1": nodeName }, + }), + }); +} describe("App", () => { + beforeEach(() => { + projectionHarness.state.runs = {}; + projectionHarness.state.selectedRun = undefined; + projectionHarness.state.selectedRunId = undefined; + projectionHarness.state.selectedRunStatus = "idle"; + projectionHarness.state.selectedRunError = undefined; + projectionHarness.state.liveEvents = {}; + projectionHarness.state.liveLogs = {}; + projectionHarness.state.liveEventRepairWatermarks = {}; + projectionHarness.state.liveLogRepairWatermarks = {}; + projectionHarness.selectRun.mockClear(); + projectionHarness.startRun.mockClear(); + projectionHarness.cancelRun.mockClear(); + }); + it("keeps Explorer available through the compact navigation toggle", () => { const { container } = render( , @@ -67,5 +151,78 @@ describe("App", () => { expect(toggle).toHaveAttribute("aria-expanded", "true"); expect(container.querySelector(".app-shell")).toHaveClass("explorer-open"); + + fireEvent.click(screen.getByRole("button", { name: "Run" })); + expect(projectionHarness.startRun).toHaveBeenCalledWith("flow.py::demo", undefined); }); + + it("navigates summary-only runs with one demand-load selection and clears it", async () => { + projectionHarness.state.runs = { "run-1": summary }; + const view = render(); + + fireEvent.click(await screen.findByRole("button", { name: /run-1Created at sequence 2/ })); + + expect(projectionHarness.selectRun).toHaveBeenCalledTimes(1); + expect(projectionHarness.selectRun).toHaveBeenCalledWith("run-1"); + expect(screen.getByRole("heading", { name: "No run snapshot" })).toBeInTheDocument(); + + fireEvent.click(screen.getByRole("button", { name: /demoflow.py/ })); + expect(projectionHarness.selectRun).toHaveBeenLastCalledWith(undefined); + + fireEvent.click(screen.getByRole("button", { name: /run-1Created at sequence 2/ })); + view.unmount(); + expect(projectionHarness.selectRun).toHaveBeenLastCalledWith(undefined); + }); + + it("shows selected-run loading and error states without rendering stale snapshots", async () => { + projectionHarness.state.runs = { "run-1": summary }; + const view = render(); + fireEvent.click(await screen.findByRole("button", { name: /run-1Created at sequence 2/ })); + + projectionHarness.state.selectedRunId = "run-1"; + projectionHarness.state.selectedRunStatus = "loading"; + view.rerender(); + expect(screen.getByRole("heading", { name: "Loading run snapshot" })).toBeInTheDocument(); + + projectionHarness.state.selectedRunStatus = "error"; + projectionHarness.state.selectedRunError = "snapshot was evicted"; + view.rerender(); + expect(screen.getByRole("alert")).toHaveTextContent("snapshot was evicted"); + + projectionHarness.state.selectedRunStatus = "ready"; + projectionHarness.state.selectedRun = selectedSnapshot("run-2", "Stale node"); + view.rerender(); + expect(screen.queryByText(/Run graph/)).not.toBeInTheDocument(); + + projectionHarness.state.selectedRun = selectedSnapshot("run-1", "Recorded node"); + view.rerender(); + fireEvent.click(screen.getByRole("button", { name: "Run graph Recorded node" })); + expect(screen.getByText("Inspector run-1")).toBeInTheDocument(); + fireEvent.click(screen.getByRole("button", { name: "Cancel run" })); + expect(projectionHarness.cancelRun).toHaveBeenCalledWith("run-1"); + + projectionHarness.state.selectedRunId = "run-2"; + projectionHarness.state.selectedRun = selectedSnapshot("run-2", "New stale node"); + view.rerender(); + expect(screen.queryByText(/Run graph/)).not.toBeInTheDocument(); + expect(screen.queryByText(/Inspector/)).not.toBeInTheDocument(); + }); + it("passes the selected run and node live-log tail to the inspector", async () => { + projectionHarness.state.runs = { "run-1": summary }; + projectionHarness.state.liveLogs = { + "run-1": [{ sequence: "wrong-bucket" }], + "run-1:node-1": [{ sequence: "17" }, { sequence: "18" }], + }; + const view = render(); + fireEvent.click(await screen.findByRole("button", { name: /run-1Created at sequence 2/ })); + + projectionHarness.state.selectedRunId = "run-1"; + projectionHarness.state.selectedRunStatus = "ready"; + projectionHarness.state.selectedRun = selectedSnapshot("run-1", "Recorded node"); + view.rerender(); + fireEvent.click(screen.getByRole("button", { name: "Run graph Recorded node" })); + + expect(screen.getByText("Live logs 17,18")).toBeInTheDocument(); + }); + }); diff --git a/web/operator/src/App.tsx b/web/operator/src/App.tsx index 8f08659..9a9a2ca 100644 --- a/web/operator/src/App.tsx +++ b/web/operator/src/App.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useMemo, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; import type { OperatorApi } from "./api"; import { Explorer, type Selection } from "./Explorer"; @@ -8,7 +8,7 @@ import { RunControls } from "./RunControls"; import { useOperatorProjection } from "./state"; export function App({ api }: { api: OperatorApi }) { - const { state, startRun, cancelRun } = useOperatorProjection(api); + const { state, startRun, cancelRun, selectRun } = useOperatorProjection(api); const [selection, setSelection] = useState(); const [inspectedNode, setInspectedNode] = useState(); const [explorerOpen, setExplorerOpen] = useState(false); @@ -16,7 +16,11 @@ export function App({ api }: { api: OperatorApi }) { useEffect(() => { const workflows = state.catalog?.workflows ?? []; if (!workflows.length) { - setSelection(undefined); + if (selection) { + setSelection(undefined); + setInspectedNode(undefined); + void selectRun(undefined); + } return; } if (!selection) { @@ -25,32 +29,44 @@ export function App({ api }: { api: OperatorApi }) { } if (!workflows.some((workflow) => workflow.workflowId === selection.workflowId)) { setSelection({ kind: "workflow", workflowId: workflows[0].workflowId }); + setInspectedNode(undefined); + void selectRun(undefined); } - }, [selection, state.catalog]); + }, [selectRun, selection, state.catalog]); + + useEffect( + () => () => { + void selectRun(undefined); + }, + [selectRun], + ); const workflow = state.catalog?.workflows.find( (item) => item.workflowId === selection?.workflowId, ); - const run = selection?.kind === "run" ? state.runs[selection.runId] : undefined; - const latestRun = useMemo( - () => - Object.values(state.runs) - .filter((item) => item.summary?.workflowId === workflow?.workflowId) - .sort( - (left, right) => - Number(right.summary!.createdSequence) - Number(left.summary!.createdSequence), - )[0], - [state.runs, workflow?.workflowId], - ); + const historical = selection?.kind === "run"; + const runSummary = historical ? state.runs[selection.runId] : undefined; + const run = + historical && + state.selectedRunId === selection.runId && + state.selectedRunStatus === "ready" && + state.selectedRun?.summary?.runId === selection.runId + ? state.selectedRun + : undefined; const openNode = useCallback((nodeId: string) => setInspectedNode(nodeId), []); - const select = useCallback((next: Selection) => { - setSelection(next); - setInspectedNode(undefined); - setExplorerOpen(false); - }, []); + const closeNode = useCallback(() => setInspectedNode(undefined), []); + const select = useCallback( + (next: Selection) => { + setSelection(next); + setInspectedNode(undefined); + setExplorerOpen(false); + void selectRun(next.kind === "run" ? next.runId : undefined); + }, + [selectRun], + ); - const selectedRun = run ?? (selection?.kind === "workflow" ? latestRun : undefined); - const liveEventKey = run && inspectedNode ? `${run.summary?.runId}:${inspectedNode}` : ""; + const liveDescriptorKey = + historical && inspectedNode ? `${selection.runId}:${inspectedNode}` : ""; return (
@@ -67,7 +83,7 @@ export function App({ api }: { api: OperatorApi }) {
{workflow?.rootAlias || "Local operator"} {workflow && <>/{workflow.displayName}} - {run?.summary && <>/{run.summary.runId}} + {historical && <>/{selection.runId}}
@@ -85,7 +101,7 @@ export function App({ api }: { api: OperatorApi }) { {state.error &&
{state.error}
} -
+
- {run ? "Historical run" : "Current definition"} + {historical ? "Historical run" : "Current definition"} -

{run?.summary?.runId || workflow?.displayName || "Operator"}

+

{historical ? selection.runId : workflow?.displayName || "Operator"}

- {run - ? `Recorded topology · ${run.summary?.status ?? "unknown"}` + {historical + ? `Recorded topology · ${runSummary?.status ?? "unknown"}` : workflow ? `${workflow.nodeIds.length} nodes · ${workflow.relativeFile}` : "Waiting for a workflow catalog"}

-
- {workflow || run?.topology ? ( - +
+ {historical ? ( + run ? ( + <> + +
+ Immutable run snapshot + Current workflow changes do not alter this canvas +
+ + ) : state.selectedRunId === selection.runId && + state.selectedRunStatus === "loading" ? ( +
+ +

Loading run snapshot

+

Retrieving the retained topology and execution state.

+
+ ) : state.selectedRunId === selection.runId && + state.selectedRunStatus === "error" ? ( +
+ ! +

Run snapshot unavailable

+

{state.selectedRunError || "The selected run could not be loaded."}

+
+ ) : ( +
+ +

No run snapshot

+

Select the run again to load its retained topology.

+
+ ) + ) : workflow ? ( + ) : (
@@ -130,23 +175,17 @@ export function App({ api }: { api: OperatorApi }) {

Catalog changes will appear here as the operator scans configured targets.

)} - {run && ( -
- Immutable run snapshot - Current workflow changes do not alter this canvas -
- )}
- {inspectedNode && ( + {inspectedNode && (!historical || run) && ( setInspectedNode(undefined)} + liveEvents={state.liveEvents[liveDescriptorKey]} + liveLogs={historical ? state.liveLogs[liveDescriptorKey] : undefined} + onClose={closeNode} /> )}
diff --git a/web/operator/src/Explorer.test.tsx b/web/operator/src/Explorer.test.tsx index 0e9a621..c26f592 100644 --- a/web/operator/src/Explorer.test.tsx +++ b/web/operator/src/Explorer.test.tsx @@ -1,11 +1,22 @@ import { fireEvent, render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; +vi.mock("@tanstack/react-virtual", () => ({ + useVirtualizer: ({ count }: { count: number }) => ({ + getTotalSize: () => count * 44, + getVirtualItems: () => + Array.from({ length: Math.min(count, 120) }, (_, index) => ({ + index, + size: 44, + start: index * 44, + })), + }), +})); + import { Explorer } from "./Explorer"; import { CatalogSnapshotMsg, FlowInfoMsg, - RunSnapshotMsg, RunSummaryMsg, ScanTargetMsg, } from "./generated/operator"; @@ -20,15 +31,21 @@ const workflow = FlowInfoMsg.create({ nodeTypes: { fetch: "source" }, displayNames: { fetch: "Fetch" }, }); -const run = RunSnapshotMsg.create({ - summary: RunSummaryMsg.create({ - runId: "run-1", - workflowId: workflow.workflowId, - workflowDisplayName: workflow.displayName, - status: "success", - startedAt: 1, - createdSequence: "4", - }), +const run = RunSummaryMsg.create({ + runId: "run-1", + workflowId: workflow.workflowId, + workflowDisplayName: workflow.displayName, + status: "success", + startedAt: 1, + createdSequence: "4", +}); +const newerRun = RunSummaryMsg.create({ + runId: "run-2", + workflowId: workflow.workflowId, + workflowDisplayName: workflow.displayName, + status: "running", + startedAt: 2, + createdSequence: "9007199254740993", }); const target = ScanTargetMsg.create({ alias: "examples", @@ -36,18 +53,30 @@ const target = ScanTargetMsg.create({ kind: "directory", }); +function countBranchRenders( + source: FlowInfoMsg, + counter: { value: number }, +): FlowInfoMsg { + return new Proxy(source, { + get(target, property, receiver) { + if (property === "relativeFile") counter.value += 1; + return Reflect.get(target, property, receiver); + }, + }); +} + describe("Explorer", () => { - it("navigates the scan-target workflow and historical run hierarchy", () => { + it("navigates the scan-target workflow and historical run hierarchy", async () => { const onSelect = vi.fn(); - render( + const view = render( , @@ -55,6 +84,11 @@ describe("Explorer", () => { expect(screen.getByText("/workspace/examples")).toBeInTheDocument(); expect(screen.getByText("catalog r3")).toBeInTheDocument(); + const runButtons = await screen.findAllByRole("button", { name: /run-\d/ }); + expect(runButtons.map((button) => button.textContent)).toEqual([ + expect.stringContaining("run-2"), + expect.stringContaining("run-1"), + ]); fireEvent.click(screen.getByRole("button", { name: /Ordersflows.py/ })); expect(onSelect).toHaveBeenLastCalledWith({ @@ -62,11 +96,117 @@ describe("Explorer", () => { workflowId: workflow.workflowId, }); - fireEvent.click(screen.getByRole("button", { name: /run-1Created at sequence 4/ })); + fireEvent.click(await screen.findByRole("button", { name: /run-1Created at sequence 4/ })); expect(onSelect).toHaveBeenLastCalledWith({ kind: "run", workflowId: workflow.workflowId, runId: "run-1", }); + + view.rerender( + , + ); + expect( + await screen.findByRole("button", { name: /run-2Created/ }), + ).toHaveClass("active"); }); + + it("keeps unrelated branches out of parent detail and run-summary rerenders", async () => { + const ordersRenders = { value: 0 }; + const inventoryRenders = { value: 0 }; + const orders = countBranchRenders(workflow, ordersRenders); + const inventory = countBranchRenders( + FlowInfoMsg.create({ + ...workflow, + workflowId: "flows.py::inventory", + displayName: "Inventory", + }), + inventoryRenders, + ); + const inventoryRun = RunSummaryMsg.create({ + ...run, + runId: "inventory-run", + workflowId: inventory.workflowId, + workflowDisplayName: inventory.displayName, + }); + const catalog = { + ...CatalogSnapshotMsg.create({ + revision: "3", + scanTargets: [target], + }), + workflows: [orders, inventory], + }; + const runs = { "run-1": run, "inventory-run": inventoryRun }; + const selection = { kind: "workflow", workflowId: orders.workflowId } as const; + const onSelect = vi.fn(); + const view = render( + , + ); + + expect(await screen.findByText("Orders")).toBeInTheDocument(); + expect(screen.getByText("Inventory")).toBeInTheDocument(); + const initialOrdersRenders = ordersRenders.value; + const initialInventoryRenders = inventoryRenders.value; + expect(initialOrdersRenders).toBeGreaterThan(0); + expect(initialInventoryRenders).toBeGreaterThan(0); + + view.rerender( + , + ); + + expect(ordersRenders.value).toBe(initialOrdersRenders); + expect(inventoryRenders.value).toBe(initialInventoryRenders); + + const updatedInventoryRun = { ...inventoryRun, status: "failed" }; + view.rerender( + , + ); + + expect(screen.getByRole("button", { name: /inventory-run/ })).toHaveTextContent("!"); + expect(ordersRenders.value).toBe(initialOrdersRenders); + expect(inventoryRenders.value).toBeGreaterThan(initialInventoryRenders); + const inventoryRendersAfterUpdate = inventoryRenders.value; + + const updatedOrderRun = { ...run, status: "failed" }; + view.rerender( + , + ); + + expect(screen.getByRole("button", { name: /run-1/ })).toHaveTextContent("!"); + expect(ordersRenders.value).toBeGreaterThan(initialOrdersRenders); + expect(inventoryRenders.value).toBe(inventoryRendersAfterUpdate); + }); + }); diff --git a/web/operator/src/Explorer.tsx b/web/operator/src/Explorer.tsx index 88d1e3d..3cef4ad 100644 --- a/web/operator/src/Explorer.tsx +++ b/web/operator/src/Explorer.tsx @@ -1,10 +1,16 @@ -import { useState } from "react"; +import { + memo, + useLayoutEffect, + useMemo, + useRef, + useState, +} from "react"; +import { useVirtualizer } from "@tanstack/react-virtual"; import type { CatalogSnapshotMsg, FlowInfoMsg, - RunSnapshotMsg, - ScanTargetMsg, + RunSummaryMsg, } from "./generated/operator"; export type Selection = @@ -13,27 +19,76 @@ export type Selection = interface ExplorerProps { catalog?: CatalogSnapshotMsg; - runs: Record; + runs: Record; selection?: Selection; onSelect: (selection: Selection) => void; } +const EMPTY_RUNS: RunSummaryMsg[] = []; +const RUN_ROW_HEIGHT = 44; +const RUN_ROW_OVERSCAN = 8; + +interface WorkflowBranchProps { + workflow: FlowInfoMsg; + runs: RunSummaryMsg[]; + scrollElement: HTMLElement | null; + selection?: Selection; + onSelect: (selection: Selection) => void; +} + +function branchSelection(selection: Selection | undefined, workflowId: string) { + if (selection?.workflowId !== workflowId) return ""; + return selection.kind === "workflow" ? "workflow" : `run:${selection.runId}`; +} + +function sameRuns(left: RunSummaryMsg[], right: RunSummaryMsg[]) { + return left === right || ( + left.length === right.length && + left.every((summary, index) => summary === right[index]) + ); +} + function statusLabel(status: string) { return status === "success" ? "✓" : status === "failed" ? "!" : status === "running" ? "●" : "·"; } -function WorkflowBranch({ +const WorkflowBranch = memo(function WorkflowBranch({ workflow, runs, + scrollElement, selection, onSelect, -}: { - workflow: FlowInfoMsg; - runs: RunSnapshotMsg[]; - selection?: Selection; - onSelect: (selection: Selection) => void; -}) { +}: WorkflowBranchProps) { const [expanded, setExpanded] = useState(true); + const runList = useRef(null); + const [scrollMargin, setScrollMargin] = useState(0); + const virtualizer = useVirtualizer({ + count: expanded ? runs.length : 0, + getScrollElement: () => scrollElement, + estimateSize: () => RUN_ROW_HEIGHT, + getItemKey: (index) => runs[index].runId, + overscan: RUN_ROW_OVERSCAN, + scrollMargin, + initialRect: { width: 280, height: 800 }, + }); + + useLayoutEffect(() => { + if (!expanded || !runList.current || !scrollElement) return; + const listElement = runList.current; + const updateScrollMargin = () => { + const listRect = listElement.getBoundingClientRect(); + const scrollRect = scrollElement.getBoundingClientRect(); + setScrollMargin(listRect.top - scrollRect.top + scrollElement.scrollTop); + }; + updateScrollMargin(); + if (typeof ResizeObserver === "undefined") return; + const observer = new ResizeObserver(updateScrollMargin); + observer.observe(listElement.closest(".workflow-list") ?? listElement); + observer.observe(scrollElement); + return () => observer.disconnect(); + }, [expanded, runs.length, scrollElement]); + + return (
@@ -63,52 +118,116 @@ function WorkflowBranch({
{expanded && (
- {runs.map((run) => { - const summary = run.summary!; - return ( - - ); - })} - {!runs.length && No runs yet} + {runs.length ? ( +
+ {virtualizer.getVirtualItems().map((virtualRow) => { + const summary = runs[virtualRow.index]; + return ( +
+ +
+ ); + })} +
+ ) : ( + No runs yet + )}
)}
); -} +}, (left, right) => + left.workflow === right.workflow && + left.scrollElement === right.scrollElement && + left.onSelect === right.onSelect && + sameRuns(left.runs, right.runs) && + branchSelection(left.selection, left.workflow.workflowId) === + branchSelection(right.selection, right.workflow.workflowId), +); + -function targetWorkflows(catalog: CatalogSnapshotMsg, target: ScanTargetMsg) { - return catalog.workflows.filter((workflow) => workflow.rootAlias === target.alias); +function compareNewestRun(left: RunSummaryMsg, right: RunSummaryMsg) { + const leftSequence = BigInt(left.createdSequence); + const rightSequence = BigInt(right.createdSequence); + if (leftSequence === rightSequence) return left.runId.localeCompare(right.runId); + return leftSequence < rightSequence ? 1 : -1; } -export function Explorer({ catalog, runs, selection, onSelect }: ExplorerProps) { +function ExplorerView({ catalog, runs, selection, onSelect }: ExplorerProps) { const [collapsedTargets, setCollapsedTargets] = useState>({}); + const [scrollElement, setScrollElement] = useState(null); + const targets = useMemo(() => { + if (!catalog) return []; + return catalog.scanTargets.length + ? catalog.scanTargets + : [ + { + alias: "workflows", + targetPath: "Configured workflows", + kind: "directory", + }, + ]; + }, [catalog]); + const workflowsByTarget = useMemo(() => { + if (!catalog) return {}; + return Object.fromEntries( + targets.map((target) => [ + target.alias, + target.alias === "workflows" + ? catalog.workflows + : catalog.workflows.filter((workflow) => workflow.rootAlias === target.alias), + ]), + ); + }, [catalog, targets]); + const runsByWorkflow = useMemo(() => { + const grouped: Record = {}; + for (const summary of Object.values(runs)) { + (grouped[summary.workflowId] ??= []).push(summary); + } + for (const summaries of Object.values(grouped)) summaries.sort(compareNewestRun); + return grouped; + }, [runs]); if (!catalog) { return ( ); } - const targets = catalog.scanTargets.length - ? catalog.scanTargets - : [ - { - alias: "workflows", - targetPath: "Configured workflows", - kind: "directory", - }, - ]; return ( -