Skip to main content

Widget API

Create one authorized SDK with createTradeScriptSdk({ lease }), then mount the chart or any standalone product surface through a named sdk.<surface>.mount(...) module. The same lifecycle works in plain JavaScript, Angular, Vue, Nuxt, Svelte, React, and Next.js.

Search 479 supported widget contracts below. Expand a result to see its TypeScript declaration, properties, methods, parameters, return values, and errors. Share a filtered URL or a symbol anchor when another engineer needs the same contract.

Start here

Browse the reference

Classes 7

Structured browser-safe failure shared by customer providers and the SDK tool-call loop.
Error thrown when installing, verifying, or using a chart lease fails. Extends SdkError with a typed ChartAuthorizationErrorCode so hosts can branch on the exact failure.
Coordinates multiple ChartApi instances as one workspace: chart registry and active-chart tracking, cross-chart synchronization of symbol, interval, crosshair, drawings, indicators, comparisons, and visible range, multi-chart split-layout and maximize state, and storage-backed layout save/load. Every public method is gated by an entitlement authorization lease captured from the first chart.
SdkError subclass thrown when the drawing storage backend rejects a change because the caller lacks permission; always carries the code storage.permission-denied.
SdkError subclass thrown when a drawing save conflicts with a newer revision on the server; always carries the code storage.revision-conflict.
Bar-replay state machine over a chart's loaded bars: pick a start bar, then play, pause, step, and jump with a speed-scaled timer, with every transition emitted to subscribers and mirrored onto the chart's 'replay-change' event bus, and optional persistence through a chart storage adapter. Construction captures a direct-controller authorization lease bound to the chart, and every API call re-asserts that the 'replay' feature is still authorized.
Error type thrown across the public SDK surface. Every failure carries a stable machine-readable SdkError.code so customers can branch on the cause without string-matching the message.

Interfaces 251

