syntax = "proto3";

package coresdk;
option ruby_package = "Temporalio::Internal::Bridge::Api::CoreInterface";

// Note: Intellij will think the Google imports don't work because of the slightly odd nature of
// the include paths. You can make it work by going to the "Protobuf Support" settings section
// and adding the "api_upstream" subdir as an include path.
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "temporal/api/common/v1/message.proto";
import "temporal/sdk/core/activity_result/activity_result.proto";
import "temporal/sdk/core/activity_task/activity_task.proto";
import "temporal/sdk/core/common/common.proto";
import "temporal/sdk/core/external_data/external_data.proto";
import "temporal/sdk/core/workflow_activation/workflow_activation.proto";
import "temporal/sdk/core/workflow_commands/workflow_commands.proto";
import "temporal/sdk/core/workflow_completion/workflow_completion.proto";

// A request as given to `record_activity_heartbeat`
message ActivityHeartbeat {
    bytes task_token = 1;
    repeated temporal.api.common.v1.Payload details = 2;
}

// A request as given to `complete_activity_task`
message ActivityTaskCompletion {
    bytes task_token = 1;
    activity_result.ActivityExecutionResult result = 2;
}

// Info about workflow task slot usage
message WorkflowSlotInfo {
    string workflow_type = 1;
    bool is_sticky = 2;
}

// Info about activity task slot usage
message ActivitySlotInfo {
    string activity_type = 1;
}

// Info about local activity slot usage
message LocalActivitySlotInfo {
    string activity_type = 1;
}

// Info about nexus task slot usage
message NexusSlotInfo {
    string service = 1;
    string operation = 2;
}

// Info about a namespace
message NamespaceInfo {
    // Namespace configured limits
    Limits limits = 1;

    message Limits {
        // Maximum size in bytes for payload fields in workflow history events
        // (e.g., workflow/activity inputs and results, failure details, signal payloads).
        // When exceeded, the server will reject the operation with an error.
        int64 blob_size_limit_error = 1;
        // Maximum total memo size in bytes per workflow execution.
        int64 memo_size_limit_error = 2;
    }
}
