syntax = "proto3";
package devvit.cli;

import "devvit/plugin/logger/logger.proto";

option go_package = "github.snooguts.net/reddit/reddit-devplatform-monorepo/go-common/generated/protos/types/devvit/cli";

// CLI and other clients may be at any version so Protobuf is used to guarantee
// compatibility.

// A message from a client (usually embedded in shreddit) to a server.
message PlaytestProviderMessage {
  oneof message {
    PlaytestCallState call_state = 1;
    PlaytestConnect connect = 2;
  }
}

// A message from a server (usually the Devvit CLI) to a client.
message PlaytestSubscriberMessage {
  oneof message {
    PlaytestAppInstalled app_installed = 1;
  }
}

// Playtest app install notification.
message PlaytestAppInstalled {}

// Runtime.getCallState() reported by BrowserLiteClient.
message PlaytestCallState {
  repeated devvit.plugin.logger.LogMessage logs = 1;
}

// Connection details from BrowserLiteClient sent immediately after opening
// socket.
message PlaytestConnect {
  // The full web address of the client. Eg,
  // https://www.reddit.com/r/pixelary?playtest=pixelary-game and
  // https://www.reddit.com/r/Pixelary/comments/1agoaja/what_is_this/?playtest&foo=bar.
  string url = 1;
}
