- Add unbounded CLI sessions agent-task with plan and code review logs - Add edge console with tests - Add node run manager for session lifecycle management - Add router and store tests - Update transport session handling - Add runtime proto definitions - Update configurations and packages
106 lines
2.8 KiB
Protocol Buffer
106 lines
2.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package iop;
|
|
|
|
import "google/protobuf/struct.proto";
|
|
|
|
option go_package = "iop/proto/gen/iop";
|
|
|
|
enum RunSessionMode {
|
|
RUN_SESSION_MODE_UNSPECIFIED = 0; // default: create if missing
|
|
RUN_SESSION_MODE_CREATE_IF_MISSING = 1;
|
|
RUN_SESSION_MODE_REQUIRE_EXISTING = 2;
|
|
}
|
|
|
|
enum CancelAction {
|
|
CANCEL_ACTION_UNSPECIFIED = 0; // default: cancel run only
|
|
CANCEL_ACTION_CANCEL_RUN = 1;
|
|
CANCEL_ACTION_TERMINATE_SESSION = 2;
|
|
}
|
|
|
|
// RunRequest initiates a model execution.
|
|
message RunRequest {
|
|
string run_id = 1;
|
|
string adapter = 2;
|
|
string model = 3;
|
|
string workspace = 4;
|
|
google.protobuf.Struct policy = 5;
|
|
google.protobuf.Struct input = 6;
|
|
int32 timeout_sec = 7;
|
|
map<string, string> metadata = 8;
|
|
string session_id = 9;
|
|
RunSessionMode session_mode = 10;
|
|
bool background = 11;
|
|
}
|
|
|
|
// RunEvent is a streaming execution event.
|
|
message RunEvent {
|
|
string run_id = 1;
|
|
string type = 2; // start | delta | complete | error | cancelled
|
|
string delta = 3;
|
|
string message = 4;
|
|
string error = 5;
|
|
Usage usage = 6;
|
|
map<string, string> metadata = 7;
|
|
int64 timestamp = 8; // unix nano
|
|
string session_id = 9;
|
|
bool background = 10;
|
|
}
|
|
|
|
message Usage {
|
|
int32 input_tokens = 1;
|
|
int32 output_tokens = 2;
|
|
}
|
|
|
|
// Heartbeat is sent by both sides to keep the connection alive.
|
|
message Heartbeat {
|
|
int64 timestamp = 1;
|
|
}
|
|
|
|
// CancelRequest asks the node to cancel a running execution.
|
|
message CancelRequest {
|
|
string run_id = 1;
|
|
string adapter = 2;
|
|
string model = 3;
|
|
string session_id = 4;
|
|
CancelAction action = 5;
|
|
}
|
|
|
|
// Error is returned when a request fails at the transport layer.
|
|
message Error {
|
|
string code = 1;
|
|
string message = 2;
|
|
}
|
|
|
|
// RegisterRequest is sent by node to edge immediately on connect.
|
|
message RegisterRequest {
|
|
string token = 1;
|
|
}
|
|
|
|
// RegisterResponse is sent by edge to node in response to RegisterRequest.
|
|
message RegisterResponse {
|
|
bool accepted = 1;
|
|
string node_id = 2;
|
|
string alias = 3;
|
|
string reason = 4; // rejection reason
|
|
NodeConfigPayload config = 5;
|
|
}
|
|
|
|
// NodeConfigPayload carries all configuration edge pushes to the node.
|
|
message NodeConfigPayload {
|
|
repeated AdapterConfig adapters = 1;
|
|
NodeRuntimeConfig runtime = 2;
|
|
}
|
|
|
|
// AdapterConfig describes one adapter to enable on the node.
|
|
message AdapterConfig {
|
|
string type = 1; // "mock" | "ollama" | "vllm" | "cli"
|
|
bool enabled = 2;
|
|
google.protobuf.Struct settings = 3;
|
|
}
|
|
|
|
// NodeRuntimeConfig is the runtime tuning pushed to the node.
|
|
message NodeRuntimeConfig {
|
|
int32 concurrency = 1;
|
|
string workspace_root = 2;
|
|
}
|