Skip to content

capability.proto

Every Selu capability exposes a gRPC server that implements the Capability service defined below. The orchestrator calls Invoke (or StreamInvoke) when an agent uses a capability tool, Healthcheck to monitor liveness, and the artifact RPCs to pass files in and out.

capability.proto
syntax = "proto3";
package selu.capability;
service Capability {
rpc Invoke(InvokeRequest) returns (InvokeResponse);
rpc StreamInvoke(InvokeRequest) returns (stream InvokeChunk);
rpc Healthcheck(HealthRequest) returns (HealthResponse);
rpc UploadInputArtifact(stream UploadInputArtifactChunk) returns (UploadInputArtifactResponse);
rpc DownloadOutputArtifact(DownloadOutputArtifactRequest) returns (stream ArtifactChunk);
}
message InvokeRequest {
string tool_name = 1;
bytes args_json = 2;
bytes config_json = 3;
string session_id = 4;
string capability_id = 5;
string thread_id = 6;
}
message InvokeResponse {
bytes result_json = 1;
string error = 2;
}
message InvokeChunk {
bytes data = 1;
bool done = 2;
string error = 3;
}
message HealthRequest {}
message HealthResponse {
bool ready = 1;
string message = 2;
}
message UploadInputArtifactChunk {
bytes data = 1;
string filename = 2;
string mime_type = 3;
}
message UploadInputArtifactResponse {
string capability_artifact_id = 1;
string error = 2;
}
message DownloadOutputArtifactRequest {
string artifact_id = 1;
}
message ArtifactChunk {
bytes data = 1;
string filename = 2;
string mime_type = 3;
bool done = 4;
string error = 5;
}
RPCRequestResponseDescription
InvokeInvokeRequestInvokeResponseExecute a tool and return the full result in one response.
StreamInvokeInvokeRequeststream InvokeChunkExecute a tool and stream partial results back as chunks.
HealthcheckHealthRequestHealthResponseReport whether the capability is ready to accept requests.
UploadInputArtifactstream UploadInputArtifactChunkUploadInputArtifactResponseStream a file into the capability before invocation.
DownloadOutputArtifactDownloadOutputArtifactRequeststream ArtifactChunkStream a file out of the capability after invocation.

Sent by the orchestrator when an agent calls a tool on this capability.

FieldNumberTypeDescription
tool_name1stringThe name of the tool to execute (must match a tool declared in manifest.yaml or returned by dynamic discovery).
args_json2bytesJSON-encoded tool arguments conforming to the tool’s input_schema.
config_json3bytesJSON-encoded configuration object. Contains credentials and any other runtime config injected by the orchestrator.
session_id4stringIdentifier for the current user session.
capability_id5stringThe unique identifier of this capability instance.
thread_id6stringIdentifier for the conversation thread that triggered this invocation.

Returned by Invoke with the full result.

FieldNumberTypeDescription
result_json1bytesJSON-encoded result data.
error2stringIf non-empty, the invocation failed and this contains the error message.

Streamed back by StreamInvoke as partial results become available.

FieldNumberTypeDescription
data1bytesA chunk of the result payload.
done2booltrue on the final chunk in the stream.
error3stringIf non-empty, the stream is terminating with an error.

Empty message. No fields.

FieldNumberTypeDescription
ready1booltrue when the capability is ready to accept invocations.
message2stringOptional human-readable status detail (e.g. reason for not being ready).

Streamed to the capability by the orchestrator to deliver an input file.

FieldNumberTypeDescription
data1bytesA chunk of the file contents.
filename2stringOriginal filename. Set on the first chunk; may be empty on subsequent chunks.
mime_type3stringMIME type of the file. Set on the first chunk; may be empty on subsequent chunks.
FieldNumberTypeDescription
capability_artifact_id1stringAn identifier the capability assigns to the uploaded artifact, used to reference it during invocation.
error2stringIf non-empty, the upload failed.
FieldNumberTypeDescription
artifact_id1stringThe identifier of the artifact to download.

Streamed back to the orchestrator when downloading an output artifact.

FieldNumberTypeDescription
data1bytesA chunk of the file contents.
filename2stringOriginal filename. Set on the first chunk.
mime_type3stringMIME type of the file. Set on the first chunk.
done4booltrue on the final chunk in the stream.
error5stringIf non-empty, the download is terminating with an error.

args_json, config_json, and result_json are typed as bytes rather than string. This avoids double-encoding issues when the JSON payload contains arbitrary binary data or non-UTF-8 sequences. In most languages the practical difference is minimal — you serialize your JSON to a byte array and assign it directly.

There is no dedicated credentials field. The orchestrator bundles credentials declared in manifest.yaml into the config_json object alongside any other runtime configuration. This keeps the proto surface small and lets the orchestrator add new config keys without a proto change.

StreamInvoke returns a dedicated InvokeChunk message instead of reusing InvokeResponse. Each chunk carries a data payload and a done flag so the client knows when the stream is complete. This is useful for capabilities that produce incremental output such as search results or progress updates.

Artifacts are the mechanism for passing files between the orchestrator and capabilities. Before invoking a tool that needs a file, the orchestrator streams the file in via UploadInputArtifact and receives a capability_artifact_id that can be referenced in args_json. After invocation, the orchestrator can retrieve output files via DownloadOutputArtifact. Both directions use chunked streaming so there is no hard size limit on files.

Use buf or protoc to generate stubs in your language of choice:

Terminal window
# Using buf (recommended)
buf generate proto/capability.proto
# Using protoc directly (Go example)
protoc --go_out=. --go-grpc_out=. proto/capability.proto
# Python example
python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. proto/capability.proto

The official Selu SDKs for Go and Python include pre-generated stubs, so you typically do not need to run code generation yourself.

The orchestrator calls Healthcheck periodically. If a capability returns ready: false or fails to respond within the timeout, the orchestrator marks it as unhealthy and stops routing invocations until it recovers.