Remote transport API
Import CortexRemoteTransport from @cortexmemory/vercel-ai-provider/remote. It implements AI SDK 7 ChatTransport and performs no application inference or memory writes.
Options
| Field | Contract |
|---|---|
client | Owned or caller-shared authenticated CortexRuntimeClient |
agentId, agentVersion | Published Agent selector |
conversationId? | Existing authorized canonical conversation |
finalOnly? | Observe final canonical output instead of deltas |
onRun? | Receive admitted handle |
onObservation? | Receive run, output parts and approvals |
state? | Restore this app's bounded CortexRemoteState after fresh authorization |
Lifecycle
| Member | Effect |
|---|---|
run / state | Current handle / copied reconnect projection |
disconnect() | Close browser observation; backend run continues |
stop() | Request server cancellation, then disconnect |
approveInput() | Approve/start the existing input under server policy |
approveTool(approval) | Approve the exact server operation/name/hash tuple |
attach(handle) | Select an existing matching Agent handle without submit/start |
setConversation(id?) | Disconnect and select the next canonical conversation |
sendMessages(options) | AI SDK new text submission; stable message ID is replay identity |
reconnectToStream(options) | Reverify retained run and resume cursor observation |
The transport rejects request body, headers or metadata overrides, regeneration, non-text parts and changed input under the same replay identity. Restored state pins Agent/conversation and bounded projections; it grants no access.
UI output
Text and message metadata follow AI SDK 7. Cortex emits data-cortex-status, data-cortex-approval, data-cortex-tool, data-cortex-artifact, data-cortex-media-job and data-cortex-error. Fetch retained artifacts/jobs freshly via the runtime client.
Metadata includes run/conversation/tenant/space identity, definition hash, attempt/cursor, response/memory/graph statuses, context completeness and failure codes. Do not treat metadata as a policy or permission.
Compatibility exports
Existing provider root and ./react exports retain advanced local server wrappers/hooks. Legacy local orchestration requires explicit administrative server transport (deploymentOperator mode with separately verified admin credentials); ordinary clients fail with CAPABILITY_UNAVAILABLE before inference/memory effects. These helpers do not execute backend runs. Use /remote and runtime client for ordinary applications.