> Canonical guide: https://developers.foxlight.ai/build/sdk/reference/capabilities/
> Contract snapshots: Skulk 2.0.0 (b0af39c79b6b7102b2478062904f1d7cc8619975); SDK 1.0.1 (fe6e0f8737ae343769b8cfc0a67ab112b9efac52). Check the installed runtime when versions differ.

# capabilities API

SDK 1.0.1. This reference describes the supported authoring interface.

## `Behavior`

```python
type Behavior = Literal['read', 'inference', 'proposal', 'execute']
```

## `Mode`

```python
type Mode = Literal['unary', 'server_streaming', 'client_streaming', 'bidirectional']
```

## `Domain`

```python
type Domain = Literal['local', 'private_site', 'external']
```

## `InterfaceErrorCode`

```python
type InterfaceErrorCode = Literal['invalid_descriptor', 'invalid_payload', 'unavailable', 'not_read', 'unsupported_mode']
```

## `CapabilityInterfaceError`

A bounded interface refusal without descriptor, argument or caller data.

### `CapabilityInterfaceError.__init__`

Retain only a stable refusal code; do not retain the failed input.

```python
def __init__(self, code: InterfaceErrorCode) -> None:
    ...
```

## `CapabilityDescription`

An owned, native-validated declaration, not proof of current permission.

### `CapabilityDescription.from_endpoint`

Read a declaration through the native reader, without contacting a host.

The input may come from configuration or a directory observation. It
supplies no signed custody, current readiness or execution authority.

```python
def from_endpoint(cls, destination: CapabilityEndpoint) -> CapabilityDescription:
    ...
```

### `CapabilityDescription.descriptor`

Return a defensive copy of the complete native portable declaration.

```python
def descriptor(self) -> dict[str, JsonValue]:
    ...
```

### `CapabilityDescription.behavior`

Return the signed declaration's effect classification without relabelling.

```python
def behavior(self) -> Behavior:
    ...
```

### `CapabilityDescription.io_mode`

Return the exact declared input/output lifecycle.

```python
def io_mode(self) -> Mode:
    ...
```

### `CapabilityDescription.processing_domain`

Return the declared processing boundary; this is not caller consent.

```python
def processing_domain(self) -> Domain:
    ...
```

### `CapabilityDescription.summary`

Return the declaration's descriptive text, never an authority decision.

```python
def summary(self) -> str:
    ...
```

### Fields

```python
endpoint: CapabilityEndpoint
```

| Field | Description | Declared defaults and constraints |
| --- | --- | --- |
| `endpoint` | — | — |

## `CapabilityProposal`

Immutable request data for review; it contains no caller or approval proof.

Use `prepare` to construct an intent. Export is explicit because arguments
and request hashes may be private. No method submits or executes this object.
A host must independently authenticate the caller and admit any later work.

### `CapabilityProposal.prepare`

Validate and copy an inert JSON request without I/O or dispatch.

Supports unary and server-output requests. Input-media streams cannot
be represented by an initial JSON object alone and are refused. A
governed declaration can be described here but gains no execution path.

```python
def prepare(cls, destination: CapabilityEndpoint, payload: dict[str, JsonValue]) -> CapabilityProposal:
    ...
```

### `CapabilityProposal.canonical`

Explicitly export exact intent bytes; these bytes grant no authority.

```python
def canonical(self) -> bytes:
    ...
```

### `CapabilityProposal.payload`

Return an owned argument copy without exposing internal storage.

```python
def payload(self) -> dict[str, JsonValue]:
    ...
```

### `CapabilityProposal.request_bytes`

Explicitly export the exact canonical request bound by the intent.

```python
def request_bytes(self) -> bytes:
    ...
```

### `CapabilityProposal.digest`

Identify this exact intent for comparison; the digest is not approval.

```python
def digest(self) -> str:
    ...
```

## `CapabilityClient`

Common interfaces bound to one actual invocation and its original caller.

### `CapabilityClient.__init__`

Retain the invocation only; no replacement caller or bearer is accepted.

```python
def __init__(self, invocation: Invocation) -> None:
    ...
```

### `CapabilityClient.describe`

Freshly resolve one exact permitted descriptor without caching authority.

```python
async def describe(self, destination: CapabilityEndpoint) -> CapabilityDescription:
    ...
```

### `CapabilityClient.read`

Perform one declared unary read using original-caller native dispatch.

Reject inference/proposal/execute declarations before transport. Current
permissions and signed destination are independently checked at dispatch;
cancellation, revocation and uncertain outcomes retain existing custody.
A configured read does not require the optional discovery channel.

```python
async def read(self, destination: CapabilityEndpoint, payload: dict[str, JsonValue] | bytes, *, deadline_unix_ms: int | None=None) -> CallReply:
    ...
```

### `CapabilityClient.propose`

Prepare an inert intent after current caller-filtered observation.

No handler is invoked and no child-effect sequence is consumed. Hosts
that do not expose governed destinations still refuse them; this method
cannot replace that boundary with a service identity or an approval.

```python
async def propose(self, destination: CapabilityEndpoint, payload: dict[str, JsonValue]) -> CapabilityProposal:
    ...
```
