import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; import type { IBinaryWriter } from "@protobuf-ts/runtime"; import type { BinaryReadOptions } from "@protobuf-ts/runtime"; import type { IBinaryReader } from "@protobuf-ts/runtime"; import type { PartialMessage } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; import { Duration } from "../../google/protobuf/duration.js"; import { Pid2Binary } from "../repl/repl.js"; import { BuildInfo } from "../repl/repl.js"; import { Feature } from "../features/features.js"; import { ResourceLimits } from "../repl/repl.js"; import { Repl } from "../repl/repl.js"; import { Persistence } from "../repl/repl.js"; import { Timestamp } from "../../google/protobuf/timestamp.js"; /** * ReplToken is the expected client options during the handshake. This is * encoded into the token that is used to connect using WebSocket. * * @generated from protobuf message replit.goval.api.token.ReplToken */ export interface ReplToken { /** * Issue timestamp. Equivalent to JWT's "iat" (Issued At) claim. Tokens with * no `iat` field will be treated as if they had been issed at the UNIX epoch * (1970-01-01T00:00:00Z). * * @generated from protobuf field: google.protobuf.Timestamp iat = 1 */ iat?: Timestamp; /** * Expiration timestamp. Equivalent to JWT's "exp" (Expiration Time) Claim. * If unset, will default to one hour after `iat`. * * @generated from protobuf field: google.protobuf.Timestamp exp = 2 */ exp?: Timestamp; /** * An arbitrary string that helps prevent replay attacks by ensuring that all * tokens are distinct. * * @generated from protobuf field: string salt = 3 */ salt: string; /** * The cluster that a repl is located in. This prevents replay attacks in * which a user is given a token for one cluster and then presents that same * token to a conman instance in another token, which could lead to a case * where multiple containers are associated with a repl. * * Conman therefore needs to validate that this parameter matches the * `-cluster` flag it was started with. * * @generated from protobuf field: string cluster = 4 */ cluster: string; /** * Whether to persist filesystem, metadata, or both. When connecting to an * already running/existing repl, its settings will be updated to match this * mode. * * @generated from protobuf field: replit.goval.api.repl.Persistence persistence = 6 */ persistence: Persistence; /** * One of the three ways to identify a repl in goval. * * @generated from protobuf oneof: metadata */ metadata: { oneofKind: "repl"; /** * This is the standard connection behavior. If the repl doesn't exist it * will be created. Any future connections with a matching ID will go to * the same container. If other metadata mismatches besides ID it will be * rectified (typically by recreating the container to make it match the * provided value). * * @generated from protobuf field: replit.goval.api.repl.Repl repl = 7 */ repl: Repl; } | { oneofKind: "id"; /** * The repl must already be known to goval, the connection will proceed * with the Repl metadata from a previous connection's metadata with the * same ID. * * @generated from protobuf field: replit.goval.api.token.ReplToken.ReplID id = 8 */ id: ReplToken_ReplID; } | { oneofKind: "classroom"; /** * This is DEPRECATED and only used by the classroom. This will never share * a container between connections. Please don't use this even for tests, * we intend to remove it soon. * * @deprecated * @generated from protobuf field: replit.goval.api.token.ReplToken.ClassroomMetadata classroom = 9 [deprecated = true] */ classroom: ReplToken_ClassroomMetadata; } | { oneofKind: undefined; }; /** * The resource limits for the container. Goval 3 does not use this field for * ReplPool/resource-tier selection; token producers should set resource_tier * instead. * * @generated from protobuf field: replit.goval.api.repl.ResourceLimits resourceLimits = 10 */ resourceLimits?: ResourceLimits; /** * The resource limits for the container, when running in interactive mode. * These limits have priority over `resourceLimits` if present, and are never * cached. Goval 3 does not use this field for ReplPool/resource-tier * selection; token producers should set resource_tier instead. * * @generated from protobuf field: replit.goval.api.repl.ResourceLimits interactiveResourceLimits = 17 */ interactiveResourceLimits?: ResourceLimits; /** * @generated from protobuf field: replit.goval.api.token.ReplToken.WireFormat format = 12 */ format: ReplToken_WireFormat; /** * @generated from protobuf field: replit.goval.api.token.ReplToken.Presenced presenced = 13 */ presenced?: ReplToken_Presenced; /** * Flags are handy for passing arbitrary configs along. Mostly used so * the client can try out new features * * @generated from protobuf field: repeated string flags = 14 */ flags: string[]; /** * Features enable certain capabilities that are not enabled by default, * typically because they require specific support for the feature that needs * additional setup. Not every feature can coexist with each other, and * servers should reject acquires that mix features that are incompatible with * each other. Some features also require placement (via PlaceRepl) to have * used a certain subset to acquire a machine that supports the feature. * * @generated from protobuf field: repeated replit.goval.api.features.Feature features = 16 */ features: Feature[]; /** * BuildInfo is present if this is a build repl which is allowed to convert a * repl to a container image and deploy it to Replit's deployment infra. * * @generated from protobuf field: replit.goval.api.repl.BuildInfo build_info = 18 */ buildInfo?: BuildInfo; /** * Pid2Info has metadata about what version of pid2 workspace is requesting. * * @generated from protobuf field: replit.goval.api.repl.Pid2Binary pid2_info = 19 */ pid2Info?: Pid2Binary; /** * Paid tells whether the user is a paid customer. * * @generated from protobuf field: bool paid = 20 */ paid: boolean; /** * Replexec tells whether the user is replexec and should be isolated from * other subclusters. * * @generated from protobuf field: bool replexec = 21 */ replexec: boolean; /** * ExternalSecrets contains the information goval needs to access external * secrets. * * @generated from protobuf field: repeated replit.goval.api.token.ReplToken.ExternalSecret external_secrets = 22 */ externalSecrets: ReplToken_ExternalSecret[]; /** * Before can be used to spawn a fork of the user's repl and use it to fix * filesystem issues (like git being busted) * Only supported for ephemeral / read-only repls. * * @generated from protobuf field: google.protobuf.Timestamp before = 23 */ before?: Timestamp; /** * Resource tier selects the Goval 3 ReplPool/resource shape. Current values * are "free-medium", "paid-medium", and "paid-large". This is only used by * Goval 3. * * @generated from protobuf field: string resource_tier = 25 */ resourceTier: string; /** * Idle timeout override for this repl. * * @generated from protobuf field: optional google.protobuf.Duration idle_timeout = 26 */ idleTimeout?: Duration; } /** * Metadata for the classroom. This is deprecated and should be removed * hopefully soon. * * @generated from protobuf message replit.goval.api.token.ReplToken.ClassroomMetadata */ export interface ReplToken_ClassroomMetadata { /** * @generated from protobuf field: string id = 1 */ id: string; /** * @generated from protobuf field: string language = 2 */ language: string; } /** * Metadata for a repl that is only identified by its id. * * @generated from protobuf message replit.goval.api.token.ReplToken.ReplID */ export interface ReplToken_ReplID { /** * @generated from protobuf field: string id = 1 */ id: string; /** * (Optional) See the comment for Repl.sourceRepl. * * @generated from protobuf field: string sourceRepl = 2 */ sourceRepl: string; } /** * @generated from protobuf message replit.goval.api.token.ReplToken.Presenced */ export interface ReplToken_Presenced { /** * @generated from protobuf field: uint32 bearerID = 1 */ bearerID: number; /** * @generated from protobuf field: string bearerName = 2 */ bearerName: string; } /** * ExternalSecret represents a secret that is not tied to the repl, but should * be available within the repl environment. * * @generated from protobuf message replit.goval.api.token.ReplToken.ExternalSecret */ export interface ReplToken_ExternalSecret { /** * Name of the secret (the environment variable name). * * @generated from protobuf field: string name = 1 */ name: string; /** * Presigned url that goval can use to download the secret value. * * @generated from protobuf field: string presigned_url = 2 */ presignedUrl: string; } /** * allows the client to choose a wire format. * * @generated from protobuf enum replit.goval.api.token.ReplToken.WireFormat */ export declare enum ReplToken_WireFormat { /** * Crosis/pid1 protobuf protocol. * * @generated from protobuf enum value: PROTOBUF = 0; */ PROTOBUF = 0, /** * Legacy protocol. * * @deprecated * @generated from protobuf enum value: JSON = 1 [deprecated = true]; */ JSON = 1, /** * MUXED river and crosis protobuf protocol. * * @deprecated * @generated from protobuf enum value: MUXED = 2 [deprecated = true]; */ MUXED = 2, /** * River/pid2 protocol. * * @generated from protobuf enum value: RIVER = 3; */ RIVER = 3 } declare class ReplToken$Type extends MessageType { constructor(); create(value?: PartialMessage): ReplToken; internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReplToken): ReplToken; internalBinaryWrite(message: ReplToken, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; } /** * @generated MessageType for protobuf message replit.goval.api.token.ReplToken */ export declare const ReplToken: ReplToken$Type; declare class ReplToken_ClassroomMetadata$Type extends MessageType { constructor(); create(value?: PartialMessage): ReplToken_ClassroomMetadata; internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReplToken_ClassroomMetadata): ReplToken_ClassroomMetadata; internalBinaryWrite(message: ReplToken_ClassroomMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; } /** * @generated MessageType for protobuf message replit.goval.api.token.ReplToken.ClassroomMetadata */ export declare const ReplToken_ClassroomMetadata: ReplToken_ClassroomMetadata$Type; declare class ReplToken_ReplID$Type extends MessageType { constructor(); create(value?: PartialMessage): ReplToken_ReplID; internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReplToken_ReplID): ReplToken_ReplID; internalBinaryWrite(message: ReplToken_ReplID, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; } /** * @generated MessageType for protobuf message replit.goval.api.token.ReplToken.ReplID */ export declare const ReplToken_ReplID: ReplToken_ReplID$Type; declare class ReplToken_Presenced$Type extends MessageType { constructor(); create(value?: PartialMessage): ReplToken_Presenced; internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReplToken_Presenced): ReplToken_Presenced; internalBinaryWrite(message: ReplToken_Presenced, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; } /** * @generated MessageType for protobuf message replit.goval.api.token.ReplToken.Presenced */ export declare const ReplToken_Presenced: ReplToken_Presenced$Type; declare class ReplToken_ExternalSecret$Type extends MessageType { constructor(); create(value?: PartialMessage): ReplToken_ExternalSecret; internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReplToken_ExternalSecret): ReplToken_ExternalSecret; internalBinaryWrite(message: ReplToken_ExternalSecret, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; } /** * @generated MessageType for protobuf message replit.goval.api.token.ReplToken.ExternalSecret */ export declare const ReplToken_ExternalSecret: ReplToken_ExternalSecret$Type; export {};