Vega
Vega Capability Protocol

Communication

Current VCP communication is a direct Python Runtime-to-Provider contract. No public transport, request envelope, response envelope, streaming endpoint, or heartbeat protocol exists.

Concepts

  • Initialization context: Provider-scoped, read-only services supplied to initialize.
  • Execution request: immutable action identity, inputs, deadline, and optional Runtime correlation data.
  • Execution context: per-execution cancellation, progress, services, and leases.
  • Progress callback: an async callback installed by the Runtime.
  • Result: the successful return value from execute.

Direct call flow

sequence
Runtime → Provider : initialize(ProviderInitializationContext)
Runtime → Provider : health_check()
Runtime → Provider : execute(CapabilityExecutionRequest, CapabilityExecutionContext)
Provider → Runtime : ProgressReporter callback (zero or more)
Provider → Runtime : CapabilityExecutionResult or CapabilityError
Runtime → Provider : shutdown()

CapabilityExecutionContext.validate_request MUST succeed before a Provider uses a request. ProgressReporter.report freezes the payload, applies its configured size limit, validates it when a callback is configured, and emits an event dictionary with execution_id, increasing sequence, UTC timestamp, trace_id, and payload to the Runtime callback.

Progress example

python
await context.progress.report({"phase": "synthesizing", "percentComplete": 10})

The payload itself MUST meet the Action progress schema when the Runtime injects schema validation. The SDK does not expose that callback as a remote event wire format.

Cancellation and deadlines

The Runtime requests cooperative cancellation through context.cancellation. The Provider SHOULD use raise_if_cancelled at safe points and MAY wait for the token. An Action may declare cancellation support; a Provider may also implement the optional cancel(execution_id) method. A deadline is visible in the request and context, but the SDK does not autonomously cancel at the deadline.

Runtime
CancellationToken
Provider safe interruption point
Underlying stop attempt
Result or CancellationCapabilityError

Python SDK example

python
class EchoProvider(BaseCapabilityProvider):
async def on_execute(self, request, context):
context.validate_request(request)
context.cancellation.raise_if_cancelled()
await context.progress.report({"phase": "working"})
return CapabilityExecutionResult(output={"echo": request.inputs})

There is no TypeScript SDK or TypeScript transport example in the repository. Implementations in other languages require a separately published language-neutral VCP specification.