Controlled access picker. The host must rotate tools before publishing a new value.
One customer-authored access choice displayed by the Agent Chat surface.
Safe, bounded diagnostics attached to a structured Agent Chat failure.
Required fields for constructing a browser-safe Agent Chat error.
Text message authored by the customer or the selected model.
One customer-approved model available through the customer chat backend.
Backend-neutral chat authority supplied by the SDK host.
Complete input sent to the customer backend for one streamed model turn.
Framework-neutral options accepted by the customer-provider Agent Chat SDK surface.
Access-bound browser authority that validates and executes Agent Chat tool calls.
One validated tool request emitted by the customer-selected model.
JSON-safe tool schema advertised to the customer chat backend and model.
SDK-owned evidence extracted from one successful Agent Chat tool result.
Visible and accessible strings rendered by the Agent Chat surface.
Load state of the agent capability inventory rendered in the console's capabilities disclosure.
Context passed to the host's renderCapabilities callback: the current capabilities snapshot plus an optional refresh trigger.
One link in the connection chain rendered by the agent console, with its own readiness status.
Host-implemented command callbacks the agent console invokes in response to operator actions; each is optional and may complete synchronously or return a promise.
Operator-entered connection details the console forwards to AgentConsoleCommands.connect.
Presentation-ready connection state rendered by the console: the lifecycle status, its host-supplied label, the connection-chain hops, and any error text.
Host-owned authority consumed by AgentConsoleWidget. Implementations own gateway URLs, fetch/WebSocket work, credential storage, session rotation, policy changes, clipboard behavior, simulation, and evidence collection. The widget renders snapshots and forwards human actions.
Event delivered to AgentConsoleControllerApi.subscribe listeners: the change reason, the snapshot revision, and the full resulting snapshot.
One renderable activity feed — the live activity view while connected, or the retained session log shown in the setup template after a session ended. Hosts supply the visible entries plus overflow metadata.
One row of the per-surface grant matrix. Rows come from the host's mounted surfaces.
State of the Grant access section: the per-surface read/write grant matrix plus the paper-trading toggle row. Hosts derive the rows from their mounted surfaces and apply changes through commands.setGrant and commands.setPaperTradingEnabled.
A host-authored notice rendered by the console — either the setup-template banner (disconnect, revocation, issuance errors) or a secondary strip under the active template (e.g. market-feed failures).
One suggested-prompt pill shown in the connected template. Clicking the pill copies the host-side prompt text via commands.copyPrompt(id); an optional Simulate button runs it via commands.simulatePrompt(id).
Session identity rendered in the status row next to the connection label.
Complete read model rendered by AgentConsoleWidget. Presentation-ready values only. Transport credentials entered by the operator never belong in this snapshot.
Framework-neutral options accepted by the Agent Console SDK surface.
The complete set of user-visible strings rendered by AgentConsoleWidget. Hosts override any subset through the widget's labels prop; unspecified keys fall back to DEFAULT_AGENT_CONSOLE_LABELS.
Host-authored access policy declaring what an agent may do, split into read, write, and trade grants; each grant may be a boolean, a family/control flag map, or carry policy constraints. Omitted grants are denied when the policy is resolved.
One reviewed decision that a visible affordance of a public widget component is intentionally not an agent-operable control, recorded with its classification and rationale in the component's surface contract.
Universal string-id request for protocol bridges after SDK catalog lookup.
Universal string-id subscription request for protocol bridges.
Registration of one SDK built-in controller on an agentic surface: the host supplies the live controller plus optional support narrowing, revision authority, state authority, and subscription bindings, while the semantic contract and result projections come from the SDK catalog and cannot be replaced.
The declared semantic inventory of one built-in surface (a public widget kind or the terminal): its capabilities, controller and subscription bindings, and public component contracts. Authored explicitly — never derived from JSX, callback names, or DOM shape.
Request for inspectEffectiveCapabilities: the effective-controls query (target, optional session access, access class, and family filters) plus an optional unavailableLimit bounding how many unavailable and unclassified rows are returned per list (default 256, maximum 1000).
Result of inspecting one target's effective capabilities: the controls an agent can invoke right now, the controls that are unavailable with exact reasons, and counts and truncation flags for both the unavailable and unclassified lists.
Typed facts available to one exact source-owned constraint extractor. The registry supplies these facts; the extractor alone defines how they map to policy values.
The typed facts supplied to one result filter: what is being filtered (control result, controller state, or subscription event), the originating invocation arguments, the live controller and its registered authorities, the raw result, and the effective policy constraints in force.
Minimal identity triple used by policy evaluation to decide whether one control is allowed: its access class, owning family id, and exact control id. Passed to isAgenticControlAllowed so grants resolve by exact identifiers, never by parsing names.
The complete constraint contract for one control: the argument/resource bindings enforced before dispatch, plus optional result filters that narrow readable results (before portable projection, inside the revision guard) when matching constraints are active.
One agent-callable control in the catalog: its identity, owning controller and method, access/risk classification, mutation semantics, and human-readable description and signature. Protocol bridges consume these descriptors as the sole classification authority for controller methods.
Exact ownership and scope facts for one catalog controller, shared by every agent transport: its id, the scopes it can be registered under, its public interface name, and what one instance represents.
Async controller-owned capability authority resolved before agent discovery.
Declares which of a controller's contracted controls and subscription channels are actually supported at runtime, as resolved by an AgenticControllerSupportAuthority or declared statically on the registration.
Binds one exact SDK-owned result-filter identity to a control so its read results are narrowed whenever at least one of the listed policy constraints is active; filtering runs before portable projection and inside the revision guard.
Exact custom function maps; descriptors reference these functions only by id.
Custom controllers must bring an explicit protocol-neutral semantic contract.
Registers a host-defined controller on a surface: the controller instance together with its explicit semantic contract, a required result projector to portable JSON, and optional constraint authorities referenced by descriptor ids.
Invocation request for a control declared by a custom controller contract; identical to AgenticInvokeRequest except the control id and session access are typed against the host's custom control ids.
Subscription request for a channel declared by a custom controller contract; identical to AgenticSubscribeRequest except the channel id and session access are typed against the host's custom ids.
Surface registration whose kind is a host-defined string and whose optional access policy may grant custom control ids; passed to registerCustomSurface to mount surfaces beyond the built-in session, terminal, and widget kinds.
Registration/support-owned fact; policy and execution-mode reasons are derived elsewhere.
Query for the controls effectively available on one surface after intersecting adapter, surface, and session policies with declared controller support; used by listEffectiveControls and extended by AgenticCapabilityInspectionRequest.
Exact SDK-owned financial possibilities for one callable control.
Options for one guarded compare-and-swap mutation through an AgenticRevisionAuthority: the revision domains the mutation touches, the caller's operation identity and origin, and optional expected revisions for optimistic concurrency.
What a guarded-invocation callback returns: the produced value plus whether state was actually mutated, so the revision authority knows whether to advance revisions.
Receipt returned by AgenticRevisionAuthority.invokeGuarded: the callback's value along with the echoed operation identity and the revision snapshots observed before and after the mutation.
Public adapter receipt preserving caller identity and exact downstream evidence identity.
Request to invoke one built-in catalog control on a surface through the adapter's guarded lane, carrying the caller's operation identity and origin, optional arguments and expected revisions, and optional session-access narrowing.
Metadata handed to a guarded-invocation callback and attached to the mutations it performs, identifying the operation, its origin, and the revision snapshot the mutation executes against.
Host-authored input bounds. Omission is explicitly unbounded at that policy boundary.
Reviewed semantic inventory entry for one public React component of a built-in surface, declaring how the component is exposed to agents and which of its visible affordances are deliberately excluded. Entries are hand-authored, never derived from JSX or callback names.
Request to read one surface's full agentic context (kind, capabilities, projected state, revisions, and subscription descriptors), subject to the intersected access policies.
Stable snapshot of one surface's agentic context: its kind and capability tags, per-controller projected state and revision snapshots, and the subscription channels readable on it.
A registered surface as returned by getSurface: its public descriptor plus the live controller registrations and the optional access-narrowing policy and snapshot authority it was registered with.
Atomic controller-owned compare-and-swap authority. Registries never synthesize it.
A revision authority extended with an imperative record method, letting SDK composition roots bump revision counters for out-of-band mutations that did not flow through invokeGuarded. Created by createAgenticRevisionLedger.
Optional per-surface-kind narrowing carried by AgenticSessionAccess: for a resolved target, the entry matching its surface kind is intersected with the flat session grants before enforcement.
Surface-owned authority for bounded visual export that captures the surface's current rendering as an encoded image. It must be registered explicitly; DOM access is never inferred from controllers.
Request to capture a visual snapshot of one surface through its registered snapshot authority, subject to the intersected access policies.
Encoded image produced by a snapshot capture, returned as a self-contained data URL with its media type and payload size.
Controller-owned authority that exposes the controller's complete state to agentic reads: it reads the raw state, projects it to portable JSON, and declares how constrained read boundaries are covered.
Request to attach to one built-in subscription channel on a surface and receive its projected JSON events, subject to the intersected access policies.
Controller-owned wiring for one subscription channel: how to start the underlying event stream and how each raw event is projected to portable JSON before delivery to agentic subscribers.
Exact synchronous option inputs enforced before a source subscription starts.
The per-channel validation authority pairing a subscription's options contract with its event contract. It is asserted structurally before a channel becomes discoverable and then used to validate every subscribe call and delivered event.
Catalog descriptor for one subscription channel: its owning controller, target scopes, access class, permission family, portable options and event contracts, and optional pre-subscribe constraint bindings. Built-in descriptors live in AGENTIC_SUBSCRIPTION_CATALOG and are validated at module load.
Portable value contract for a channel's subscribe options, extending the base value contract with a required flag; when required is true, omitting the options is rejected before the source subscription starts.
Portable contract describing one subscription value (options or event): a public signature string, a JSON-serializable AgenticPortableSchema used for validation, and an example value that must itself pass the schema.
The adapter's agentic surface API: hosts register session, chart, and widget surfaces with their controllers, and agents use its guarded lanes to discover capabilities, read context, invoke controls, subscribe to channels, and capture snapshots under the resolved access policy.
Public identity of one registered surface as returned by discovery: its addressable target, registered kind, mounted controller ids, and capability tags.
One flattened non-callable decision: a single controller method deliberately excluded from the agentic control catalog, with its exact reason and explanation. Derived from AGENTIC_SURFACE_EXCLUSION_GROUPS so audits have one SDK authority per method.
Groups several methods of one controller under a single exclusion reason and explanation; the source-of-truth form of AGENTIC_SURFACE_EXCLUSIONS before flattening to per-method entries.
Input to registerSurface: binds a target to a built-in surface kind with its controller registrations, plus optional capability tags, an access-narrowing policy, and a snapshot authority.
Terminal-level agentic feature policy: an access policy for the terminal surface itself, optionally narrowed further per contained widget kind.
Trade-class grant within an access policy; unlike read and write grants it must pin the trading execution environment it is valid for, so paper and live access can never be conflated.
Explanation for one control excluded from the effective set during capability inspection: the full control descriptor plus the reason it is unavailable.
Immutable approval identity emitted by the host from one exact ready controller resolution. The widget must echo all three fields unchanged; it never looks up a newer draft at click time.
One exact host-supplied clause blocker.
The only human actions exposed by the proposal widget. Execution and approval fulfillment are deliberately absent: the host owns those authorities and the agent cannot approve itself.
Host-evaluated market check rendered without recalculating indicators in the widget.
Result of one host-evaluated market predicate.
One presentation-ready message in the host-owned conversation transcript.
One label/value fact nested under a normalized plan section.
One normalized strategy section prepared by the host strategy authority.
Command payload that rejects stale human intent at the host authority.
Human-authored message plus the revision visible when it was submitted.
Complete presentation projection consumed by AgentStrategyComposerWidget.
Framework-neutral options accepted by the proposal-only Agent Strategy Composer SDK surface.
The full per-chart control surface, extending the base ChartController with chart types, toolbar favorites, chart objects, viewport and scale control, indicators, comparisons, drawings, markers, alerts, order-flow overlays, pane layout, storage, templates, and built-in dialogs. Hosts obtain it from the widget for the mounted chart they want to drive programmatically.
Public per-chart settings for SDK-owned compute overlays.
Minimal control surface every mounted chart exposes: symbol and interval switching, state snapshot/restore, resize, teardown, and typed event subscription. ChartApi extends it with the full per-chart API, so hosts can code against this base when they only need core control.
Per-control switches for on-chart chrome. Everything defaults to visible with the modal settings dialog.
Visible strings used by chart-data-table controls and empty states.
Framework-neutral options accepted by the modal chart-data-table SDK surface.
Framework-neutral options accepted by the inline chart-data-table SDK surface.
Default toolbar favourites (starred intervals, chart types, drawing tools, and indicators) seeded by the host through the widget favorites option; persisted user favourites always win over these defaults.
Per-widget feature switches. Each member turns a chart surface on or off for this widget. Configuration is not authorization: the chart-feature entitlement of the same name can still deny a surface regardless of what is set here.
Identity and guard configuration for one ChartWidgetApi.invokeGuarded call: compare-and-swap revision expectations, the revision domains the callback may mutate, and the operation's provenance.
Explicit callback outcome: SDK callers must distinguish a real mutation from a read/no-op.