-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
579 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Makefile for client & server GRPC Generation | ||
# https://github.com/hyperium/tonic | ||
|
||
# Environment Variables | ||
SCHEMA_OUTPUT = ./crates/schema/generated/ | ||
|
||
.PHONY: clean | ||
clean: ## Deletes the output directory. | ||
$(call print-info, "Cleaning project...") | ||
rm -f $(SCHEMA_OUTPUT) | ||
$(call print-success, "Project cleaned.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
import "google/protobuf/empty.proto"; | ||
import "internal/jsonschema.proto"; | ||
import "internal/jsonvalue.proto"; | ||
|
||
package rt.entity; | ||
|
||
// Describes service details. | ||
message Service { | ||
// Unique identifier for the service. | ||
string service_id = 1; | ||
// Name of the service (e.g., Google Email). | ||
string name = 21; | ||
// Unique identifier for the service's icon. | ||
string icon = 22; | ||
// Brief description of the service. | ||
string description = 4; | ||
} | ||
|
||
// Describes action or trigger details. | ||
message Entity { | ||
string entity_id = 1; | ||
string service_id = 2; | ||
|
||
string name = 21; | ||
string icon = 22; | ||
|
||
// Input specifications for this entity. | ||
repeated Input inputs = 7; | ||
// Output specifications for this entity. | ||
repeated Output outputs = 8; | ||
// Possible error codes this entity might return. | ||
repeated Error errors = 9; | ||
} | ||
|
||
// Describes secrets required by a entity. | ||
message Secret { | ||
// Unique identifier for the secret. | ||
string id = 1; | ||
// Name of the secret (e.g., "API Key"). | ||
string name = 2; | ||
// Description of the secret. | ||
string description = 3; | ||
// Whether the secret is mandatory for the service. | ||
bool is_required = 4; | ||
} | ||
|
||
// Describes the input requirements for an entity. | ||
message Input { | ||
// Name of the input (e.g., "recipient"). | ||
string name = 1; | ||
// Data type of the input (e.g., "string", "int"). | ||
rt.json.schema.JsonSchema data_type = 2; | ||
// Description of the input. | ||
string description = 3; | ||
// Whether this input is mandatory. | ||
bool is_required = 4; | ||
// Default value for the input, if applicable. | ||
rt.json.value.JsonValue default_value = 5; | ||
} | ||
|
||
// Describes the output generated by an entity. | ||
message Output { | ||
// Name of the output (e.g., "message_id"). | ||
string name = 1; | ||
// Data type of the output (e.g., "string", "int"). | ||
rt.json.schema.JsonSchema data_type = 2; | ||
// Description of the output. | ||
string description = 3; | ||
} | ||
|
||
// Describes potential errors an entity can return. | ||
message Error { | ||
// Unique error code (e.g., "ERR_401"). | ||
string code = 1; | ||
// Human-readable error message. | ||
string message = 2; | ||
// Description or guidance for resolving the error. | ||
string resolution = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
import "google/protobuf/duration.proto"; | ||
|
||
package rt.request; | ||
|
||
// Request to open a connection to the event bus. | ||
// Indicates the Gateway is ready accept events. | ||
message OpenRequest { | ||
// Token for authenticating the Gateway. | ||
string authentication_token = 3; | ||
// Required runtime capabilities. | ||
repeated string runtime_capabilities = 4; | ||
// Preferred communication protocols. | ||
repeated string preferred_protocols = 5; | ||
|
||
// Constraints on resources for the task. | ||
optional ResourceLimits resource_limits = 26; | ||
} | ||
|
||
// Request to submit a task for execution by the Runtime. | ||
message ExecuteRequest { | ||
// Unique identifier for the task. | ||
string task_id = 1; | ||
// Custom task parameters as key-value pairs. | ||
map<string, string> task_fields = 2; | ||
// Sensitive task-specific data (e.g., API keys). | ||
map<string, string> task_secrets = 3; | ||
|
||
// Priority level of the task (higher is more important). | ||
optional int32 priority = 23; | ||
// Deadline for the task completion. | ||
optional google.protobuf.Timestamp deadline = 24; | ||
// Whether task dependencies are cached. | ||
optional bool cache_deps = 25; | ||
|
||
// Policy for retrying failed tasks. | ||
optional RetryPolicy retry_policy = 31; | ||
// Policy for handling task timeouts. | ||
optional TimeoutPolicy timeout_policy = 32; | ||
} | ||
|
||
// Request to close the connection, preventing the Runtime from accepting new tasks. | ||
message CloseRequest { | ||
// Force immediate closure without waiting. | ||
// Ignores pending tasks (from this connection) before closing. | ||
optional bool force_close = 2; | ||
// Reason for closing the connection. | ||
optional string reason = 3; | ||
// Require acknowledgment before closing. | ||
optional bool ack_required = 4; | ||
} | ||
|
||
// Policy for retrying failed tasks. | ||
message RetryPolicy { | ||
// Maximum number of retry attempts. | ||
uint32 max_retries = 1; | ||
// Base delay between consecutive retries. | ||
google.protobuf.Duration base_backoff = 2; | ||
// Multiplier for exponential backoff. | ||
optional double exponential_multiplier = 3; | ||
// Maximum delay between consecutive retries. | ||
google.protobuf.Duration max_backoff = 4; | ||
} | ||
|
||
// Policy for handling task timeouts. | ||
message TimeoutPolicy { | ||
// Maximum execution time allowed for the task. | ||
google.protobuf.Duration execution_timeout = 1; | ||
// Whether to forcibly terminate the task on timeout. | ||
bool terminate_on_timeout = 2; | ||
// Action to take on timeout (e.g., "retry", "terminate"). | ||
TimeoutAction timeout_action = 3; | ||
// Extra time given before final termination after timeout. | ||
optional google.protobuf.Duration grace_period = 4; | ||
// Frequency of checking for timeout conditions. | ||
optional google.protobuf.Duration monitor_interval = 5; | ||
} | ||
|
||
// Lists all of possible timeout actions. | ||
enum TimeoutAction { | ||
// Default value, action unspecified. | ||
TIMEOUT_ACTION_UNSPECIFIED = 0; | ||
// Task is considered to be failed. Retry the task. | ||
TIMEOUT_ACTION_RETRY = 1; | ||
// Task is considered to be failed. Do not retry the task. | ||
TIMEOUT_ACTION_TERMINATE = 2; | ||
} | ||
|
||
// Limits runtime resources. | ||
message ResourceLimits { | ||
// Maximum used CPU percentage. | ||
uint32 max_cpu_percent = 1; | ||
// Maximum used RAM in MB. | ||
uint32 max_ram_mb = 2; | ||
// Maximum used disk in MB. | ||
uint64 max_disk_mb = 3; | ||
} |
Oops, something went wrong.