supertag-ai 0.3.13 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{artifact_pb-Btmu7eR8.d.ts → artifact_pb-Qq2K8WvI.d.ts} +40 -3
- package/dist/chunk-AWSZ2ODA.js +93 -0
- package/dist/chunk-AWSZ2ODA.js.map +1 -0
- package/dist/gateway-client.d.ts +8 -1
- package/dist/gateway-client.js +4 -4
- package/dist/gateway-client.js.map +1 -1
- package/dist/harness.d.ts +9 -2
- package/dist/harness.js +3 -3
- package/dist/harness.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-ZNSLSLQT.js +0 -93
- package/dist/chunk-ZNSLSLQT.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/memories_pb.ts","../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/negotiation_pb.ts","../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/placement_pb.ts","../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/workspace_landings_pb.ts","../src/tunnel.ts","../src/gateway-client.ts"],"names":["fileDesc","serviceDesc","tcpConnect","tlsConnect","isIP"],"mappings":";;;;;;;;;;;;AAaO,IAAM,iCAAA,mBACX,QAAA,CAAS,ovDAAA,EAAsvD,CAAC,gCAAgC,CAAC,CAAA;AAqN5xD,IAAM,QAAA,mBAaX,WAAA,CAAY,iCAAA,EAAmC,CAAC,CAAA;ACrO3C,IAAM,oCAAA,mBACXA,QAAAA,CAAS,s1BAAs1B,CAAA;AA8H11B,IAAM,mBAAA,mBAUXC,WAAAA,CAAY,oCAAA,EAAsC,CAAC,CAAA;ACvI9C,IAAM,qDACXD,QAAAA,CAAS,g7IAAA,EAAk7I,CAAC,gCAAgC,CAAC,CAAA;AAwrBx9I,IAAM,WAAA,mBAkEXC,WAAAA,CAAY,kC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AACT,MAAA,OAAA,CAAQ,KAAA,EAAM;AAAA,IAChB;AAAA,GACF;AACF","file":"gateway-client.js","sourcesContent":["// @generated by protoc-gen-es v2.15.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file supertag/runtime/v2/memories.proto (package supertag.runtime.v2, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { BlobReference, NativeMemoryStore, NativeMemoryVolumeHead } from \"./runtime_pb.js\";\nimport { file_supertag_runtime_v2_runtime } from \"./runtime_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file supertag/runtime/v2/memories.proto.\n */\nexport const file_supertag_runtime_v2_memories: GenFile = /*@__PURE__*/\n fileDesc(\"CiJzdXBlcnRhZy9ydW50aW1lL3YyL21lbW9yaWVzLnByb3RvEhNzdXBlcnRhZy5ydW50aW1lLnYyIioKGFJlc2V0TmF0aXZlTWVtb3J5UmVxdWVzdBIOCgZ0YWdfaWQYASABKAkibQoZUmVzZXROYXRpdmVNZW1vcnlSZXNwb25zZRI2CgZzdG9yZXMYASADKAsyJi5zdXBlcnRhZy5ydW50aW1lLnYyLk5hdGl2ZU1lbW9yeVN0b3JlEhgKEHJlc2V0X2dlbmVyYXRpb24YAiABKAQihAEKGVJlcG9ydE5hdGl2ZU1lbW9yeVJlcXVlc3QSEAoIcmV2aXNpb24YAiABKAQSDQoFZmlsZXMYAyABKA0SDQoFYnl0ZXMYBCABKAQSDgoGZGlnZXN0GAUgASgJEhgKEHJlc2V0X2dlbmVyYXRpb24YBiABKARKBAgBEAJSB2F0dGVtcHQiHAoaUmVwb3J0TmF0aXZlTWVtb3J5UmVzcG9uc2Ui6QEKGkFkdmFuY2VOYXRpdmVNZW1vcnlSZXF1ZXN0EhkKEWV4cGVjdGVkX3JldmlzaW9uGAIgASgEEjQKCG1hbmlmZXN0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d2xlZGdlTmF0aXZlTWVtb3J5U2VlZHNSZXF1ZXN0Gjkuc3VwZXJ0YWcucnVudGltZS52Mi5BY2tub3dsZWRnZU5hdGl2ZU1lbW9yeVNlZWRzUmVzcG9uc2ViBnByb3RvMw\", [file_supertag_runtime_v2_runtime]);\n\n/**\n * @generated from message supertag.runtime.v2.ResetNativeMemoryRequest\n */\nexport type ResetNativeMemoryRequest = Message<\"supertag.runtime.v2.ResetNativeMemoryRequest\"> & {\n /**\n * @generated from field: string tag_id = 1;\n */\n tagId: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ResetNativeMemoryRequest.\n * Use `create(ResetNativeMemoryRequestSchema)` to create a new message.\n */\nexport const ResetNativeMemoryRequestSchema: GenMessage<ResetNativeMemoryRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 0);\n\n/**\n * @generated from message supertag.runtime.v2.ResetNativeMemoryResponse\n */\nexport type ResetNativeMemoryResponse = Message<\"supertag.runtime.v2.ResetNativeMemoryResponse\"> & {\n /**\n * The records dropped.\n *\n * @generated from field: repeated supertag.runtime.v2.NativeMemoryStore stores = 1;\n */\n stores: NativeMemoryStore[];\n\n /**\n * @generated from field: uint64 reset_generation = 2;\n */\n resetGeneration: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ResetNativeMemoryResponse.\n * Use `create(ResetNativeMemoryResponseSchema)` to create a new message.\n */\nexport const ResetNativeMemoryResponseSchema: GenMessage<ResetNativeMemoryResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 1);\n\n/**\n * @generated from message supertag.runtime.v2.ReportNativeMemoryRequest\n */\nexport type ReportNativeMemoryRequest = Message<\"supertag.runtime.v2.ReportNativeMemoryRequest\"> & {\n /**\n * Of the store as the host holds it after the turn.\n *\n * @generated from field: uint64 revision = 2;\n */\n revision: bigint;\n\n /**\n * @generated from field: uint32 files = 3;\n */\n files: number;\n\n /**\n * @generated from field: uint64 bytes = 4;\n */\n bytes: bigint;\n\n /**\n * @generated from field: string digest = 5;\n */\n digest: string;\n\n /**\n * The reset generation of the grant the copy was made under.\n *\n * @generated from field: uint64 reset_generation = 6;\n */\n resetGeneration: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ReportNativeMemoryRequest.\n * Use `create(ReportNativeMemoryRequestSchema)` to create a new message.\n */\nexport const ReportNativeMemoryRequestSchema: GenMessage<ReportNativeMemoryRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 2);\n\n/**\n * @generated from message supertag.runtime.v2.ReportNativeMemoryResponse\n */\nexport type ReportNativeMemoryResponse = Message<\"supertag.runtime.v2.ReportNativeMemoryResponse\"> & {\n};\n\n/**\n * Describes the message supertag.runtime.v2.ReportNativeMemoryResponse.\n * Use `create(ReportNativeMemoryResponseSchema)` to create a new message.\n */\nexport const ReportNativeMemoryResponseSchema: GenMessage<ReportNativeMemoryResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 3);\n\n/**\n * @generated from message supertag.runtime.v2.AdvanceNativeMemoryRequest\n */\nexport type AdvanceNativeMemoryRequest = Message<\"supertag.runtime.v2.AdvanceNativeMemoryRequest\"> & {\n /**\n * The head the host merged onto; 0 when the store on the Volume was empty.\n *\n * @generated from field: uint64 expected_revision = 2;\n */\n expectedRevision: bigint;\n\n /**\n * The new manifest, already written to the Volume.\n *\n * @generated from field: supertag.runtime.v2.BlobReference manifest = 3;\n */\n manifest?: BlobReference | undefined;\n\n /**\n * @generated from field: uint32 files = 4;\n */\n files: number;\n\n /**\n * @generated from field: uint64 bytes = 5;\n */\n bytes: bigint;\n\n /**\n * The reset generation of the turn's grant. A store reset since then is not moved.\n *\n * @generated from field: uint64 reset_generation = 6;\n */\n resetGeneration: bigint;\n\n /**\n * Every object the new manifest names, each once. Objects the store no longer names, and the\n * manifest it replaces, are deleted from the Volume.\n *\n * @generated from field: repeated supertag.runtime.v2.BlobReference objects = 7;\n */\n objects: BlobReference[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.AdvanceNativeMemoryRequest.\n * Use `create(AdvanceNativeMemoryRequestSchema)` to create a new message.\n */\nexport const AdvanceNativeMemoryRequestSchema: GenMessage<AdvanceNativeMemoryRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 4);\n\n/**\n * @generated from message supertag.runtime.v2.AdvanceNativeMemoryResponse\n */\nexport type AdvanceNativeMemoryResponse = Message<\"supertag.runtime.v2.AdvanceNativeMemoryResponse\"> & {\n /**\n * Whether the head moved to `manifest`.\n *\n * @generated from field: bool advanced = 1;\n */\n advanced: boolean;\n\n /**\n * The store's head now: the new one, or the one another turn moved it to. Unset while empty.\n *\n * @generated from field: supertag.runtime.v2.NativeMemoryVolumeHead head = 2;\n */\n head?: NativeMemoryVolumeHead | undefined;\n};\n\n/**\n * Describes the message supertag.runtime.v2.AdvanceNativeMemoryResponse.\n * Use `create(AdvanceNativeMemoryResponseSchema)` to create a new message.\n */\nexport const AdvanceNativeMemoryResponseSchema: GenMessage<AdvanceNativeMemoryResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 5);\n\n/**\n * @generated from message supertag.runtime.v2.AcknowledgeNativeMemorySeedsRequest\n */\nexport type AcknowledgeNativeMemorySeedsRequest = Message<\"supertag.runtime.v2.AcknowledgeNativeMemorySeedsRequest\"> & {\n /**\n * The seeds written, by `seed_id`.\n *\n * @generated from field: repeated string seed_ids = 1;\n */\n seedIds: string[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.AcknowledgeNativeMemorySeedsRequest.\n * Use `create(AcknowledgeNativeMemorySeedsRequestSchema)` to create a new message.\n */\nexport const AcknowledgeNativeMemorySeedsRequestSchema: GenMessage<AcknowledgeNativeMemorySeedsRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 6);\n\n/**\n * @generated from message supertag.runtime.v2.AcknowledgeNativeMemorySeedsResponse\n */\nexport type AcknowledgeNativeMemorySeedsResponse = Message<\"supertag.runtime.v2.AcknowledgeNativeMemorySeedsResponse\"> & {\n};\n\n/**\n * Describes the message supertag.runtime.v2.AcknowledgeNativeMemorySeedsResponse.\n * Use `create(AcknowledgeNativeMemorySeedsResponseSchema)` to create a new message.\n */\nexport const AcknowledgeNativeMemorySeedsResponseSchema: GenMessage<AcknowledgeNativeMemorySeedsResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 7);\n\n/**\n * A Tag's memory is its harness's own memory, such as Claude Code's auto-memory or Codex's\n * memories folder. Worker Hosts keep the files (NativeMemoryStore); the Control Plane never holds\n * them, and people read and delete them on the Worker Host's machine.\n *\n * @generated from service supertag.runtime.v2.Memories\n */\nexport const Memories: GenService<{\n /**\n * Operators only. Drops a Tag's harness-native memory (NativeMemoryStore): every Worker Host\n * deletes its copies before it next runs one of the Tag's Tasks, and the records go now.\n *\n * @generated from rpc supertag.runtime.v2.Memories.ResetNative\n */\n resetNative: {\n methodKind: \"unary\";\n input: typeof ResetNativeMemoryRequestSchema;\n output: typeof ResetNativeMemoryResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_memories, 0);\n\n/**\n * Called by a Worker Host for the turn it runs.\n *\n * @generated from service supertag.runtime.v2.AttemptMemory\n */\nexport const AttemptMemory: GenService<{\n /**\n * After a turn's harness stops, its Worker Host records what it now holds of the store the\n * turn was granted (Assignment.native_memory). Never file contents.\n *\n * @generated from rpc supertag.runtime.v2.AttemptMemory.ReportNative\n */\n reportNative: {\n methodKind: \"unary\";\n input: typeof ReportNativeMemoryRequestSchema;\n output: typeof ReportNativeMemoryResponseSchema;\n },\n /**\n * Moves the turn's store on its Tag's Volume to a new manifest the host has written, when the\n * store is still at `expected_revision`; otherwise it changes nothing and returns the current\n * head, so the host merges again.\n *\n * @generated from rpc supertag.runtime.v2.AttemptMemory.AdvanceNative\n */\n advanceNative: {\n methodKind: \"unary\";\n input: typeof AdvanceNativeMemoryRequestSchema;\n output: typeof AdvanceNativeMemoryResponseSchema;\n },\n /**\n * The host has written the grant's seeds (NativeMemoryGrant.seeds) into the turn's store; the\n * Control Plane drops them and grants them to no later turn.\n *\n * @generated from rpc supertag.runtime.v2.AttemptMemory.AcknowledgeSeeds\n */\n acknowledgeSeeds: {\n methodKind: \"unary\";\n input: typeof AcknowledgeNativeMemorySeedsRequestSchema;\n output: typeof AcknowledgeNativeMemorySeedsResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_memories, 1);\n","// @generated by protoc-gen-es v2.15.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file supertag/runtime/v2/negotiation.proto (package supertag.runtime.v2, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file supertag/runtime/v2/negotiation.proto.\n */\nexport const file_supertag_runtime_v2_negotiation: GenFile = /*@__PURE__*/\n fileDesc(\"CiVzdXBlcnRhZy9ydW50aW1lL3YyL25lZ290aWF0aW9uLnByb3RvEhNzdXBlcnRhZy5ydW50aW1lLnYyInwKGE5lZ290aWF0ZVByb3RvY29sUmVxdWVzdBIuCgRyb2xlGAEgASgOMiAuc3VwZXJ0YWcucnVudGltZS52Mi5TZXJ2aWNlUm9sZRIZChFwcm90b2NvbF92ZXJzaW9ucxgCIAMoDRIVCg1idWlsZF92ZXJzaW9uGAMgASgJIpcBChlOZWdvdGlhdGVQcm90b2NvbFJlc3BvbnNlEi4KBHJvbGUYASABKA4yIC5zdXBlcnRhZy5ydW50aW1lLnYyLlNlcnZpY2VSb2xlEhgKEHByb3RvY29sX3ZlcnNpb24YAiABKA0SGQoRcHJvdG9jb2xfdmVyc2lvbnMYAyADKA0SFQoNYnVpbGRfdmVyc2lvbhgEIAEoCSqcAQoLU2VydmljZVJvbGUSHAoYU0VSVklDRV9ST0xFX1VOU1BFQ0lGSUVEEAASHgoaU0VSVklDRV9ST0xFX0NPTlRST0xfUExBTkUQARIYChRTRVJWSUNFX1JPTEVfR0FURVdBWRACEhwKGFNFUlZJQ0VfUk9MRV9XT1JLRVJfSE9TVBADEhcKE1NFUlZJQ0VfUk9MRV9DTElFTlQQBDKBAQoTUHJvdG9jb2xOZWdvdGlhdGlvbhJqCglOZWdvdGlhdGUSLS5zdXBlcnRhZy5ydW50aW1lLnYyLk5lZ290aWF0ZVByb3RvY29sUmVxdWVzdBouLnN1cGVydGFnLnJ1bnRpbWUudjIuTmVnb3RpYXRlUHJvdG9jb2xSZXNwb25zZWIGcHJvdG8z\");\n\n/**\n * @generated from message supertag.runtime.v2.NegotiateProtocolRequest\n */\nexport type NegotiateProtocolRequest = Message<\"supertag.runtime.v2.NegotiateProtocolRequest\"> & {\n /**\n * The connecting service's role.\n *\n * @generated from field: supertag.runtime.v2.ServiceRole role = 1;\n */\n role: ServiceRole;\n\n /**\n * Every protocol version the connecting service can speak.\n *\n * @generated from field: repeated uint32 protocol_versions = 2;\n */\n protocolVersions: number[];\n\n /**\n * The connecting service's release, for diagnostics only.\n *\n * @generated from field: string build_version = 3;\n */\n buildVersion: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.NegotiateProtocolRequest.\n * Use `create(NegotiateProtocolRequestSchema)` to create a new message.\n */\nexport const NegotiateProtocolRequestSchema: GenMessage<NegotiateProtocolRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_negotiation, 0);\n\n/**\n * @generated from message supertag.runtime.v2.NegotiateProtocolResponse\n */\nexport type NegotiateProtocolResponse = Message<\"supertag.runtime.v2.NegotiateProtocolResponse\"> & {\n /**\n * The answering service's role.\n *\n * @generated from field: supertag.runtime.v2.ServiceRole role = 1;\n */\n role: ServiceRole;\n\n /**\n * The highest protocol version both services speak.\n *\n * @generated from field: uint32 protocol_version = 2;\n */\n protocolVersion: number;\n\n /**\n * Every protocol version the answering service can speak.\n *\n * @generated from field: repeated uint32 protocol_versions = 3;\n */\n protocolVersions: number[];\n\n /**\n * @generated from field: string build_version = 4;\n */\n buildVersion: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.NegotiateProtocolResponse.\n * Use `create(NegotiateProtocolResponseSchema)` to create a new message.\n */\nexport const NegotiateProtocolResponseSchema: GenMessage<NegotiateProtocolResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_negotiation, 1);\n\n/**\n * @generated from enum supertag.runtime.v2.ServiceRole\n */\nexport enum ServiceRole {\n /**\n * @generated from enum value: SERVICE_ROLE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: SERVICE_ROLE_CONTROL_PLANE = 1;\n */\n CONTROL_PLANE = 1,\n\n /**\n * @generated from enum value: SERVICE_ROLE_GATEWAY = 2;\n */\n GATEWAY = 2,\n\n /**\n * @generated from enum value: SERVICE_ROLE_WORKER_HOST = 3;\n */\n WORKER_HOST = 3,\n\n /**\n * A client of the Control Plane's API: the CLI, the desktop app, or\n * an SDK client, acting for an operator or an enrolled client.\n *\n * @generated from enum value: SERVICE_ROLE_CLIENT = 4;\n */\n CLIENT = 4,\n}\n\n/**\n * Describes the enum supertag.runtime.v2.ServiceRole.\n */\nexport const ServiceRoleSchema: GenEnum<ServiceRole> = /*@__PURE__*/\n enumDesc(file_supertag_runtime_v2_negotiation, 0);\n\n/**\n * Each service and operator connection begins with this exchange. A peer that\n * shares no protocol version, or that connects in the wrong role, is refused\n * before it can register, claim, forward work, or make an operator call. The\n * exchange carries no credentials.\n *\n * After negotiating, the client sends the selected version in the\n * `x-supertag-protocol` metadata header on every other call. The Control Plane\n * and Gateway refuse a call without it, or naming a version they do not\n * speak, with FAILED_PRECONDITION. Only this service and the standard gRPC\n * health service are exempt.\n *\n * @generated from service supertag.runtime.v2.ProtocolNegotiation\n */\nexport const ProtocolNegotiation: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.ProtocolNegotiation.Negotiate\n */\n negotiate: {\n methodKind: \"unary\";\n input: typeof NegotiateProtocolRequestSchema;\n output: typeof NegotiateProtocolResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_negotiation, 0);\n","// @generated by protoc-gen-es v2.15.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file supertag/runtime/v2/placement.proto (package supertag.runtime.v2, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { AuthKey, AuthKeySchema, HostPhase, PrincipalRole, TagSchema, TaskState } from \"./runtime_pb.js\";\nimport { file_supertag_runtime_v2_runtime } from \"./runtime_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file supertag/runtime/v2/placement.proto.\n */\nexport const file_supertag_runtime_v2_placement: GenFile = /*@__PURE__*/\n fileDesc(\"CiNzdXBlcnRhZy9ydW50aW1lL3YyL3BsYWNlbWVudC5wcm90bxITc3VwZXJ0YWcucnVudGltZS52MiIkChRSZXZva2VBdXRoS2V5UmVxdWVzdBIMCgRuYW1lGAEgASgJIiEKEUdldEF1dGhLZXlSZXF1ZXN0EgwKBG5hbWUYASABKAkiNAoTTGlzdEF1dGhLZXlzUmVxdWVzdBINCgVsaW1pdBgBIAEoDRIOCgZjdXJzb3IYAiABKAkiXAoUTGlzdEF1dGhLZXlzUmVzcG9uc2USLwoJYXV0aF9rZXlzGAEgAygLMhwuc3VwZXJ0YWcucnVudGltZS52Mi5BdXRoS2V5EhMKC25leHRfY3Vyc29yGAIgASgJInsKDUVucm9sbFJlcXVlc3QSMAoEcm9sZRgBIAEoDjIiLnN1cGVydGFnLnJ1bnRpbWUudjIuUHJpbmNpcGFsUm9sZRIMCgRuYW1lGAIgASgJEhQKDG9wZXJhdGlvbl9pZBgDIAEoCRIUCgx0b2tlbl9kaWdlc3QYBCABKAwitgIKCkV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GFnLnJ1bnRpbWUudjIuV2hvQW1JUmVzcG9uc2USaQoQUm90YXRlQ3JlZGVudGlhbBIsLnN1cGVydGFnLnJ1bnRpbWUudjIuUm90YXRlQ3JlZGVudGlhbFJlcXVlc3QaJy5zdXBlcnRhZy5ydW50aW1lLnYyLkNyZWRlbnRpYWxSb3RhdGlvbhJbCg1HZXRFbnJvbGxtZW50Eikuc3VwZXJ0YWcucnVudGltZS52Mi5HZXRFbnJvbGxtZW50UmVxdWVzdBofLnN1cGVydGFnLnJ1bnRpbWUudjIuRW5yb2xsbWVudBJsCg9MaXN0RW5yb2xsbWVudHMSKy5zdXBlcnRhZy5ydW50aW1lLnYyLkxpc3RFbnJvbGxtZW50c1JlcXVlc3QaLC5zdXBlcnRhZy5ydW50aW1lLnYyLkxpc3RFbnJvbGxtZW50c1Jlc3BvbnNlEmEKEFJldm9rZUVucm9sbG1lbnQSLC5zdXBlcnRhZy5ydW50aW1lLnYyLlJldm9rZUVucm9sbG1lbnRSZXF1ZXN0Gh8uc3VwZXJ0YWcucnVudGltZS52Mi5FbnJvbGxtZW50MngKE0NyZWRlbnRpYWxEaXJlY3RvcnkSYQoHUmVzb2x2ZRItLnN1cGVydGFnLnJ1bnRpbWUudjIuUmVzb2x2ZUNyZWRlbnRpYWxSZXF1ZXN0Gicuc3VwZXJ0YWcucnVudGltZS52Mi5SZXNvbHZlZENyZWRlbnRpYWxiBnByb3RvMw\", [file_supertag_runtime_v2_runtime]);\n\n/**\n * @generated from message supertag.runtime.v2.RevokeAuthKeyRequest\n */\nexport type RevokeAuthKeyRequest = Message<\"supertag.runtime.v2.RevokeAuthKeyRequest\"> & {\n /**\n * @generated from field: string name = 1;\n */\n name: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.RevokeAuthKeyRequest.\n * Use `create(RevokeAuthKeyRequestSchema)` to create a new message.\n */\nexport const RevokeAuthKeyRequestSchema: GenMessage<RevokeAuthKeyRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 0);\n\n/**\n * @generated from message supertag.runtime.v2.GetAuthKeyRequest\n */\nexport type GetAuthKeyRequest = Message<\"supertag.runtime.v2.GetAuthKeyRequest\"> & {\n /**\n * @generated from field: string name = 1;\n */\n name: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.GetAuthKeyRequest.\n * Use `create(GetAuthKeyRequestSchema)` to create a new message.\n */\nexport const GetAuthKeyRequestSchema: GenMessage<GetAuthKeyRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 1);\n\n/**\n * @generated from message supertag.runtime.v2.ListAuthKeysRequest\n */\nexport type ListAuthKeysRequest = Message<\"supertag.runtime.v2.ListAuthKeysRequest\"> & {\n /**\n * At most this many keys; 0 means 100. At most 500.\n *\n * @generated from field: uint32 limit = 1;\n */\n limit: number;\n\n /**\n * The name of the last key on the previous page.\n *\n * @generated from field: string cursor = 2;\n */\n cursor: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListAuthKeysRequest.\n * Use `create(ListAuthKeysRequestSchema)` to create a new message.\n */\nexport const ListAuthKeysRequestSchema: GenMessage<ListAuthKeysRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 2);\n\n/**\n * @generated from message supertag.runtime.v2.ListAuthKeysResponse\n */\nexport type ListAuthKeysResponse = Message<\"supertag.runtime.v2.ListAuthKeysResponse\"> & {\n /**\n * @generated from field: repeated supertag.runtime.v2.AuthKey auth_keys = 1;\n */\n authKeys: AuthKey[];\n\n /**\n * @generated from field: string next_cursor = 2;\n */\n nextCursor: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListAuthKeysResponse.\n * Use `create(ListAuthKeysResponseSchema)` to create a new message.\n */\nexport const ListAuthKeysResponseSchema: GenMessage<ListAuthKeysResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 3);\n\n/**\n * @generated from message supertag.runtime.v2.EnrollRequest\n */\nexport type EnrollRequest = Message<\"supertag.runtime.v2.EnrollRequest\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * 1 to 250 ASCII letters, digits, hyphens, underscores or dots. The\n * enrollee chooses it; the Auth Key does not fix it.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * @generated from field: string operation_id = 3;\n */\n operationId: string;\n\n /**\n * SHA-256 of the new `stcr_` credential.\n *\n * @generated from field: bytes token_digest = 4;\n */\n tokenDigest: Uint8Array;\n};\n\n/**\n * Describes the message supertag.runtime.v2.EnrollRequest.\n * Use `create(EnrollRequestSchema)` to create a new message.\n */\nexport const EnrollRequestSchema: GenMessage<EnrollRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 4);\n\n/**\n * @generated from message supertag.runtime.v2.Enrollment\n */\nexport type Enrollment = Message<\"supertag.runtime.v2.Enrollment\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * `host:NAME`, `gateway:NAME` or `client:NAME`.\n *\n * @generated from field: string principal = 3;\n */\n principal: string;\n\n /**\n * The Auth Key it enrolled with. Empty for a credential set in the Control\n * Plane's startup configuration.\n *\n * @generated from field: string auth_key_name = 4;\n */\n authKeyName: string;\n\n /**\n * @generated from field: int64 enrolled_at_ms = 5;\n */\n enrolledAtMs: bigint;\n\n /**\n * Refreshed at most once a minute.\n *\n * @generated from field: optional int64 last_used_at_ms = 6;\n */\n lastUsedAtMs?: bigint | undefined;\n\n /**\n * @generated from field: optional int64 revoked_at_ms = 7;\n */\n revokedAtMs?: bigint | undefined;\n\n /**\n * 1 for the first credential; increases with each rotation.\n *\n * @generated from field: uint64 credential_revision = 8;\n */\n credentialRevision: bigint;\n\n /**\n * Clients: the Tags it may talk to. Hosts: the Tags it may run.\n *\n * @generated from field: repeated string allowed_tag_ids = 9;\n */\n allowedTagIds: string[];\n\n /**\n * Every Tag. A Gateway with it serves connector accounts no Surface Account\n * names and delivers the admin operator's notifications.\n *\n * @generated from field: bool all_tags = 10;\n */\n allTags: boolean;\n};\n\n/**\n * Describes the message supertag.runtime.v2.Enrollment.\n * Use `create(EnrollmentSchema)` to create a new message.\n */\nexport const EnrollmentSchema: GenMessage<Enrollment> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 5);\n\n/**\n * @generated from message supertag.runtime.v2.WhoAmIRequest\n */\nexport type WhoAmIRequest = Message<\"supertag.runtime.v2.WhoAmIRequest\"> & {\n};\n\n/**\n * Describes the message supertag.runtime.v2.WhoAmIRequest.\n * Use `create(WhoAmIRequestSchema)` to create a new message.\n */\nexport const WhoAmIRequestSchema: GenMessage<WhoAmIRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 6);\n\n/**\n * @generated from message supertag.runtime.v2.WhoAmIResponse\n */\nexport type WhoAmIResponse = Message<\"supertag.runtime.v2.WhoAmIResponse\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * Such as `operator:local`, `operator:token:laptop` or `client:alice-laptop`.\n *\n * @generated from field: string principal = 2;\n */\n principal: string;\n\n /**\n * The admin operator, the only one that manages Operator Tokens.\n *\n * @generated from field: bool admin = 3;\n */\n admin: boolean;\n};\n\n/**\n * Describes the message supertag.runtime.v2.WhoAmIResponse.\n * Use `create(WhoAmIResponseSchema)` to create a new message.\n */\nexport const WhoAmIResponseSchema: GenMessage<WhoAmIResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 7);\n\n/**\n * @generated from message supertag.runtime.v2.RotateCredentialRequest\n */\nexport type RotateCredentialRequest = Message<\"supertag.runtime.v2.RotateCredentialRequest\"> & {\n /**\n * With an empty name, the caller's own credential; the role must then be the\n * caller's. Only operators name another enrollee.\n *\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * The current credential_revision. A repeat of a rotation that already\n * applied, with the same digest, returns the same result.\n *\n * @generated from field: uint64 expected_credential_revision = 3;\n */\n expectedCredentialRevision: bigint;\n\n /**\n * @generated from field: bytes token_digest = 4;\n */\n tokenDigest: Uint8Array;\n};\n\n/**\n * Describes the message supertag.runtime.v2.RotateCredentialRequest.\n * Use `create(RotateCredentialRequestSchema)` to create a new message.\n */\nexport const RotateCredentialRequestSchema: GenMessage<RotateCredentialRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 8);\n\n/**\n * @generated from message supertag.runtime.v2.CredentialRotation\n */\nexport type CredentialRotation = Message<\"supertag.runtime.v2.CredentialRotation\"> & {\n /**\n * @generated from field: string principal = 1;\n */\n principal: string;\n\n /**\n * @generated from field: uint64 credential_revision = 2;\n */\n credentialRevision: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.CredentialRotation.\n * Use `create(CredentialRotationSchema)` to create a new message.\n */\nexport const CredentialRotationSchema: GenMessage<CredentialRotation> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 9);\n\n/**\n * @generated from message supertag.runtime.v2.GetEnrollmentRequest\n */\nexport type GetEnrollmentRequest = Message<\"supertag.runtime.v2.GetEnrollmentRequest\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.GetEnrollmentRequest.\n * Use `create(GetEnrollmentRequestSchema)` to create a new message.\n */\nexport const GetEnrollmentRequestSchema: GenMessage<GetEnrollmentRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 10);\n\n/**\n * @generated from message supertag.runtime.v2.ListEnrollmentsRequest\n */\nexport type ListEnrollmentsRequest = Message<\"supertag.runtime.v2.ListEnrollmentsRequest\"> & {\n /**\n * UNSPECIFIED lists every role.\n *\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * 0 means 100; at most 500.\n *\n * @generated from field: uint32 limit = 2;\n */\n limit: number;\n\n /**\n * The `next_cursor` of the previous page.\n *\n * @generated from field: string cursor = 3;\n */\n cursor: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListEnrollmentsRequest.\n * Use `create(ListEnrollmentsRequestSchema)` to create a new message.\n */\nexport const ListEnrollmentsRequestSchema: GenMessage<ListEnrollmentsRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 11);\n\n/**\n * @generated from message supertag.runtime.v2.ListEnrollmentsResponse\n */\nexport type ListEnrollmentsResponse = Message<\"supertag.runtime.v2.ListEnrollmentsResponse\"> & {\n /**\n * @generated from field: repeated supertag.runtime.v2.Enrollment enrollments = 1;\n */\n enrollments: Enrollment[];\n\n /**\n * @generated from field: string next_cursor = 2;\n */\n nextCursor: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListEnrollmentsResponse.\n * Use `create(ListEnrollmentsResponseSchema)` to create a new message.\n */\nexport const ListEnrollmentsResponseSchema: GenMessage<ListEnrollmentsResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 12);\n\n/**\n * @generated from message supertag.runtime.v2.RevokeEnrollmentRequest\n */\nexport type RevokeEnrollmentRequest = Message<\"supertag.runtime.v2.RevokeEnrollmentRequest\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.RevokeEnrollmentRequest.\n * Use `create(RevokeEnrollmentRequestSchema)` to create a new message.\n */\nexport const RevokeEnrollmentRequestSchema: GenMessage<RevokeEnrollmentRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 13);\n\n/**\n * @generated from message supertag.runtime.v2.ResolveCredentialRequest\n */\nexport type ResolveCredentialRequest = Message<\"supertag.runtime.v2.ResolveCredentialRequest\"> & {\n /**\n * SHA-256 of the presented secret.\n *\n * @generated from field: bytes token_digest = 1;\n */\n tokenDigest: Uint8Array;\n\n /**\n * OPERATOR for an Operator Token; HOST, GATEWAY or CLIENT is never sent:\n * UNSPECIFIED resolves an enrolled credential of any role.\n *\n * @generated from field: supertag.runtime.v2.PrincipalRole kind = 2;\n */\n kind: PrincipalRole;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ResolveCredentialRequest.\n * Use `create(ResolveCredentialRequestSchema)` to create a new message.\n */\nexport const ResolveCredentialRequestSchema: GenMessage<ResolveCredentialRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 14);\n\n/**\n * @generated from message supertag.runtime.v2.ResolvedCredential\n */\nexport type ResolvedCredential = Message<\"supertag.runtime.v2.ResolvedCredential\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * The name within the role: `token:NAME` for an Operator Token.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * Hosts: the current registration generation.\n *\n * @generated from field: uint64 generation = 3;\n */\n generation: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ResolvedCredential.\n * Use `create(ResolvedCredentialSchema)` to create a new message.\n */\nexport const ResolvedCredentialSchema: GenMessage<ResolvedCredential> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 15);\n\n/**\n * @generated from message supertag.runtime.v2.SetTagRunsOnRequest\n */\nexport type SetTagRunsOnRequest = Message<\"supertag.runtime.v2.SetTagRunsOnRequest\"> & {\n /**\n * @generated from field: string tag_id = 1;\n */\n tagId: string;\n\n /**\n * @generated from field: repeated string runs_on = 2;\n */\n runsOn: string[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.SetTagRunsOnRequest.\n * Use `create(SetTagRunsOnRequestSchema)` to create a new message.\n */\nexport const SetTagRunsOnRequestSchema: GenMessage<SetTagRunsOnRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 16);\n\n/**\n * @generated from message supertag.runtime.v2.DiagnoseTaskPlacementRequest\n */\nexport type DiagnoseTaskPlacementRequest = Message<\"supertag.runtime.v2.DiagnoseTaskPlacementRequest\"> & {\n /**\n * @generated from field: string task_id = 1;\n */\n taskId: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.DiagnoseTaskPlacementRequest.\n * Use `create(DiagnoseTaskPlacementRequestSchema)` to create a new message.\n */\nexport const DiagnoseTaskPlacementRequestSchema: GenMessage<DiagnoseTaskPlacementRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 17);\n\n/**\n * @generated from message supertag.runtime.v2.HostPlacement\n */\nexport type HostPlacement = Message<\"supertag.runtime.v2.HostPlacement\"> & {\n /**\n * @generated from field: string host_id = 1;\n */\n hostId: string;\n\n /**\n * @generated from field: supertag.runtime.v2.HostPhase phase = 2;\n */\n phase: HostPhase;\n\n /**\n * @generated from field: repeated string labels = 3;\n */\n labels: string[];\n\n /**\n * Required labels this host does not carry.\n *\n * @generated from field: repeated string missing_labels = 4;\n */\n missingLabels: string[];\n\n /**\n * Carries every required label. Readiness, capacity and harness still apply.\n *\n * @generated from field: bool eligible = 5;\n */\n eligible: boolean;\n\n /**\n * What keeps this host's lanes for the Task's harness from running it, such as file-scope or\n * unsandboxed-commands, or harness when it runs no such lane. Empty when a lane can.\n *\n * @generated from field: string requirement = 6;\n */\n requirement: string;\n\n /**\n * A readable explanation, or empty when requirement is empty.\n *\n * @generated from field: string reason = 7;\n */\n reason: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.HostPlacement.\n * Use `create(HostPlacementSchema)` to create a new message.\n */\nexport const HostPlacementSchema: GenMessage<HostPlacement> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 18);\n\n/**\n * @generated from message supertag.runtime.v2.TaskPlacementDiagnosis\n */\nexport type TaskPlacementDiagnosis = Message<\"supertag.runtime.v2.TaskPlacementDiagnosis\"> & {\n /**\n * @generated from field: string task_id = 1;\n */\n taskId: string;\n\n /**\n * @generated from field: string tag_id = 2;\n */\n tagId: string;\n\n /**\n * @generated from field: supertag.runtime.v2.TaskState state = 3;\n */\n state: TaskState;\n\n /**\n * The Tag's runsOn, plus workspace:NAME for a Task in a Workspace.\n *\n * @generated from field: repeated string required_labels = 4;\n */\n requiredLabels: string[];\n\n /**\n * Labels no bound host carries; every required label when each exists on\n * some bound host but none carries them all.\n *\n * @generated from field: repeated string missing_labels = 5;\n */\n missingLabels: string[];\n\n /**\n * A scheduling requirement such as labels:macos,gpu. execution-limits,\n * runtime-actions, or context when the Task's harness cannot enforce its\n * accepted limits or actions, or load its required Skills.\n * Empty when nothing found keeps a bound host from taking the Task.\n *\n * @generated from field: string requirement = 6;\n */\n requirement: string;\n\n /**\n * A readable explanation, or empty when requirement is empty.\n *\n * @generated from field: string summary = 7;\n */\n summary: string;\n\n /**\n * Bound, unrevoked Worker Hosts in host ID order.\n *\n * @generated from field: repeated supertag.runtime.v2.HostPlacement hosts = 8;\n */\n hosts: HostPlacement[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.TaskPlacementDiagnosis.\n * Use `create(TaskPlacementDiagnosisSchema)` to create a new message.\n */\nexport const TaskPlacementDiagnosisSchema: GenMessage<TaskPlacementDiagnosis> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 19);\n\n/**\n * Worker Host placement. Labels narrow the hosts bound to a Tag; they never\n * grant access, and a Task that no bound host can take waits.\n *\n * @generated from service supertag.runtime.v2.Placement\n */\nexport const Placement: GenService<{\n /**\n * Replaces a Tag's runsOn labels. An empty list means any bound host.\n *\n * @generated from rpc supertag.runtime.v2.Placement.SetTagRunsOn\n */\n setTagRunsOn: {\n methodKind: \"unary\";\n input: typeof SetTagRunsOnRequestSchema;\n output: typeof TagSchema;\n },\n /**\n * Explains which bound Worker Hosts can take a Task, and why the others cannot.\n *\n * @generated from rpc supertag.runtime.v2.Placement.DiagnoseTask\n */\n diagnoseTask: {\n methodKind: \"unary\";\n input: typeof DiagnoseTaskPlacementRequestSchema;\n output: typeof TaskPlacementDiagnosisSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_placement, 0);\n\n/**\n * Auth Key lifecycle beyond creation. Keys are named by the operator, and a\n * name is never reused. Revocation blocks new joins, including replays of\n * earlier joins; principals that already joined keep their enrollment.\n *\n * @generated from service supertag.runtime.v2.AuthKeys\n */\nexport const AuthKeys: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.AuthKeys.RevokeAuthKey\n */\n revokeAuthKey: {\n methodKind: \"unary\";\n input: typeof RevokeAuthKeyRequestSchema;\n output: typeof AuthKeySchema;\n },\n /**\n * Revoked, expired and used keys included, the earliest created first, then by name.\n *\n * @generated from rpc supertag.runtime.v2.AuthKeys.ListAuthKeys\n */\n listAuthKeys: {\n methodKind: \"unary\";\n input: typeof ListAuthKeysRequestSchema;\n output: typeof ListAuthKeysResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.AuthKeys.GetAuthKey\n */\n getAuthKey: {\n methodKind: \"unary\";\n input: typeof GetAuthKeyRequestSchema;\n output: typeof AuthKeySchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_placement, 1);\n\n/**\n * Joining a deployment, and the credentials joining issues. A host, Gateway or\n * client enrolls once with an Auth Key of its role and from then on presents\n * its own credential, `stcr_` and 64 hex digits, as the bearer. Only the\n * credential's SHA-256 digest is stored; the enrollee generates the secret, so\n * the Control Plane never receives it. Principals are `host:NAME`,\n * `gateway:NAME` and `client:NAME`; names are never reused within a role.\n *\n * @generated from service supertag.runtime.v2.Enrollments\n */\nexport const Enrollments: GenService<{\n /**\n * Presented with an Auth Key (`stak_` and 64 hex digits) as the bearer: the\n * only call that accepts one. The request's role must equal the key's.\n * Repeating an enrollment with the same operation ID, name and digest returns\n * the same enrollment, until the key is revoked.\n *\n * @generated from rpc supertag.runtime.v2.Enrollments.Enroll\n */\n enroll: {\n methodKind: \"unary\";\n input: typeof EnrollRequestSchema;\n output: typeof EnrollmentSchema;\n },\n /**\n * The caller's own principal.\n *\n * @generated from rpc supertag.runtime.v2.Enrollments.WhoAmI\n */\n whoAmI: {\n methodKind: \"unary\";\n input: typeof WhoAmIRequestSchema;\n output: typeof WhoAmIResponseSchema;\n },\n /**\n * Replaces an enrolled credential. An enrollee rotates its own (empty name);\n * an operator rotates any. The previous credential stops working at once,\n * including for open streams.\n *\n * @generated from rpc supertag.runtime.v2.Enrollments.RotateCredential\n */\n rotateCredential: {\n methodKind: \"unary\";\n input: typeof RotateCredentialRequestSchema;\n output: typeof CredentialRotationSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.Enrollments.GetEnrollment\n */\n getEnrollment: {\n methodKind: \"unary\";\n input: typeof GetEnrollmentRequestSchema;\n output: typeof EnrollmentSchema;\n },\n /**\n * By role, then name.\n *\n * @generated from rpc supertag.runtime.v2.Enrollments.ListEnrollments\n */\n listEnrollments: {\n methodKind: \"unary\";\n input: typeof ListEnrollmentsRequestSchema;\n output: typeof ListEnrollmentsResponseSchema;\n },\n /**\n * Idempotent. The credential is refused from then on, including by calls and\n * streams already in progress. Revoking a host also fences its execution.\n *\n * @generated from rpc supertag.runtime.v2.Enrollments.RevokeEnrollment\n */\n revokeEnrollment: {\n methodKind: \"unary\";\n input: typeof RevokeEnrollmentRequestSchema;\n output: typeof EnrollmentSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_placement, 2);\n\n/**\n * Internal to the Control Plane: its API tier resolves the digest of a\n * presented Operator Token or enrolled credential with the state owner.\n *\n * @generated from service supertag.runtime.v2.CredentialDirectory\n */\nexport const CredentialDirectory: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.CredentialDirectory.Resolve\n */\n resolve: {\n methodKind: \"unary\";\n input: typeof ResolveCredentialRequestSchema;\n output: typeof ResolvedCredentialSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_placement, 3);\n","// @generated by protoc-gen-es v2.15.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file supertag/runtime/v2/workspace_landings.proto (package supertag.runtime.v2, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { BlobHolder, TaskSchema, WorkspaceDeliveryReference } from \"./runtime_pb.js\";\nimport { file_supertag_runtime_v2_runtime } from \"./runtime_pb.js\";\nimport type { Workspace } from \"./workspaces_pb.js\";\nimport { file_supertag_runtime_v2_workspaces } from \"./workspaces_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file supertag/runtime/v2/workspace_landings.proto.\n */\nexport const file_supertag_runtime_v2_workspace_landings: GenFile = /*@__PURE__*/\n fileDesc(\"CixzdXBlcnRhZy9ydW50aW1lL3YyL3dvcmtzcGFjZV9sYW5kaW5ncy5wcm90bxITc3VwZXJ0YWcucnVudGltZS52MiKSBQoQV29ya3NwYWNlTGFuZGluZxISCgpsYW5kaW5nX2lkGAEgASgJEg8KB3Rhc2tfaWQYAiABKAkSDgoGdGFnX2lkGAMgASgJEhIKCnNlc3Npb25faWQYBCABKAkSFAoMd29ya3NwYWNlX2lkGAUgASgJEg4KBnJlbW90ZRgGIAEoCRI3CgRtb2RlGAcgASgOMikuc3VwZXJ0YWcucnVudGltZS52Mi5Xb3Jrc3BhY2VMYW5kaW5nTW9kZRIOCgZicmFuY2gYCCABKAkSDgoGdGFyZ2V0GAkgASgJEkEKCGRlbGl2ZXJ5GAogASgLMi8uc3VwZXJ0YWcucnVudGltZS52Mi5Xb3Jrc3BhY2VEZWxpdmVyeVJlZmVyZW5jZRI5CgVzdGF0ZRgLIAEoDjIqLnN1cGVydGFnLnJ1bnRpbWUudjIuV29ya3NwYWNlTGFuZGluZ1N0YXRlEg4KBnJl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udjIuQ2xhaW1Xb3Jrc3BhY2VMYW5kaW5nUmVzcG9uc2USYwoGUmVjb3JkEjIuc3VwZXJ0YWcucnVudGltZS52Mi5SZWNvcmRXb3Jrc3BhY2VMYW5kaW5nUmVxdWVzdBolLnN1cGVydGFnLnJ1bnRpbWUudjIuV29ya3NwYWNlTGFuZGluZxJ5Cg5MaXN0VW52ZXJpZmllZBIyLnN1cGVydGFnLnJ1bnRpbWUudjIuTGlzdFVudmVyaWZpZWRMYW5kaW5nc1JlcXVlc3QaMy5zdXBlcnRhZy5ydW50aW1lLnYyLkxpc3RVbnZlcmlmaWVkTGFuZGluZ3NSZXNwb25zZRJyChJSZWNvcmRWZXJpZmljYXRpb24SNS5zdXBlcnRhZy5ydW50aW1lLnYyLlJlY29yZExhbmRpbmdWZXJpZmljYXRpb25SZXF1ZXN0GiUuc3VwZXJ0YWcucnVudGltZS52Mi5Xb3Jrc3BhY2VMYW5kaW5nYgZwcm90bzM\", [file_supertag_runtime_v2_runtime, file_supertag_runtime_v2_workspaces]);\n\n/**\n * @generated from message supertag.runtime.v2.WorkspaceLanding\n */\nexport type WorkspaceLanding = Message<\"supertag.runtime.v2.WorkspaceLanding\"> & {\n /**\n * @generated from field: string landing_id = 1;\n */\n landingId: string;\n\n /**\n * @generated from field: string task_id = 2;\n */\n taskId: string;\n\n /**\n * @generated from field: string tag_id = 3;\n */\n tagId: string;\n\n /**\n * @generated from field: string session_id = 4;\n */\n sessionId: string;\n\n /**\n * @generated from field: string workspace_id = 5;\n */\n workspaceId: string;\n\n /**\n * @generated from field: string remote = 6;\n */\n remote: string;\n\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceLandingMode mode = 7;\n */\n mode: WorkspaceLandingMode;\n\n /**\n * The Session's branch, `supertag/session/ID`.\n *\n * @generated from field: string branch = 8;\n */\n branch: string;\n\n /**\n * The merge target, or the pull request's base in review mode; empty for branch mode.\n *\n * @generated from field: string target = 9;\n */\n target: string;\n\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceDeliveryReference delivery = 10;\n */\n delivery?: WorkspaceDeliveryReference | undefined;\n\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceLandingState state = 11;\n */\n state: WorkspaceLandingState;\n\n /**\n * @generated from field: string reason = 12;\n */\n reason: string;\n\n /**\n * Landed: the commit the Session's branch (branch mode) or the target (merge mode) names.\n *\n * @generated from field: string landed_commit = 13;\n */\n landedCommit: string;\n\n /**\n * Conflict: the target commit the Session must merge, and the conflicting paths.\n *\n * @generated from field: string target_commit = 14;\n */\n targetCommit: string;\n\n /**\n * @generated from field: repeated string conflicts = 15;\n */\n conflicts: string[];\n\n /**\n * @generated from field: optional string follow_up_task_id = 16;\n */\n followUpTaskId?: string | undefined;\n\n /**\n * @generated from field: int64 created_order = 17;\n */\n createdOrder: bigint;\n\n /**\n * A merge commit's author: the Tag's name and a SuperTag no-reply address.\n *\n * @generated from field: string author_name = 18;\n */\n authorName: string;\n\n /**\n * @generated from field: string author_email = 19;\n */\n authorEmail: string;\n\n /**\n * The requester, as a `Co-authored-by` trailer value. Empty when there is none.\n *\n * @generated from field: string co_author = 20;\n */\n coAuthor: string;\n\n /**\n * Review mode: the pull request's title and description for this delivery.\n *\n * @generated from field: string title = 21;\n */\n title: string;\n\n /**\n * @generated from field: string body = 22;\n */\n body: string;\n\n /**\n * Review mode, once landed: the pull request the Session's branch is reviewed in.\n *\n * @generated from field: supertag.runtime.v2.WorkspacePullRequest pull_request = 23;\n */\n pullRequest?: WorkspacePullRequest | undefined;\n};\n\n/**\n * Describes the message supertag.runtime.v2.WorkspaceLanding.\n * Use `create(WorkspaceLandingSchema)` to create a new message.\n */\nexport const WorkspaceLandingSchema: GenMessage<WorkspaceLanding> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 0);\n\n/**\n * A pull request a review landing opened or updated.\n *\n * @generated from message supertag.runtime.v2.WorkspacePullRequest\n */\nexport type WorkspacePullRequest = Message<\"supertag.runtime.v2.WorkspacePullRequest\"> & {\n /**\n * The forge's repository, as `OWNER/NAME`, and its numeric ID.\n *\n * @generated from field: string repository = 1;\n */\n repository: string;\n\n /**\n * @generated from field: uint64 repository_id = 2;\n */\n repositoryId: bigint;\n\n /**\n * @generated from field: uint64 number = 3;\n */\n number: bigint;\n\n /**\n * @generated from field: string url = 4;\n */\n url: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.WorkspacePullRequest.\n * Use `create(WorkspacePullRequestSchema)` to create a new message.\n */\nexport const WorkspacePullRequestSchema: GenMessage<WorkspacePullRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 1);\n\n/**\n * @generated from message supertag.runtime.v2.GetWorkspaceLandingRequest\n */\nexport type GetWorkspaceLandingRequest = Message<\"supertag.runtime.v2.GetWorkspaceLandingRequest\"> & {\n /**\n * @generated from field: string landing_id = 1;\n */\n landingId: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.GetWorkspaceLandingRequest.\n * Use `create(GetWorkspaceLandingRequestSchema)` to create a new message.\n */\nexport const GetWorkspaceLandingRequestSchema: GenMessage<GetWorkspaceLandingRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 2);\n\n/**\n * @generated from message supertag.runtime.v2.ReturnLandingConflictRequest\n */\nexport type ReturnLandingConflictRequest = Message<\"supertag.runtime.v2.ReturnLandingConflictRequest\"> & {\n /**\n * @generated from field: string operation_id = 1;\n */\n operationId: string;\n\n /**\n * @generated from field: string tag_id = 2;\n */\n tagId: string;\n\n /**\n * @generated from field: string session_id = 3;\n */\n sessionId: string;\n\n /**\n * The merge target, the commit it named, and the conflicting paths.\n *\n * @generated from field: string target = 4;\n */\n target: string;\n\n /**\n * @generated from field: string target_commit = 5;\n */\n targetCommit: string;\n\n /**\n * @generated from field: repeated string conflicts = 6;\n */\n conflicts: string[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.ReturnLandingConflictRequest.\n * Use `create(ReturnLandingConflictRequestSchema)` to create a new message.\n */\nexport const ReturnLandingConflictRequestSchema: GenMessage<ReturnLandingConflictRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 3);\n\n/**\n * @generated from message supertag.runtime.v2.ListWorkspaceLandingsRequest\n */\nexport type ListWorkspaceLandingsRequest = Message<\"supertag.runtime.v2.ListWorkspaceLandingsRequest\"> & {\n /**\n * @generated from field: string task_id = 1;\n */\n taskId: string;\n\n /**\n * @generated from field: uint32 limit = 2;\n */\n limit: number;\n\n /**\n * @generated from field: int64 before_order = 3;\n */\n beforeOrder: bigint;\n\n /**\n * @generated from field: string session_id = 4;\n */\n sessionId: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListWorkspaceLandingsRequest.\n * Use `create(ListWorkspaceLandingsRequestSchema)` to create a new message.\n */\nexport const ListWorkspaceLandingsRequestSchema: GenMessage<ListWorkspaceLandingsRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 4);\n\n/**\n * @generated from message supertag.runtime.v2.ListWorkspaceLandingsResponse\n */\nexport type ListWorkspaceLandingsResponse = Message<\"supertag.runtime.v2.ListWorkspaceLandingsResponse\"> & {\n /**\n * @generated from field: repeated supertag.runtime.v2.WorkspaceLanding landings = 1;\n */\n landings: WorkspaceLanding[];\n\n /**\n * @generated from field: int64 next_before_order = 2;\n */\n nextBeforeOrder: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListWorkspaceLandingsResponse.\n * Use `create(ListWorkspaceLandingsResponseSchema)` to create a new message.\n */\nexport const ListWorkspaceLandingsResponseSchema: GenMessage<ListWorkspaceLandingsResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 5);\n\n/**\n * A Session's source, pinned once: every Task of the Session starts from the same commit.\n *\n * @generated from message supertag.runtime.v2.WorkspaceSourcePin\n */\nexport type WorkspaceSourcePin = Message<\"supertag.runtime.v2.WorkspaceSourcePin\"> & {\n /**\n * @generated from field: string pin_id = 1;\n */\n pinId: string;\n\n /**\n * @generated from field: string tag_id = 2;\n */\n tagId: string;\n\n /**\n * @generated from field: string session_id = 3;\n */\n sessionId: string;\n\n /**\n * @generated from field: supertag.runtime.v2.Workspace selector = 4;\n */\n selector?: Workspace | undefined;\n\n /**\n * @generated from field: string selector_digest = 5;\n */\n selectorDigest: string;\n\n /**\n * @generated from field: supertag.runtime.v2.Workspace resolved = 6;\n */\n resolved?: Workspace | undefined;\n\n /**\n * @generated from field: uint64 created_order = 7;\n */\n createdOrder: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.WorkspaceSourcePin.\n * Use `create(WorkspaceSourcePinSchema)` to create a new message.\n */\nexport const WorkspaceSourcePinSchema: GenMessage<WorkspaceSourcePin> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 6);\n\n/**\n * @generated from message supertag.runtime.v2.ListPendingWorkspaceSourcesRequest\n */\nexport type ListPendingWorkspaceSourcesRequest = Message<\"supertag.runtime.v2.ListPendingWorkspaceSourcesRequest\"> & {\n /**\n * @generated from field: uint64 after_order = 1;\n */\n afterOrder: bigint;\n\n /**\n * @generated from field: uint32 limit = 2;\n */\n limit: number;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListPendingWorkspaceSourcesRequest.\n * Use `create(ListPendingWorkspaceSourcesRequestSchema)` to create a new message.\n */\nexport const ListPendingWorkspaceSourcesRequestSchema: GenMessage<ListPendingWorkspaceSourcesRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 7);\n\n/**\n * @generated from message supertag.runtime.v2.ListPendingWorkspaceSourcesResponse\n */\nexport type ListPendingWorkspaceSourcesResponse = Message<\"supertag.runtime.v2.ListPendingWorkspaceSourcesResponse\"> & {\n /**\n * @generated from field: repeated supertag.runtime.v2.WorkspaceSourcePin pins = 1;\n */\n pins: WorkspaceSourcePin[];\n\n /**\n * @generated from field: uint64 next_after_order = 2;\n */\n nextAfterOrder: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListPendingWorkspaceSourcesResponse.\n * Use `create(ListPendingWorkspaceSourcesResponseSchema)` to create a new message.\n */\nexport const ListPendingWorkspaceSourcesResponseSchema: GenMessage<ListPendingWorkspaceSourcesResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 8);\n\n/**\n * @generated from message supertag.runtime.v2.PinWorkspaceSourceRequest\n */\nexport type PinWorkspaceSourceRequest = Message<\"supertag.runtime.v2.PinWorkspaceSourceRequest\"> & {\n /**\n * @generated from field: string pin_id = 1;\n */\n pinId: string;\n\n /**\n * @generated from field: string selector_digest = 2;\n */\n selectorDigest: string;\n\n /**\n * @generated from field: string resolved_ref = 3;\n */\n resolvedRef: string;\n\n /**\n * @generated from field: string commit = 4;\n */\n commit: string;\n\n /**\n * Set instead of a commit when the source cannot be read; the Session's queued Tasks fail\n * with it.\n *\n * @generated from field: string error = 5;\n */\n error: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.PinWorkspaceSourceRequest.\n * Use `create(PinWorkspaceSourceRequestSchema)` to create a new message.\n */\nexport const PinWorkspaceSourceRequestSchema: GenMessage<PinWorkspaceSourceRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 9);\n\n/**\n * @generated from message supertag.runtime.v2.ListUnverifiedLandingsRequest\n */\nexport type ListUnverifiedLandingsRequest = Message<\"supertag.runtime.v2.ListUnverifiedLandingsRequest\"> & {\n /**\n * @generated from field: uint32 limit = 1;\n */\n limit: number;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListUnverifiedLandingsRequest.\n * Use `create(ListUnverifiedLandingsRequestSchema)` to create a new message.\n */\nexport const ListUnverifiedLandingsRequestSchema: GenMessage<ListUnverifiedLandingsRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 10);\n\n/**\n * @generated from message supertag.runtime.v2.ListUnverifiedLandingsResponse\n */\nexport type ListUnverifiedLandingsResponse = Message<\"supertag.runtime.v2.ListUnverifiedLandingsResponse\"> & {\n /**\n * @generated from field: repeated supertag.runtime.v2.UnverifiedLanding landings = 1;\n */\n landings: UnverifiedLanding[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListUnverifiedLandingsResponse.\n * Use `create(ListUnverifiedLandingsResponseSchema)` to create a new message.\n */\nexport const ListUnverifiedLandingsResponseSchema: GenMessage<ListUnverifiedLandingsResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 11);\n\n/**\n * @generated from message supertag.runtime.v2.UnverifiedLanding\n */\nexport type UnverifiedLanding = Message<\"supertag.runtime.v2.UnverifiedLanding\"> & {\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceLanding landing = 1;\n */\n landing?: WorkspaceLanding | undefined;\n\n /**\n * The remote Workspace as the landing's Task recorded it, to read the branch with.\n *\n * @generated from field: supertag.runtime.v2.Workspace workspace = 2;\n */\n workspace?: Workspace | undefined;\n};\n\n/**\n * Describes the message supertag.runtime.v2.UnverifiedLanding.\n * Use `create(UnverifiedLandingSchema)` to create a new message.\n */\nexport const UnverifiedLandingSchema: GenMessage<UnverifiedLanding> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 12);\n\n/**\n * @generated from message supertag.runtime.v2.RecordLandingVerificationRequest\n */\nexport type RecordLandingVerificationRequest = Message<\"supertag.runtime.v2.RecordLandingVerificationRequest\"> & {\n /**\n * @generated from field: string landing_id = 1;\n */\n landingId: string;\n\n /**\n * The commit the remote's Session branch names; empty when the branch is missing.\n *\n * @generated from field: string remote_commit = 2;\n */\n remoteCommit: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.RecordLandingVerificationRequest.\n * Use `create(RecordLandingVerificationRequestSchema)` to create a new message.\n */\nexport const RecordLandingVerificationRequestSchema: GenMessage<RecordLandingVerificationRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 13);\n\n/**\n * @generated from message supertag.runtime.v2.ClaimWorkspaceLandingRequest\n */\nexport type ClaimWorkspaceLandingRequest = Message<\"supertag.runtime.v2.ClaimWorkspaceLandingRequest\"> & {\n /**\n * @generated from field: string operation_id = 1;\n */\n operationId: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ClaimWorkspaceLandingRequest.\n * Use `create(ClaimWorkspaceLandingRequestSchema)` to create a new message.\n */\nexport const ClaimWorkspaceLandingRequestSchema: GenMessage<ClaimWorkspaceLandingRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 14);\n\n/**\n * @generated from message supertag.runtime.v2.WorkspaceLandingLease\n */\nexport type WorkspaceLandingLease = Message<\"supertag.runtime.v2.WorkspaceLandingLease\"> & {\n /**\n * @generated from field: string landing_id = 1;\n */\n landingId: string;\n\n /**\n * @generated from field: string lease_token = 2;\n */\n leaseToken: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.WorkspaceLandingLease.\n * Use `create(WorkspaceLandingLeaseSchema)` to create a new message.\n */\nexport const WorkspaceLandingLeaseSchema: GenMessage<WorkspaceLandingLease> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 15);\n\n/**\n * @generated from message supertag.runtime.v2.ClaimWorkspaceLandingResponse\n */\nexport type ClaimWorkspaceLandingResponse = Message<\"supertag.runtime.v2.ClaimWorkspaceLandingResponse\"> & {\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceLanding landing = 1;\n */\n landing?: WorkspaceLanding | undefined;\n\n /**\n * @generated from field: string lease_token = 2;\n */\n leaseToken: string;\n\n /**\n * @generated from field: uint64 valid_for_ms = 3;\n */\n validForMs: bigint;\n\n /**\n * A Worker Host's claims only: the Attempt whose Workspace state on the claiming host holds\n * the delivered commit.\n *\n * @generated from field: supertag.runtime.v2.BlobHolder holder = 4;\n */\n holder?: BlobHolder | undefined;\n\n /**\n * Git delivery's claims only: the push credential's name, which its review adapter uses.\n *\n * @generated from field: string credential = 5;\n */\n credential: string;\n\n /**\n * A Worker Host's claims and renewals only: the remote Workspace as the landing's Task\n * recorded it, whose push credential `WorkspaceGitAccess.Mint` grants for the lease.\n *\n * @generated from field: supertag.runtime.v2.Workspace workspace = 6;\n */\n workspace?: Workspace | undefined;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ClaimWorkspaceLandingResponse.\n * Use `create(ClaimWorkspaceLandingResponseSchema)` to create a new message.\n */\nexport const ClaimWorkspaceLandingResponseSchema: GenMessage<ClaimWorkspaceLandingResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 16);\n\n/**\n * @generated from message supertag.runtime.v2.RecordWorkspaceLandingRequest\n */\nexport type RecordWorkspaceLandingRequest = Message<\"supertag.runtime.v2.RecordWorkspaceLandingRequest\"> & {\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceLandingLease lease = 1;\n */\n lease?: WorkspaceLandingLease | undefined;\n\n /**\n * @generated from field: string operation_id = 2;\n */\n operationId: string;\n\n /**\n * Queued (retry later), Landed, Conflict, or Held.\n *\n * @generated from field: supertag.runtime.v2.WorkspaceLandingState state = 3;\n */\n state: WorkspaceLandingState;\n\n /**\n * @generated from field: string reason = 4;\n */\n reason: string;\n\n /**\n * @generated from field: string landed_commit = 5;\n */\n landedCommit: string;\n\n /**\n * @generated from field: string target_commit = 6;\n */\n targetCommit: string;\n\n /**\n * @generated from field: repeated string conflicts = 7;\n */\n conflicts: string[];\n\n /**\n * Queued only: how long to wait before the next try.\n *\n * @generated from field: uint64 retry_after_ms = 8;\n */\n retryAfterMs: bigint;\n\n /**\n * Landed in review mode: the pull request opened or updated.\n *\n * @generated from field: supertag.runtime.v2.WorkspacePullRequest pull_request = 9;\n */\n pullRequest?: WorkspacePullRequest | undefined;\n};\n\n/**\n * Describes the message supertag.runtime.v2.RecordWorkspaceLandingRequest.\n * Use `create(RecordWorkspaceLandingRequestSchema)` to create a new message.\n */\nexport const RecordWorkspaceLandingRequestSchema: GenMessage<RecordWorkspaceLandingRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 17);\n\n/**\n * @generated from enum supertag.runtime.v2.WorkspaceLandingMode\n */\nexport enum WorkspaceLandingMode {\n /**\n * @generated from enum value: WORKSPACE_LANDING_MODE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: WORKSPACE_LANDING_MODE_BRANCH = 1;\n */\n BRANCH = 1,\n\n /**\n * @generated from enum value: WORKSPACE_LANDING_MODE_MERGE = 2;\n */\n MERGE = 2,\n\n /**\n * @generated from enum value: WORKSPACE_LANDING_MODE_REVIEW = 3;\n */\n REVIEW = 3,\n}\n\n/**\n * Describes the enum supertag.runtime.v2.WorkspaceLandingMode.\n */\nexport const WorkspaceLandingModeSchema: GenEnum<WorkspaceLandingMode> = /*@__PURE__*/\n enumDesc(file_supertag_runtime_v2_workspace_landings, 0);\n\n/**\n * @generated from enum supertag.runtime.v2.WorkspaceLandingState\n */\nexport enum WorkspaceLandingState {\n /**\n * @generated from enum value: WORKSPACE_LANDING_STATE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Waiting for git delivery, or for the Worker Host holding the delivery to reconnect.\n *\n * @generated from enum value: WORKSPACE_LANDING_STATE_QUEUED = 1;\n */\n QUEUED = 1,\n\n /**\n * @generated from enum value: WORKSPACE_LANDING_STATE_CLAIMED = 2;\n */\n CLAIMED = 2,\n\n /**\n * @generated from enum value: WORKSPACE_LANDING_STATE_LANDED = 3;\n */\n LANDED = 3,\n\n /**\n * The Session's changes conflict with the target. Nothing was pushed to the target, and the\n * Session received a follow-up Task to merge the target and resolve the conflicts.\n *\n * @generated from enum value: WORKSPACE_LANDING_STATE_CONFLICT = 4;\n */\n CONFLICT = 4,\n\n /**\n * Refused until someone acts, such as a branch moved outside SuperTag or a missing credential.\n *\n * @generated from enum value: WORKSPACE_LANDING_STATE_HELD = 5;\n */\n HELD = 5,\n\n /**\n * A newer delivery of the same Session replaced it before it landed.\n *\n * @generated from enum value: WORKSPACE_LANDING_STATE_SUPERSEDED = 6;\n */\n SUPERSEDED = 6,\n}\n\n/**\n * Describes the enum supertag.runtime.v2.WorkspaceLandingState.\n */\nexport const WorkspaceLandingStateSchema: GenEnum<WorkspaceLandingState> = /*@__PURE__*/\n enumDesc(file_supertag_runtime_v2_workspace_landings, 1);\n\n/**\n * Operators see where each Session's changes landed, separately from the Task's own result:\n * a Task succeeds whether or not its changes reached the remote.\n *\n * @generated from service supertag.runtime.v2.WorkspaceLandings\n */\nexport const WorkspaceLandings: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.WorkspaceLandings.Get\n */\n get: {\n methodKind: \"unary\";\n input: typeof GetWorkspaceLandingRequestSchema;\n output: typeof WorkspaceLandingSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.WorkspaceLandings.List\n */\n list: {\n methodKind: \"unary\";\n input: typeof ListWorkspaceLandingsRequestSchema;\n output: typeof ListWorkspaceLandingsResponseSchema;\n },\n /**\n * A local Workspace's merge, which `supertag up` makes in the operator's own repository,\n * conflicted: the Session receives a follow-up Task that merges the target and resolves it.\n *\n * @generated from rpc supertag.runtime.v2.WorkspaceLandings.ReturnConflict\n */\n returnConflict: {\n methodKind: \"unary\";\n input: typeof ReturnLandingConflictRequestSchema;\n output: typeof TaskSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_workspace_landings, 0);\n\n/**\n * The Worker Host holding a delivery lands it: it pushes the Session's branch, and in merge mode\n * merges it into the target, from its own copy of the delivered commit, with credentials the\n * Control Plane mints for the one push. A host claims only landings of deliveries it holds.\n *\n * @generated from service supertag.runtime.v2.HostLandings\n */\nexport const HostLandings: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.HostLandings.Claim\n */\n claim: {\n methodKind: \"unary\";\n input: typeof ClaimWorkspaceLandingRequestSchema;\n output: typeof ClaimWorkspaceLandingResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.HostLandings.Renew\n */\n renew: {\n methodKind: \"unary\";\n input: typeof WorkspaceLandingLeaseSchema;\n output: typeof ClaimWorkspaceLandingResponseSchema;\n },\n /**\n * In review mode, a host records the pushed branch as Landed without a pull request; the\n * Control Plane's git delivery then opens or updates the pull request.\n *\n * @generated from rpc supertag.runtime.v2.HostLandings.Record\n */\n record: {\n methodKind: \"unary\";\n input: typeof RecordWorkspaceLandingRequestSchema;\n output: typeof WorkspaceLandingSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_workspace_landings, 1);\n\n/**\n * Internal to the Control Plane: git delivery pins each Session's source, and opens or updates\n * the pull request of a review landing whose branch a Worker Host pushed. It claims only those.\n *\n * @generated from service supertag.runtime.v2.GitDelivery\n */\nexport const GitDelivery: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.ListPendingSources\n */\n listPendingSources: {\n methodKind: \"unary\";\n input: typeof ListPendingWorkspaceSourcesRequestSchema;\n output: typeof ListPendingWorkspaceSourcesResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.PinSource\n */\n pinSource: {\n methodKind: \"unary\";\n input: typeof PinWorkspaceSourceRequestSchema;\n output: typeof WorkspaceSourcePinSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.Claim\n */\n claim: {\n methodKind: \"unary\";\n input: typeof ClaimWorkspaceLandingRequestSchema;\n output: typeof ClaimWorkspaceLandingResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.Renew\n */\n renew: {\n methodKind: \"unary\";\n input: typeof WorkspaceLandingLeaseSchema;\n output: typeof ClaimWorkspaceLandingResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.Record\n */\n record: {\n methodKind: \"unary\";\n input: typeof RecordWorkspaceLandingRequestSchema;\n output: typeof WorkspaceLandingSchema;\n },\n /**\n * Each Session's latest landing whose Session branch a Worker Host pushed and git delivery has\n * not checked yet. Git delivery reads the branch with `ls-remote` and records what it named.\n *\n * @generated from rpc supertag.runtime.v2.GitDelivery.ListUnverified\n */\n listUnverified: {\n methodKind: \"unary\";\n input: typeof ListUnverifiedLandingsRequestSchema;\n output: typeof ListUnverifiedLandingsResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.RecordVerification\n */\n recordVerification: {\n methodKind: \"unary\";\n input: typeof RecordLandingVerificationRequestSchema;\n output: typeof WorkspaceLandingSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_workspace_landings, 2);\n","import { createHash, randomBytes } from \"node:crypto\";\nimport { isIP, type Socket, connect as tcpConnect } from \"node:net\";\nimport { Duplex } from \"node:stream\";\nimport { connect as tlsConnect } from \"node:tls\";\n\n// A `wss://` or `ws://` Gateway URL carries the same gRPC connection inside a WebSocket, for\n// platforms whose proxy forwards only HTTP/1.1. The tunnel is a byte pipe: SuperTag's own TLS,\n// with any client certificate, runs end to end inside it, so a proxy that terminates the outer\n// `wss://` TLS sees only ciphertext. This matches the Rust transport (core/crates/transport).\n\n/** The largest WebSocket message either side sends or accepts. */\nexport const TUNNEL_MAX_MESSAGE = 256 * 1024;\n/** How often the client pings the Gateway; a peer silent for three intervals is gone. */\nexport const TUNNEL_PING_MS = 20_000;\n/** The largest upgrade response head read before the tunnel is refused. */\nconst MAX_RESPONSE_HEAD = 16 * 1024;\nconst WEBSOCKET_GUID = \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\";\n\nconst OP_CONTINUATION = 0x0;\nconst OP_TEXT = 0x1;\nconst OP_BINARY = 0x2;\nconst OP_CLOSE = 0x8;\nconst OP_PING = 0x9;\nconst OP_PONG = 0xa;\n\n/** The native gRPC origin a tunnel URL carries, without the WebSocket path. */\nexport function tunnelOrigin(url: URL): string {\n const scheme = url.protocol === \"wss:\" ? \"https\" : \"http\";\n const port = url.port || (url.protocol === \"wss:\" ? \"443\" : \"80\");\n return `${scheme}://${url.hostname}:${port}`;\n}\n\n/**\n * The code of every error a tunnel fails with. connect-node knows only Node's own socket codes,\n * so the Gateway client reports a call whose cause carries this code as Unavailable, as gRPC\n * does for a broken connection.\n */\nexport const TUNNEL_FAILURE = \"ERR_SUPERTAG_TUNNEL\";\n\nfunction failure(message: string, code = TUNNEL_FAILURE): Error {\n return Object.assign(new Error(message), { code });\n}\n\nfunction headerHasToken(value: string | undefined, token: string): boolean {\n return (value ?? \"\").split(\",\").some((part) => part.trim().toLowerCase() === token);\n}\n\n/** Outer TLS for a `wss://` tunnel: the platform's edge certificate. */\nexport interface OuterTls {\n readonly ca: ReadonlyArray<string | Buffer> | undefined;\n}\n\n/**\n * One WebSocket tunnel as a byte stream: binary messages in both directions, masked frames out,\n * at most {@link TUNNEL_MAX_MESSAGE} bytes each. It pings on an interval, which keeps proxies from\n * closing an idle tunnel, and fails when the peer has sent nothing, not even a pong, for three\n * intervals. Writes made before the upgrade completes wait for it.\n */\nexport class TunnelSocket extends Duplex {\n readonly #url: URL;\n readonly #ping: number;\n #socket: Socket | undefined;\n #ready: Promise<void>;\n #open = false;\n #pending: Buffer = Buffer.alloc(0);\n #fragmented = false;\n #message = 0;\n #last = Date.now();\n #timer: NodeJS.Timeout | undefined;\n #closing = false;\n\n constructor(url: URL, outer: OuterTls | undefined, ping = TUNNEL_PING_MS) {\n super({ allowHalfOpen: false });\n this.#url = url;\n this.#ping = ping;\n this.#ready = this.#dial(outer).catch((error: unknown) => {\n // No cause is attached: connect-node reads codes along the cause chain, and would report\n // a reset socket's ECONNRESET as Aborted.\n const message = error instanceof Error ? error.message : String(error);\n throw failure(\n message.startsWith(\"the WebSocket tunnel\")\n ? message\n : `the WebSocket tunnel could not open: ${message}`,\n );\n });\n this.#ready.then(\n () => this.emit(\"tunnel\"),\n (error: Error) => this.destroy(error),\n );\n }\n\n async #dial(outer: OuterTls | undefined): Promise<void> {\n const url = this.#url;\n const host = url.hostname.replace(/^\\[|\\]$/gu, \"\");\n const port = Number(url.port || (url.protocol === \"wss:\" ? 443 : 80));\n const socket =\n outer === undefined\n ? tcpConnect({ host, port })\n : tlsConnect({\n host,\n port,\n servername: isIP(host) === 0 ? host : undefined,\n ALPNProtocols: [\"http/1.1\"],\n ca: outer.ca as (string | Buffer)[] | undefined,\n minVersion: \"TLSv1.2\",\n rejectUnauthorized: true,\n });\n this.#socket = socket;\n socket.setNoDelay(true);\n await new Promise<void>((resolve, reject) => {\n const ready = () => {\n socket.off(\"error\", reject);\n socket.off(\"close\", closed);\n resolve();\n };\n const closed = () => reject(failure(\"the WebSocket tunnel connection closed\"));\n socket.once(outer === undefined ? \"connect\" : \"secureConnect\", ready);\n socket.once(\"error\", reject);\n socket.once(\"close\", closed);\n });\n const key = randomBytes(16).toString(\"base64\");\n // No Origin header: SuperTag listeners refuse upgrades that carry one, so a web page cannot\n // open a tunnel.\n socket.write(\n `GET ${url.pathname || \"/\"} HTTP/1.1\\r\\nHost: ${url.host}\\r\\nUpgrade: websocket\\r\\n` +\n `Connection: Upgrade\\r\\nSec-WebSocket-Key: ${key}\\r\\nSec-WebSocket-Version: 13\\r\\n\\r\\n`,\n );\n const { head, rest } = await new Promise<{ head: string; rest: Buffer }>((resolve, reject) => {\n let read = Buffer.alloc(0);\n const done = (error?: Error) => {\n socket.off(\"data\", data);\n socket.off(\"error\", done);\n socket.off(\"close\", closed);\n if (error) reject(error);\n };\n const closed = () =>\n done(failure(\"the WebSocket tunnel upgrade failed: the connection closed\"));\n const data = (chunk: Buffer) => {\n read = Buffer.concat([read, chunk]);\n const end = read.indexOf(\"\\r\\n\\r\\n\");\n if (end >= 0) {\n done();\n resolve({ head: read.subarray(0, end).toString(\"latin1\"), rest: read.subarray(end + 4) });\n } else if (read.length > MAX_RESPONSE_HEAD) {\n done(failure(\"the WebSocket tunnel upgrade failed: the response head is too large\"));\n }\n };\n socket.on(\"data\", data);\n socket.once(\"error\", done);\n socket.once(\"close\", closed);\n });\n const [status = \"\", ...lines] = head.split(\"\\r\\n\");\n const headers = new Map<string, string>();\n for (const line of lines) {\n const colon = line.indexOf(\":\");\n if (colon <= 0) continue;\n const name = line.slice(0, colon).trim().toLowerCase();\n const value = line.slice(colon + 1).trim();\n headers.set(name, headers.has(name) ? `${headers.get(name)}, ${value}` : value);\n }\n const accept = createHash(\"sha1\")\n .update(key + WEBSOCKET_GUID)\n .digest(\"base64\");\n if (\n !/^HTTP\\/1\\.1 101(?: |$)/u.test(status) ||\n headers.get(\"upgrade\")?.toLowerCase() !== \"websocket\" ||\n !headerHasToken(headers.get(\"connection\"), \"upgrade\") ||\n headers.get(\"sec-websocket-accept\") !== accept\n ) {\n throw failure(\n `the WebSocket tunnel upgrade was refused: ${status.replace(/^HTTP\\/1\\.1 /u, \"\").replace(/[^\\x20-\\x7e]/gu, \"\")}`,\n );\n }\n this.#open = true;\n this.#last = Date.now();\n socket.on(\"data\", (chunk: Buffer) => this.#receive(chunk));\n socket.on(\"error\", (error) =>\n this.destroy(failure(`the WebSocket tunnel connection failed: ${error.message}`)),\n );\n socket.on(\"close\", () => {\n if (!this.destroyed) this.destroy(failure(\"the WebSocket tunnel connection closed\"));\n });\n this.#timer = setInterval(() => this.#keepalive(), this.#ping);\n this.#timer.unref();\n if (rest.length > 0) this.#receive(rest);\n }\n\n #keepalive() {\n const socket = this.#socket;\n if (socket === undefined || this.destroyed) return;\n // A paused read side is this end's backpressure, not the peer's silence.\n if (!socket.isPaused() && Date.now() - this.#last >= 3 * this.#ping) {\n this.destroy(failure(\"the WebSocket tunnel peer stopped answering\"));\n return;\n }\n this.#send(OP_PING, Buffer.alloc(0));\n }\n\n /** Reads every complete frame in the received bytes. */\n #receive(chunk: Buffer) {\n this.#pending = this.#pending.length === 0 ? chunk : Buffer.concat([this.#pending, chunk]);\n try {\n while (!this.destroyed) {\n const frame = this.#frame();\n if (frame === undefined) return;\n this.#handle(frame.fin, frame.opcode, frame.payload);\n }\n } catch (error) {\n this.destroy(error as Error);\n }\n }\n\n #frame(): { fin: boolean; opcode: number; payload: Buffer } | undefined {\n const buffer = this.#pending;\n if (buffer.length < 2) return undefined;\n const first = buffer[0] as number;\n const second = buffer[1] as number;\n if ((first & 0x70) !== 0 || (second & 0x80) !== 0) {\n throw failure(\"the WebSocket tunnel peer sent an invalid frame\");\n }\n let length = second & 0x7f;\n let offset = 2;\n if (length === 126) {\n if (buffer.length < 4) return undefined;\n length = buffer.readUInt16BE(2);\n offset = 4;\n } else if (length === 127) {\n if (buffer.length < 10) return undefined;\n const extended = buffer.readBigUInt64BE(2);\n if (extended > BigInt(TUNNEL_MAX_MESSAGE)) {\n throw failure(\"the WebSocket tunnel message is too large\");\n }\n length = Number(extended);\n offset = 10;\n }\n if (length > TUNNEL_MAX_MESSAGE) throw failure(\"the WebSocket tunnel message is too large\");\n const fin = (first & 0x80) !== 0;\n const opcode = first & 0x0f;\n if (opcode >= OP_CLOSE && (!fin || length > 125)) {\n throw failure(\"the WebSocket tunnel peer sent an invalid control frame\");\n }\n if (buffer.length < offset + length) return undefined;\n const payload = buffer.subarray(offset, offset + length);\n this.#pending = buffer.subarray(offset + length);\n return { fin, opcode, payload };\n }\n\n #handle(fin: boolean, opcode: number, payload: Buffer) {\n this.#last = Date.now();\n switch (opcode) {\n case OP_BINARY:\n case OP_CONTINUATION: {\n if ((opcode === OP_BINARY) === this.#fragmented) {\n throw failure(\"the WebSocket tunnel peer sent an invalid fragment\");\n }\n if (opcode === OP_BINARY) this.#message = 0;\n this.#message += payload.length;\n if (this.#message > TUNNEL_MAX_MESSAGE) {\n throw failure(\"the WebSocket tunnel message is too large\");\n }\n this.#fragmented = !fin;\n // Copy: the payload is a view of the receive buffer, which later chunks replace.\n if (payload.length > 0 && !this.push(Buffer.from(payload))) this.#socket?.pause();\n return;\n }\n case OP_PING:\n this.#send(OP_PONG, payload);\n return;\n case OP_PONG:\n return;\n case OP_CLOSE: {\n // The Gateway never ends a tunnel this side still uses: its close is a failure, which\n // the calls on the tunnel report, not an end of stream HTTP/2 would take as clean.\n const unexpected = !this.#closing;\n this.#closing = true;\n this.#send(OP_CLOSE, payload.subarray(0, Math.min(payload.length, 2)));\n if (unexpected) throw failure(\"the Gateway closed the WebSocket tunnel\");\n this.push(null);\n this.#socket?.end();\n return;\n }\n case OP_TEXT:\n throw failure(\"the WebSocket tunnel carries only binary messages\");\n default:\n throw failure(\"the WebSocket tunnel peer sent an unknown frame\");\n }\n }\n\n /** Writes one final, masked frame. */\n #send(opcode: number, payload: Buffer, callback?: (error?: Error | null) => void) {\n const socket = this.#socket;\n if (socket === undefined || socket.destroyed || !socket.writable) {\n callback?.(failure(\"the WebSocket tunnel is closed\"));\n return;\n }\n const length = payload.length;\n const extended = length < 126 ? 0 : length <= 0xffff ? 2 : 8;\n const frame = Buffer.allocUnsafe(2 + extended + 4 + length);\n frame[0] = 0x80 | opcode;\n if (extended === 0) frame[1] = 0x80 | length;\n else if (extended === 2) {\n frame[1] = 0x80 | 126;\n frame.writeUInt16BE(length, 2);\n } else {\n frame[1] = 0x80 | 127;\n frame.writeBigUInt64BE(BigInt(length), 2);\n }\n const start = 2 + extended + 4;\n const mask = randomBytes(4);\n mask.copy(frame, 2 + extended);\n for (let i = 0; i < length; i++) {\n frame[start + i] = (payload[i] as number) ^ (mask[i & 3] as number);\n }\n socket.write(frame, callback);\n }\n\n override _write(\n chunk: Buffer,\n _encoding: BufferEncoding,\n callback: (error?: Error | null) => void,\n ) {\n const write = () => {\n for (let offset = 0; offset < chunk.length; offset += TUNNEL_MAX_MESSAGE) {\n const end = Math.min(chunk.length, offset + TUNNEL_MAX_MESSAGE);\n this.#send(\n OP_BINARY,\n chunk.subarray(offset, end),\n end === chunk.length ? callback : undefined,\n );\n }\n if (chunk.length === 0) callback();\n };\n if (this.#open) write();\n else this.#ready.then(write, (error: unknown) => callback(error as Error));\n }\n\n override _read() {\n this.#socket?.resume();\n }\n\n override _final(callback: (error?: Error | null) => void) {\n if (this.#open && !this.#closing) {\n this.#closing = true;\n this.#send(OP_CLOSE, Buffer.from([0x03, 0xe8]));\n }\n this.#socket?.end();\n callback();\n }\n\n override _destroy(error: Error | null, callback: (error?: Error | null) => void) {\n clearInterval(this.#timer);\n const socket = this.#socket;\n if (socket !== undefined && !socket.destroyed) {\n if (this.#open && !this.#closing) {\n this.#closing = true;\n this.#send(OP_CLOSE, Buffer.from([0x03, 0xe8]));\n }\n socket.destroy();\n }\n callback(error);\n }\n\n /** Lets the process exit while only this tunnel is open, as a TCP socket would. */\n unref(): this {\n this.#socket?.unref();\n return this;\n }\n\n ref(): this {\n this.#socket?.ref();\n return this;\n }\n}\n","import type { ClientHttp2Stream, ClientSessionOptions, Http2Session } from \"node:http2\";\nimport { isIP, type Socket, connect as tcpConnect } from \"node:net\";\nimport * as tls from \"node:tls\";\nimport { Code, ConnectError, createClient, type Interceptor } from \"@connectrpc/connect\";\nimport { createGrpcTransport, Http2SessionManager } from \"@connectrpc/connect-node\";\nimport {\n ArtifactCatalog,\n ArtifactPublications,\n ArtifactVolumes,\n} from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/artifact_pb.js\";\nimport { Memories } from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/memories_pb.js\";\nimport {\n ProtocolNegotiation,\n ServiceRole,\n} from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/negotiation_pb.js\";\nimport { Enrollments } from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/placement_pb.js\";\nimport {\n PolicyCatalog,\n SurfacePolicyCatalog,\n} from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/policy_pb.js\";\nimport {\n Conversations,\n Inbox,\n LiveInputs,\n Mailbox,\n ManifestRelationships,\n NetworkLogs,\n Objectives,\n Operator,\n OperatorEvents,\n TaskFiles,\n Teams,\n WorkSessions,\n} from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/runtime_pb.js\";\nimport { Schedules } from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/schedules_pb.js\";\nimport { WorkspaceLandings } from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/workspace_landings_pb.js\";\nimport {\n WorkspaceCredentials,\n Workspaces,\n} from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/workspaces_pb.js\";\nimport { TUNNEL_FAILURE, TunnelSocket, tunnelOrigin } from \"./tunnel.js\";\n\nexport { Code, ConnectError } from \"@connectrpc/connect\";\nexport { PrincipalRole } from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/runtime_pb.js\";\n\nexport interface GatewayClientOptions {\n /**\n * An `https://` origin, a loopback `http://` origin, or a `wss://` or loopback `ws://` tunnel\n * URL, which may have a path. A tunnel carries the same gRPC connection inside a WebSocket,\n * with the Gateway's own TLS running end to end inside a `wss://` tunnel.\n */\n readonly url: string;\n /** An operator token, Operator Token, enrolled credential, or Auth Key: ASCII, no spaces. */\n readonly token: string;\n /**\n * PEM certificate authority for a Gateway with a private TLS certificate. It replaces the\n * trusted roots for the Gateway's own TLS; a `wss://` tunnel's outer TLS trusts it beside them.\n */\n readonly ca?: string | Buffer;\n /** PEM client identity for a Gateway that requires mutual TLS. */\n readonly identity?: { readonly cert: string | Buffer; readonly key: string | Buffer };\n /** The release this client names while negotiating, up to 64 ASCII characters. */\n readonly buildVersion?: string;\n /**\n * How long opening a connection may take: TCP, TLS and, for a tunnel, the WebSocket upgrade.\n * Defaults to 5 seconds, or 30 for a tunnel, whose platform proxy may hold the upgrade while\n * it starts a Gateway that scaled to zero.\n */\n readonly connectTimeoutMs?: number;\n}\n\n/** Names, on every call, the protocol version this client negotiated with the Gateway. */\nconst PROTOCOL_HEADER = \"x-supertag-protocol\";\n/** The SuperTag protocol versions this client speaks. */\nconst PROTOCOL_VERSIONS = [7];\nconst protocolVersions: readonly number[] = Object.freeze(PROTOCOL_VERSIONS);\n\nexport { protocolVersions as PROTOCOL_VERSIONS };\n\n/** HTTP/2 keepalive, as the Rust transport's KEEPALIVE_INTERVAL and KEEPALIVE_TIMEOUT. */\nconst KEEPALIVE_INTERVAL_MS = 10_000;\nconst KEEPALIVE_TIMEOUT_MS = 10_000;\nconst MAX_MESSAGE_BYTES = 1024 * 1024;\nconst MAX_BUILD_VERSION = 64;\nconst MAX_OFFERED_VERSIONS = 32;\n\ninterface Endpoint {\n /** The URL as given, without a trailing slash: it names the Gateway in errors. */\n readonly name: string;\n /** The native gRPC origin calls go to. */\n readonly origin: URL;\n /** The tunnel URL, when connections go through a WebSocket. */\n readonly tunnel: URL | undefined;\n readonly tls: boolean;\n}\n\nfunction loopback(url: URL): boolean {\n const host = url.hostname.replace(/^\\[|\\]$/gu, \"\");\n return (isIP(host) === 4 && host.startsWith(\"127.\")) || host === \"::1\";\n}\n\nfunction gatewayEndpoint(value: string): Endpoint {\n if (/[\\s\\\\#?]/u.test(value)) throw new Error(invalidUrl);\n const tunnel = /^wss?:\\/\\//u.test(value);\n if (\n tunnel ? !/^wss?:\\/\\/[^/@]+(?:\\/.*)?$/u.test(value) : !/^https?:\\/\\/[^/@]+\\/?$/u.test(value)\n ) {\n throw new Error(invalidUrl);\n }\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n throw new Error(invalidUrl);\n }\n if (url.hostname === \"\" || url.port === \"0\") throw new Error(\"Gateway URL must use a valid port\");\n const cleartext = url.protocol === \"http:\" || url.protocol === \"ws:\";\n if (cleartext && !loopback(url)) {\n throw new Error(\"Cleartext Gateway URL must use a loopback IP address\");\n }\n return {\n name: value.replace(/\\/+$/u, \"\"),\n origin: tunnel ? new URL(tunnelOrigin(url)) : url,\n tunnel: tunnel ? url : undefined,\n tls: !cleartext,\n };\n}\n\nconst invalidUrl =\n \"Gateway URL must be an HTTP or HTTPS origin, or a WS or WSS tunnel URL, without credentials, query, or fragment\";\n\n/**\n * The roots the OS trusts beside Node's bundled ones, read once per process: reading them can\n * block for a while (the macOS keychain). Node releases without `tls.getCACertificates` keep\n * their bundled roots.\n */\nlet roots: readonly string[] | undefined;\nfunction trustedRoots(): readonly string[] {\n if (roots === undefined) {\n const read = (tls as { getCACertificates?: (type: string) => string[] }).getCACertificates;\n roots =\n typeof read === \"function\"\n ? [...new Set([...read(\"default\"), ...read(\"system\")])]\n : tls.rootCertificates;\n }\n return roots;\n}\n\n/** Opens each HTTP/2 connection within the connect timeout, natively or through a tunnel. */\nfunction connector(\n endpoint: Endpoint,\n options: GatewayClientOptions,\n timeoutMs: number,\n): NonNullable<ClientSessionOptions[\"createConnection\"]> {\n const host = endpoint.origin.hostname.replace(/^\\[|\\]$/gu, \"\");\n const inner: tls.ConnectionOptions = {\n host,\n servername: isIP(host) === 0 ? host : undefined,\n ALPNProtocols: [\"h2\"],\n ca: options.ca ?? [...trustedRoots()],\n cert: options.identity?.cert,\n key: options.identity?.key,\n minVersion: \"TLSv1.2\",\n rejectUnauthorized: true,\n };\n return () => {\n let socket: Socket | TunnelSocket;\n let ready: string;\n if (endpoint.tunnel !== undefined) {\n const outer =\n endpoint.tunnel.protocol === \"wss:\"\n ? { ca: [...trustedRoots(), ...(options.ca === undefined ? [] : [options.ca])] }\n : undefined;\n const tunnel = new TunnelSocket(endpoint.tunnel, outer);\n if (endpoint.tls) {\n socket = tls.connect({ ...inner, socket: tunnel });\n ready = \"secureConnect\";\n } else {\n socket = tunnel;\n ready = \"tunnel\";\n }\n } else if (endpoint.tls) {\n socket = tls.connect({ ...inner, port: Number(endpoint.origin.port || 443) });\n ready = \"secureConnect\";\n } else {\n socket = tcpConnect({ host, port: Number(endpoint.origin.port || 80) });\n ready = \"connect\";\n }\n const timer = setTimeout(() => {\n socket.destroy(\n Object.assign(new Error(`Could not connect to the Gateway within ${timeoutMs} ms`), {\n code: \"ETIMEDOUT\",\n }),\n );\n }, timeoutMs);\n timer.unref();\n socket.once(ready, () => clearTimeout(timer));\n socket.once(\"close\", () => clearTimeout(timer));\n return socket;\n };\n}\n\n/**\n * Starts reading a response stream as soon as it exists. Node.js 24 fails an async iterator\n * created on an HTTP/2 stream that has already closed with ERR_STREAM_PREMATURE_CLOSE, even when\n * the stream ended cleanly, and connect-node creates its iterator only once a promise for the\n * response headers settles. Over a native socket Node runs microtasks between the HTTP/2 frames\n * of one read, so the iterator exists before the trailers close the stream. A tunnel's bytes reach\n * HTTP/2 from JavaScript instead (Node's JSStreamSocket), which handles every frame of a WebSocket\n * message before any microtask runs, so a small reply closes its stream first. The iterator made\n * here holds at most the one message it has read until connect-node asks for it.\n */\nfunction readFromTheStart(stream: ClientHttp2Stream) {\n const iterator = stream[Symbol.asyncIterator]();\n const first = iterator.next();\n // The caller sees a failure when it reads; an unread one must not be unhandled.\n first.catch(() => {});\n stream[Symbol.asyncIterator] = async function* (): AsyncGenerator<unknown, undefined> {\n try {\n for (let read = await first; !read.done; read = await iterator.next()) yield read.value;\n return undefined;\n } finally {\n await iterator.return?.();\n }\n };\n}\n\n/**\n * The session manager every call goes through. Besides reading each response from the start, it\n * keeps an error listener on every session that carried a call: connect-node stops listening for\n * a session's errors once it leaves the session, as `close()` after a failed call does, and Node\n * emits a failed session's error as it closes, after the calls on it already reported it.\n */\nclass SessionManager extends Http2SessionManager {\n readonly #watched = new WeakSet<Http2Session>();\n\n override async request(...args: Parameters<Http2SessionManager[\"request\"]>) {\n const stream = await super.request(...args);\n readFromTheStart(stream);\n const session = stream.session;\n if (session !== undefined && !this.#watched.has(session)) {\n this.#watched.add(session);\n session.on(\"error\", () => {});\n }\n return stream;\n }\n}\n\n/** Whether `error` or any error it was caused by is a tunnel failure. */\nfunction tunnelFailure(error: unknown): boolean {\n for (let cause = error, depth = 0; cause instanceof Error && depth < 8; depth++) {\n if ((cause as { code?: unknown }).code === TUNNEL_FAILURE) return true;\n cause = cause.cause;\n }\n return false;\n}\n\n/** A call that failed because its tunnel failed is Unavailable, as over a broken connection. */\nfunction unavailable(error: unknown): unknown {\n if (!tunnelFailure(error)) return error;\n const status = ConnectError.from(error);\n return new ConnectError(status.rawMessage, Code.Unavailable, status.metadata, undefined, error);\n}\n\nconst tunnelFailures: Interceptor = (next) => async (request) => {\n let response: Awaited<ReturnType<typeof next>>;\n try {\n response = await next(request);\n } catch (error) {\n throw unavailable(error);\n }\n if (!response.stream) return response;\n const messages = response.message;\n return {\n ...response,\n message: (async function* () {\n try {\n yield* messages;\n } catch (error) {\n throw unavailable(error);\n }\n })(),\n };\n};\n\n/** Up to 64 visible ASCII characters of a peer's release, as the Rust client keeps them. */\nfunction printable(build: string): string {\n const kept = [...build].filter((c) => c > \" \" && c < \"\\x7f\").slice(0, MAX_BUILD_VERSION);\n return kept.length === 0 ? \"unknown\" : kept.join(\"\");\n}\n\n/** \"protocol 3\", or \"protocols 2, 3\". */\nfunction spoken(versions: readonly number[]): string {\n return versions.length === 1 ? `protocol ${versions[0]}` : `protocols ${versions.join(\", \")}`;\n}\n\n/** The release and versions in a negotiation refusal, if it names them. */\nfunction parseRefusal(message: string): { build: string; versions: number[] } | undefined {\n const match = /\\(SuperTag ([^)]*)\\) speaks protocol versions \\[([^\\]]*)\\]/u.exec(message);\n if (!match) return undefined;\n const versions = (match[2] as string).split(\",\").map((item) => item.trim());\n if (versions.length === 0 || versions.length > MAX_OFFERED_VERSIONS) return undefined;\n if (!versions.every((item) => /^[0-9]{1,10}$/u.test(item))) return undefined;\n return { build: printable(match[1] as string), versions: versions.map(Number) };\n}\n\n/**\n * The Gateway is a SuperTag release that speaks none of this client's protocol versions.\n * Retrying cannot help: one side must be upgraded. The message names both releases, where the\n * Gateway runs, and which side to upgrade.\n */\nexport class ProtocolMismatchError extends ConnectError {\n /** The protocol versions this client speaks. */\n readonly ourVersions: readonly number[];\n /** The protocol versions the Gateway speaks, when it named them. */\n readonly peerVersions: readonly number[] | undefined;\n /** The Gateway's release, when it named it. */\n readonly peerBuild: string | undefined;\n /** The Gateway URL this client was configured with. */\n readonly endpoint: string;\n\n /** ConnectError's own check accepts any ConnectError; this one follows the prototype chain. */\n static override [Symbol.hasInstance](value: unknown): boolean {\n return Function.prototype[Symbol.hasInstance].call(ProtocolMismatchError, value);\n }\n\n constructor(\n endpoint: string,\n peer: { build: string; versions: readonly number[] } | undefined,\n refusal?: string,\n ) {\n let message = `This client speaks SuperTag ${spoken(PROTOCOL_VERSIONS)}, but the Gateway at ${endpoint} `;\n if (peer === undefined) {\n const reason = (refusal ?? \"\")\n .replace(/\\p{Cc}/gu, \"\")\n .slice(0, 512)\n .replace(/[. ]+$/u, \"\");\n message += `refused it: ${reason || \"no reason given\"}. Run the same SuperTag release on both.`;\n } else {\n message += `runs SuperTag ${peer.build} (${spoken(peer.versions)}). `;\n const peerMax = Math.max(...peer.versions);\n const ourMax = Math.max(...PROTOCOL_VERSIONS);\n if (peerMax < Math.min(...PROTOCOL_VERSIONS)) message += \"Upgrade the Gateway.\";\n else if (ourMax < Math.min(...peer.versions)) message += \"Upgrade this client.\";\n else message += \"Run the same SuperTag release on both.\";\n }\n super(message, Code.FailedPrecondition);\n // The name stays \"ConnectError\": connect recognizes its errors by name, and would otherwise\n // wrap this one in a plain ConnectError on its way to the caller.\n this.ourVersions = protocolVersions;\n this.peerVersions = peer === undefined ? undefined : Object.freeze([...peer.versions]);\n this.peerBuild = peer?.build;\n this.endpoint = endpoint;\n }\n}\n\nfunction refusedByGateway(error: unknown, endpoint: string): ConnectError {\n const status = ConnectError.from(error);\n if (status.code === Code.Unimplemented) {\n return new ConnectError(\n \"incompatible SuperTag protocol: the Gateway does not offer SuperTag protocol negotiation\",\n Code.FailedPrecondition,\n );\n }\n if (\n status.code === Code.FailedPrecondition &&\n status.rawMessage.startsWith(\"incompatible SuperTag protocol\")\n ) {\n const peer = parseRefusal(status.rawMessage);\n return new ProtocolMismatchError(endpoint, peer, peer ? undefined : status.rawMessage);\n }\n if (\n status.code === Code.FailedPrecondition ||\n status.code === Code.PermissionDenied ||\n status.code === Code.InvalidArgument\n ) {\n return new ConnectError(\n `the SuperTag Gateway refused this operator client: ${status.rawMessage}`,\n Code.FailedPrecondition,\n );\n }\n return status;\n}\n\nfunction protocolRefusal(error: unknown): boolean {\n const status = ConnectError.from(error);\n return (\n status.code === Code.FailedPrecondition &&\n (status.rawMessage.startsWith(\"incompatible SuperTag protocol\") ||\n status.rawMessage.includes(\"did not negotiate a protocol version\"))\n );\n}\n\n/** 1 to `limit` ASCII graphic characters: the Rust bearer rule's alphabet. */\nfunction graphic(value: string, limit: number): boolean {\n return value.length > 0 && value.length <= limit && /^[\\x21-\\x7e]+$/u.test(value);\n}\n\n/** What the Gateway agreed to while negotiating. */\nexport interface Negotiation {\n /** The protocol version every call names. */\n readonly protocolVersion: number;\n /** The Gateway's SuperTag release, such as `0.3.4`; `unknown` when it named none. */\n readonly gatewayBuild: string;\n}\n\n/**\n * Connect operator applications to the SuperTag Gateway over gRPC. The first call negotiates the\n * SuperTag protocol version, which every call then names; the Gateway refuses calls without it.\n */\nexport function createGatewayClient(options: GatewayClientOptions) {\n const endpoint = gatewayEndpoint(options.url);\n // As the Rust clients' bearer rule: 1 to 8192 ASCII graphic characters.\n if (!graphic(options.token, 8192)) throw new Error(\"Invalid operator token\");\n const buildVersion = options.buildVersion ?? \"supertag-ai\";\n if (!graphic(buildVersion, MAX_BUILD_VERSION)) {\n throw new Error(\"Build version must be 1 to 64 ASCII characters without spaces\");\n }\n if (!endpoint.tls && (options.ca !== undefined || options.identity !== undefined)) {\n throw new Error(\"Gateway TLS options require HTTPS or WSS\");\n }\n const connectTimeoutMs = options.connectTimeoutMs ?? (endpoint.tunnel ? 30_000 : 5_000);\n if (!Number.isInteger(connectTimeoutMs) || connectTimeoutMs <= 0) {\n throw new Error(\"Connect timeout must be a positive whole number of milliseconds\");\n }\n\n const session = new SessionManager(\n endpoint.origin,\n {\n idleConnectionTimeoutMs: 1_000,\n pingIntervalMs: KEEPALIVE_INTERVAL_MS,\n pingTimeoutMs: KEEPALIVE_TIMEOUT_MS,\n },\n { createConnection: connector(endpoint, options, connectTimeoutMs) },\n );\n const authorization = `Bearer ${options.token}`;\n let closed = false;\n // The exchange carries no credentials.\n const negotiator = createClient(\n ProtocolNegotiation,\n createGrpcTransport({\n baseUrl: endpoint.origin.origin,\n sessionManager: session,\n readMaxBytes: 4096,\n writeMaxBytes: 4096,\n interceptors: [tunnelFailures],\n }),\n );\n let negotiated: Promise<Negotiation> | undefined;\n const negotiateOnce = () => {\n if (closed) return Promise.reject(new Error(\"Gateway client is closed\"));\n negotiated ??= (async () => {\n let answer: Awaited<ReturnType<typeof negotiator.negotiate>>;\n try {\n answer = await negotiator.negotiate(\n {\n role: ServiceRole.CLIENT,\n protocolVersions: [...PROTOCOL_VERSIONS],\n buildVersion,\n },\n { timeoutMs: 5_000 + connectTimeoutMs },\n );\n } catch (error) {\n throw refusedByGateway(error, endpoint.name);\n }\n if (answer.role !== ServiceRole.GATEWAY) {\n throw new ConnectError(\n \"this operator client expected a SuperTag Gateway but reached another service\",\n Code.FailedPrecondition,\n );\n }\n if (\n !PROTOCOL_VERSIONS.includes(answer.protocolVersion) ||\n !answer.protocolVersions.includes(answer.protocolVersion)\n ) {\n const versions = answer.protocolVersions.slice(0, MAX_OFFERED_VERSIONS);\n throw new ProtocolMismatchError(endpoint.name, {\n build: printable(answer.buildVersion),\n versions: versions.length > 0 ? versions : [answer.protocolVersion],\n });\n }\n return {\n protocolVersion: answer.protocolVersion,\n gatewayBuild: printable(answer.buildVersion),\n };\n })().catch((error: unknown) => {\n negotiated = undefined;\n throw error;\n });\n return negotiated;\n };\n const transport = createGrpcTransport({\n baseUrl: endpoint.origin.origin,\n sessionManager: session,\n readMaxBytes: MAX_MESSAGE_BYTES,\n writeMaxBytes: MAX_MESSAGE_BYTES,\n interceptors: [\n (next) => async (request) => {\n if (closed) throw new Error(\"Gateway client is closed\");\n request.header.set(\"authorization\", authorization);\n request.header.set(PROTOCOL_HEADER, String((await negotiateOnce()).protocolVersion));\n try {\n return await next(request);\n } catch (error) {\n // A Gateway replaced by another release refuses the held version; negotiate again.\n if (protocolRefusal(error)) negotiated = undefined;\n throw error;\n }\n },\n tunnelFailures,\n ],\n });\n return {\n operator: createClient(Operator, transport),\n conversations: createClient(Conversations, transport),\n events: createClient(OperatorEvents, transport),\n objectives: createClient(Objectives, transport),\n inbox: createClient(Inbox, transport),\n workSessions: createClient(WorkSessions, transport),\n teams: createClient(Teams, transport),\n mailbox: createClient(Mailbox, transport),\n liveInputs: createClient(LiveInputs, transport),\n policy: createClient(PolicyCatalog, transport),\n manifestRelationships: createClient(ManifestRelationships, transport),\n surfaces: createClient(SurfacePolicyCatalog, transport),\n workspaces: createClient(Workspaces, transport),\n workspaceCredentials: createClient(WorkspaceCredentials, transport),\n workspaceLandings: createClient(WorkspaceLandings, transport),\n artifacts: createClient(ArtifactCatalog, transport),\n artifactPublications: createClient(ArtifactPublications, transport),\n volumes: createClient(ArtifactVolumes, transport),\n enrollments: createClient(Enrollments, transport),\n memories: createClient(Memories, transport),\n networkLogs: createClient(NetworkLogs, transport),\n schedules: createClient(Schedules, transport),\n taskFiles: createClient(TaskFiles, transport),\n /**\n * Negotiates the protocol version now, without credentials, and returns it. Calls negotiate\n * on their own; this tells whether the Gateway is reachable and compatible before any is\n * made. A Gateway from another release rejects it with {@link ProtocolMismatchError}.\n */\n async negotiate(): Promise<number> {\n return (await negotiateOnce()).protocolVersion;\n },\n /** Negotiates as {@link negotiate} does, and also returns the Gateway's release. */\n negotiation(): Promise<Negotiation> {\n return negotiateOnce();\n },\n close() {\n closed = true;\n session.abort();\n },\n };\n}\n\nexport type GatewayClient = ReturnType<typeof createGatewayClient>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/memories_pb.ts","../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/negotiation_pb.ts","../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/placement_pb.ts","../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/workspace_landings_pb.ts","../src/tunnel.ts","../src/gateway-client.ts"],"names":["fileDesc","serviceDesc","tcpConnect","tlsConnect","isIP"],"mappings":";;;;;;;;;;;;AAaO,IAAM,iCAAA,mBACX,QAAA,CAAS,ovDAAA,EAAsvD,CAAC,gCAAgC,CAAC,CAAA;AAqN5xD,IAA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AA,EAAW,YAAA,CAAa,SAAA,EAAW,SAAS,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM5C,MAAM,SAAA,GAA6B;AACjC,MAAA,OAAA,CAAQ,MAAM,eAAc,EAAG,eAAA;AAAA,IACjC,CAAA;AAAA;AAAA,IAEA,WAAA,GAAoC;AAClC,MAAA,OAAO,aAAA,EAAc;AAAA,IACvB,CAAA;AAAA,IACA,KAAA,GAAQ;AACN,MAAA,MAAA,GAAS,IAAA;AACT,MAAA,OAAA,CAAQ,KAAA,EAAM;AAAA,IAChB;AAAA,GACF;AACF","file":"gateway-client.js","sourcesContent":["// @generated by protoc-gen-es v2.15.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file supertag/runtime/v2/memories.proto (package supertag.runtime.v2, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { BlobReference, NativeMemoryStore, NativeMemoryVolumeHead } from \"./runtime_pb.js\";\nimport { file_supertag_runtime_v2_runtime } from \"./runtime_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file supertag/runtime/v2/memories.proto.\n */\nexport const file_supertag_runtime_v2_memories: GenFile = /*@__PURE__*/\n fileDesc(\"CiJzdXBlcnRhZy9ydW50aW1lL3YyL21lbW9yaWVzLnByb3RvEhNzdXBlcnRhZy5ydW50aW1lLnYyIioKGFJlc2V0TmF0aXZlTWVtb3J5UmVxdWVzdBIOCgZ0YWdfaWQYASABKAkibQoZUmVzZXROYXRpdmVNZW1vcnlSZXNwb25zZRI2CgZzdG9yZXMYASADKAsyJi5zdXBlcnRhZy5ydW50aW1lLnYyLk5hdGl2ZU1lbW9yeVN0b3JlEhgKEHJlc2V0X2dlbmVyYXRpb24YAiABKAQihAEKGVJlcG9ydE5hdGl2ZU1lbW9yeVJlcXVlc3QSEAoIcmV2a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W1lLnYyLlJlcG9ydE5hdGl2ZU1lbW9yeVJlc3BvbnNlEnIKDUFkdmFuY2VOYXRpdmUSLy5zdXBlcnRhZy5ydW50aW1lLnYyLkFkdmFuY2VOYXRpdmVNZW1vcnlSZXF1ZXN0GjAuc3VwZXJ0YWcucnVudGltZS52Mi5BZHZhbmNlTmF0aXZlTWVtb3J5UmVzcG9uc2UShwEKEEFja25vd2xlZGdlU2VlZHMSOC5zdXBlcnRhZy5ydW50aW1lLnYyLkFja25vd2xlZGdlTmF0aXZlTWVtb3J5U2VlZHNSZXF1ZXN0Gjkuc3VwZXJ0YWcucnVudGltZS52Mi5BY2tub3dsZWRnZU5hdGl2ZU1lbW9yeVNlZWRzUmVzcG9uc2ViBnByb3RvMw\", [file_supertag_runtime_v2_runtime]);\n\n/**\n * @generated from message supertag.runtime.v2.ResetNativeMemoryRequest\n */\nexport type ResetNativeMemoryRequest = Message<\"supertag.runtime.v2.ResetNativeMemoryRequest\"> & {\n /**\n * @generated from field: string tag_id = 1;\n */\n tagId: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ResetNativeMemoryRequest.\n * Use `create(ResetNativeMemoryRequestSchema)` to create a new message.\n */\nexport const ResetNativeMemoryRequestSchema: GenMessage<ResetNativeMemoryRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 0);\n\n/**\n * @generated from message supertag.runtime.v2.ResetNativeMemoryResponse\n */\nexport type ResetNativeMemoryResponse = Message<\"supertag.runtime.v2.ResetNativeMemoryResponse\"> & {\n /**\n * The records dropped.\n *\n * @generated from field: repeated supertag.runtime.v2.NativeMemoryStore stores = 1;\n */\n stores: NativeMemoryStore[];\n\n /**\n * @generated from field: uint64 reset_generation = 2;\n */\n resetGeneration: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ResetNativeMemoryResponse.\n * Use `create(ResetNativeMemoryResponseSchema)` to create a new message.\n */\nexport const ResetNativeMemoryResponseSchema: GenMessage<ResetNativeMemoryResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 1);\n\n/**\n * @generated from message supertag.runtime.v2.ReportNativeMemoryRequest\n */\nexport type ReportNativeMemoryRequest = Message<\"supertag.runtime.v2.ReportNativeMemoryRequest\"> & {\n /**\n * Of the store as the host holds it after the turn.\n *\n * @generated from field: uint64 revision = 2;\n */\n revision: bigint;\n\n /**\n * @generated from field: uint32 files = 3;\n */\n files: number;\n\n /**\n * @generated from field: uint64 bytes = 4;\n */\n bytes: bigint;\n\n /**\n * @generated from field: string digest = 5;\n */\n digest: string;\n\n /**\n * The reset generation of the grant the copy was made under.\n *\n * @generated from field: uint64 reset_generation = 6;\n */\n resetGeneration: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ReportNativeMemoryRequest.\n * Use `create(ReportNativeMemoryRequestSchema)` to create a new message.\n */\nexport const ReportNativeMemoryRequestSchema: GenMessage<ReportNativeMemoryRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 2);\n\n/**\n * @generated from message supertag.runtime.v2.ReportNativeMemoryResponse\n */\nexport type ReportNativeMemoryResponse = Message<\"supertag.runtime.v2.ReportNativeMemoryResponse\"> & {\n};\n\n/**\n * Describes the message supertag.runtime.v2.ReportNativeMemoryResponse.\n * Use `create(ReportNativeMemoryResponseSchema)` to create a new message.\n */\nexport const ReportNativeMemoryResponseSchema: GenMessage<ReportNativeMemoryResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 3);\n\n/**\n * @generated from message supertag.runtime.v2.AdvanceNativeMemoryRequest\n */\nexport type AdvanceNativeMemoryRequest = Message<\"supertag.runtime.v2.AdvanceNativeMemoryRequest\"> & {\n /**\n * The head the host merged onto; 0 when the store on the Volume was empty.\n *\n * @generated from field: uint64 expected_revision = 2;\n */\n expectedRevision: bigint;\n\n /**\n * The new manifest, already written to the Volume.\n *\n * @generated from field: supertag.runtime.v2.BlobReference manifest = 3;\n */\n manifest?: BlobReference | undefined;\n\n /**\n * @generated from field: uint32 files = 4;\n */\n files: number;\n\n /**\n * @generated from field: uint64 bytes = 5;\n */\n bytes: bigint;\n\n /**\n * The reset generation of the turn's grant. A store reset since then is not moved.\n *\n * @generated from field: uint64 reset_generation = 6;\n */\n resetGeneration: bigint;\n\n /**\n * Every object the new manifest names, each once. Objects the store no longer names, and the\n * manifest it replaces, are deleted from the Volume.\n *\n * @generated from field: repeated supertag.runtime.v2.BlobReference objects = 7;\n */\n objects: BlobReference[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.AdvanceNativeMemoryRequest.\n * Use `create(AdvanceNativeMemoryRequestSchema)` to create a new message.\n */\nexport const AdvanceNativeMemoryRequestSchema: GenMessage<AdvanceNativeMemoryRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 4);\n\n/**\n * @generated from message supertag.runtime.v2.AdvanceNativeMemoryResponse\n */\nexport type AdvanceNativeMemoryResponse = Message<\"supertag.runtime.v2.AdvanceNativeMemoryResponse\"> & {\n /**\n * Whether the head moved to `manifest`.\n *\n * @generated from field: bool advanced = 1;\n */\n advanced: boolean;\n\n /**\n * The store's head now: the new one, or the one another turn moved it to. Unset while empty.\n *\n * @generated from field: supertag.runtime.v2.NativeMemoryVolumeHead head = 2;\n */\n head?: NativeMemoryVolumeHead | undefined;\n};\n\n/**\n * Describes the message supertag.runtime.v2.AdvanceNativeMemoryResponse.\n * Use `create(AdvanceNativeMemoryResponseSchema)` to create a new message.\n */\nexport const AdvanceNativeMemoryResponseSchema: GenMessage<AdvanceNativeMemoryResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 5);\n\n/**\n * @generated from message supertag.runtime.v2.AcknowledgeNativeMemorySeedsRequest\n */\nexport type AcknowledgeNativeMemorySeedsRequest = Message<\"supertag.runtime.v2.AcknowledgeNativeMemorySeedsRequest\"> & {\n /**\n * The seeds written, by `seed_id`.\n *\n * @generated from field: repeated string seed_ids = 1;\n */\n seedIds: string[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.AcknowledgeNativeMemorySeedsRequest.\n * Use `create(AcknowledgeNativeMemorySeedsRequestSchema)` to create a new message.\n */\nexport const AcknowledgeNativeMemorySeedsRequestSchema: GenMessage<AcknowledgeNativeMemorySeedsRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 6);\n\n/**\n * @generated from message supertag.runtime.v2.AcknowledgeNativeMemorySeedsResponse\n */\nexport type AcknowledgeNativeMemorySeedsResponse = Message<\"supertag.runtime.v2.AcknowledgeNativeMemorySeedsResponse\"> & {\n};\n\n/**\n * Describes the message supertag.runtime.v2.AcknowledgeNativeMemorySeedsResponse.\n * Use `create(AcknowledgeNativeMemorySeedsResponseSchema)` to create a new message.\n */\nexport const AcknowledgeNativeMemorySeedsResponseSchema: GenMessage<AcknowledgeNativeMemorySeedsResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_memories, 7);\n\n/**\n * A Tag's memory is its harness's own memory, such as Claude Code's auto-memory or Codex's\n * memories folder. Worker Hosts keep the files (NativeMemoryStore); the Control Plane never holds\n * them, and people read and delete them on the Worker Host's machine.\n *\n * @generated from service supertag.runtime.v2.Memories\n */\nexport const Memories: GenService<{\n /**\n * Operators only. Drops a Tag's harness-native memory (NativeMemoryStore): every Worker Host\n * deletes its copies before it next runs one of the Tag's Tasks, and the records go now.\n *\n * @generated from rpc supertag.runtime.v2.Memories.ResetNative\n */\n resetNative: {\n methodKind: \"unary\";\n input: typeof ResetNativeMemoryRequestSchema;\n output: typeof ResetNativeMemoryResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_memories, 0);\n\n/**\n * Called by a Worker Host for the turn it runs.\n *\n * @generated from service supertag.runtime.v2.AttemptMemory\n */\nexport const AttemptMemory: GenService<{\n /**\n * After a turn's harness stops, its Worker Host records what it now holds of the store the\n * turn was granted (Assignment.native_memory). Never file contents.\n *\n * @generated from rpc supertag.runtime.v2.AttemptMemory.ReportNative\n */\n reportNative: {\n methodKind: \"unary\";\n input: typeof ReportNativeMemoryRequestSchema;\n output: typeof ReportNativeMemoryResponseSchema;\n },\n /**\n * Moves the turn's store on its Tag's Volume to a new manifest the host has written, when the\n * store is still at `expected_revision`; otherwise it changes nothing and returns the current\n * head, so the host merges again.\n *\n * @generated from rpc supertag.runtime.v2.AttemptMemory.AdvanceNative\n */\n advanceNative: {\n methodKind: \"unary\";\n input: typeof AdvanceNativeMemoryRequestSchema;\n output: typeof AdvanceNativeMemoryResponseSchema;\n },\n /**\n * The host has written the grant's seeds (NativeMemoryGrant.seeds) into the turn's store; the\n * Control Plane drops them and grants them to no later turn.\n *\n * @generated from rpc supertag.runtime.v2.AttemptMemory.AcknowledgeSeeds\n */\n acknowledgeSeeds: {\n methodKind: \"unary\";\n input: typeof AcknowledgeNativeMemorySeedsRequestSchema;\n output: typeof AcknowledgeNativeMemorySeedsResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_memories, 1);\n","// @generated by protoc-gen-es v2.15.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file supertag/runtime/v2/negotiation.proto (package supertag.runtime.v2, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file supertag/runtime/v2/negotiation.proto.\n */\nexport const file_supertag_runtime_v2_negotiation: GenFile = /*@__PURE__*/\n fileDesc(\"CiVzdXBlcnRhZy9ydW50aW1lL3YyL25lZ290aWF0aW9uLnByb3RvEhNzdXBlcnRhZy5ydW50aW1lLnYyInwKGE5lZ290aWF0ZVByb3RvY29sUmVxdWVzdBIuCgRyb2xlGAEgASgOMiAuc3VwZXJ0YWcucnVudGltZS52Mi5TZXJ2aWNlUm9sZRIZChFwcm90b2NvbF92ZXJzaW9ucxgCIAMoDRIVCg1idWlsZF92ZXJzaW9uGAMgASgJIpcBChlOZWdvdGlhdGVQcm90b2NvbFJlc3BvbnNlEi4KBHJvbGUYASABKA4yIC5zdXBlcnRhZy5ydW50aW1lLnYyLlNlcnZpY2VSb2xlEhgKEHByb3RvY29sX3ZlcnNpb24YAiABKA0SGQoRcHJvdG9jb2xfdmVyc2lvbnMYAyADKA0SFQoNYnVpbGRfdmVyc2lvbhgEIAEoCSqcAQoLU2VydmljZVJvbGUSHAoYU0VSVklDRV9ST0xFX1VOU1BFQ0lGSUVEEAASHgoaU0VSVklDRV9ST0xFX0NPTlRST0xfUExBTkUQARIYChRTRVJWSUNFX1JPTEVfR0FURVdBWRACEhwKGFNFUlZJQ0VfUk9MRV9XT1JLRVJfSE9TVBADEhcKE1NFUlZJQ0VfUk9MRV9DTElFTlQQBDKBAQoTUHJvdG9jb2xOZWdvdGlhdGlvbhJqCglOZWdvdGlhdGUSLS5zdXBlcnRhZy5ydW50aW1lLnYyLk5lZ290aWF0ZVByb3RvY29sUmVxdWVzdBouLnN1cGVydGFnLnJ1bnRpbWUudjIuTmVnb3RpYXRlUHJvdG9jb2xSZXNwb25zZWIGcHJvdG8z\");\n\n/**\n * @generated from message supertag.runtime.v2.NegotiateProtocolRequest\n */\nexport type NegotiateProtocolRequest = Message<\"supertag.runtime.v2.NegotiateProtocolRequest\"> & {\n /**\n * The connecting service's role.\n *\n * @generated from field: supertag.runtime.v2.ServiceRole role = 1;\n */\n role: ServiceRole;\n\n /**\n * Every protocol version the connecting service can speak.\n *\n * @generated from field: repeated uint32 protocol_versions = 2;\n */\n protocolVersions: number[];\n\n /**\n * The connecting service's release, for diagnostics only.\n *\n * @generated from field: string build_version = 3;\n */\n buildVersion: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.NegotiateProtocolRequest.\n * Use `create(NegotiateProtocolRequestSchema)` to create a new message.\n */\nexport const NegotiateProtocolRequestSchema: GenMessage<NegotiateProtocolRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_negotiation, 0);\n\n/**\n * @generated from message supertag.runtime.v2.NegotiateProtocolResponse\n */\nexport type NegotiateProtocolResponse = Message<\"supertag.runtime.v2.NegotiateProtocolResponse\"> & {\n /**\n * The answering service's role.\n *\n * @generated from field: supertag.runtime.v2.ServiceRole role = 1;\n */\n role: ServiceRole;\n\n /**\n * The highest protocol version both services speak.\n *\n * @generated from field: uint32 protocol_version = 2;\n */\n protocolVersion: number;\n\n /**\n * Every protocol version the answering service can speak.\n *\n * @generated from field: repeated uint32 protocol_versions = 3;\n */\n protocolVersions: number[];\n\n /**\n * @generated from field: string build_version = 4;\n */\n buildVersion: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.NegotiateProtocolResponse.\n * Use `create(NegotiateProtocolResponseSchema)` to create a new message.\n */\nexport const NegotiateProtocolResponseSchema: GenMessage<NegotiateProtocolResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_negotiation, 1);\n\n/**\n * @generated from enum supertag.runtime.v2.ServiceRole\n */\nexport enum ServiceRole {\n /**\n * @generated from enum value: SERVICE_ROLE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: SERVICE_ROLE_CONTROL_PLANE = 1;\n */\n CONTROL_PLANE = 1,\n\n /**\n * @generated from enum value: SERVICE_ROLE_GATEWAY = 2;\n */\n GATEWAY = 2,\n\n /**\n * @generated from enum value: SERVICE_ROLE_WORKER_HOST = 3;\n */\n WORKER_HOST = 3,\n\n /**\n * A client of the Control Plane's API: the CLI, the desktop app, or\n * an SDK client, acting for an operator or an enrolled client.\n *\n * @generated from enum value: SERVICE_ROLE_CLIENT = 4;\n */\n CLIENT = 4,\n}\n\n/**\n * Describes the enum supertag.runtime.v2.ServiceRole.\n */\nexport const ServiceRoleSchema: GenEnum<ServiceRole> = /*@__PURE__*/\n enumDesc(file_supertag_runtime_v2_negotiation, 0);\n\n/**\n * Each service and operator connection begins with this exchange. A peer that\n * shares no protocol version, or that connects in the wrong role, is refused\n * before it can register, claim, forward work, or make an operator call. The\n * exchange carries no credentials.\n *\n * After negotiating, the client sends the selected version in the\n * `x-supertag-protocol` metadata header on every other call. The Control Plane\n * and Gateway refuse a call without it, or naming a version they do not\n * speak, with FAILED_PRECONDITION. Only this service and the standard gRPC\n * health service are exempt.\n *\n * @generated from service supertag.runtime.v2.ProtocolNegotiation\n */\nexport const ProtocolNegotiation: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.ProtocolNegotiation.Negotiate\n */\n negotiate: {\n methodKind: \"unary\";\n input: typeof NegotiateProtocolRequestSchema;\n output: typeof NegotiateProtocolResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_negotiation, 0);\n","// @generated by protoc-gen-es v2.15.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file supertag/runtime/v2/placement.proto (package supertag.runtime.v2, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { AuthKey, AuthKeySchema, HostPhase, PrincipalRole, TagSchema, TaskState } from \"./runtime_pb.js\";\nimport { file_supertag_runtime_v2_runtime } from \"./runtime_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file supertag/runtime/v2/placement.proto.\n */\nexport const file_supertag_runtime_v2_placement: GenFile = /*@__PURE__*/\n fileDesc(\"CiNzdXBlcnRhZy9ydW50aW1lL3YyL3BsYWNlbWVudC5wcm90bxITc3VwZXJ0YWcucnVudGltZS52MiI2ChFSZW1vdmVVc2VyUmVxdWVzdBIMCgRuYW1lGAEgASgJEhMKC3RyYW5zZmVyX3RvGAIgASgJIpkBChJSZW1vdmVVc2VyUmVzcG9uc2USJwoEdXNlchgBIAEoCzIZLnN1cGVydGFnLnJ1bnRpbWUudjIuVXNlchIbChN0cmFuc2ZlcnJlZF90YWdfaWRzGAIgAygJEiEK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i5HZXRFbnJvbGxtZW50UmVxdWVzdBofLnN1cGVydGFnLnJ1bnRpbWUudjIuRW5yb2xsbWVudBJsCg9MaXN0RW5yb2xsbWVudHMSKy5zdXBlcnRhZy5ydW50aW1lLnYyLkxpc3RFbnJvbGxtZW50c1JlcXVlc3QaLC5zdXBlcnRhZy5ydW50aW1lLnYyLkxpc3RFbnJvbGxtZW50c1Jlc3BvbnNlEmEKEFJldm9rZUVucm9sbG1lbnQSLC5zdXBlcnRhZy5ydW50aW1lLnYyLlJldm9rZUVucm9sbG1lbnRSZXF1ZXN0Gh8uc3VwZXJ0YWcucnVudGltZS52Mi5FbnJvbGxtZW50MngKE0NyZWRlbnRpYWxEaXJlY3RvcnkSYQoHUmVzb2x2ZRItLnN1cGVydGFnLnJ1bnRpbWUudjIuUmVzb2x2ZUNyZWRlbnRpYWxSZXF1ZXN0Gicuc3VwZXJ0YWcucnVudGltZS52Mi5SZXNvbHZlZENyZWRlbnRpYWxiBnByb3RvMw\", [file_supertag_runtime_v2_runtime]);\n\n/**\n * @generated from message supertag.runtime.v2.RemoveUserRequest\n */\nexport type RemoveUserRequest = Message<\"supertag.runtime.v2.RemoveUserRequest\"> & {\n /**\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * The User who takes over the removed User's personal Tags and unfinished Objectives.\n *\n * @generated from field: string transfer_to = 2;\n */\n transferTo: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.RemoveUserRequest.\n * Use `create(RemoveUserRequestSchema)` to create a new message.\n */\nexport const RemoveUserRequestSchema: GenMessage<RemoveUserRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 0);\n\n/**\n * @generated from message supertag.runtime.v2.RemoveUserResponse\n */\nexport type RemoveUserResponse = Message<\"supertag.runtime.v2.RemoveUserResponse\"> & {\n /**\n * @generated from field: supertag.runtime.v2.User user = 1;\n */\n user?: User | undefined;\n\n /**\n * @generated from field: repeated string transferred_tag_ids = 2;\n */\n transferredTagIds: string[];\n\n /**\n * @generated from field: repeated string transferred_objective_ids = 3;\n */\n transferredObjectiveIds: string[];\n\n /**\n * The enrolled devices and Worker Hosts revoked, as `client:NAME` and `host:NAME`.\n *\n * @generated from field: repeated string revoked_principals = 4;\n */\n revokedPrincipals: string[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.RemoveUserResponse.\n * Use `create(RemoveUserResponseSchema)` to create a new message.\n */\nexport const RemoveUserResponseSchema: GenMessage<RemoveUserResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 1);\n\n/**\n * @generated from message supertag.runtime.v2.User\n */\nexport type User = Message<\"supertag.runtime.v2.User\"> & {\n /**\n * 1 to 40 lowercase letters, digits, hyphens or underscores, starting with a letter or digit.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * @generated from field: string display_name = 2;\n */\n displayName: string;\n\n /**\n * @generated from field: int64 created_at_ms = 3;\n */\n createdAtMs: bigint;\n\n /**\n * The Role the User's personal Tag takes; empty means the Control Plane's `personal` Role.\n *\n * @generated from field: string role = 4;\n */\n role: string;\n\n /**\n * Shared Tags the User's devices may talk to, besides the User's own.\n *\n * @generated from field: repeated string allowed_tag_ids = 5;\n */\n allowedTagIds: string[];\n\n /**\n * When the User was removed; their name is never reused.\n *\n * @generated from field: optional int64 removed_at_ms = 6;\n */\n removedAtMs?: bigint | undefined;\n\n /**\n * The User who took over what a removed User owned.\n *\n * @generated from field: string transferred_to = 7;\n */\n transferredTo: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.User.\n * Use `create(UserSchema)` to create a new message.\n */\nexport const UserSchema: GenMessage<User> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 2);\n\n/**\n * @generated from message supertag.runtime.v2.InviteUserRequest\n */\nexport type InviteUserRequest = Message<\"supertag.runtime.v2.InviteUserRequest\"> & {\n /**\n * @generated from field: string operation_id = 1;\n */\n operationId: string;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * Required for a new User; for an existing one, empty keeps it and a value must match.\n *\n * @generated from field: string display_name = 3;\n */\n displayName: string;\n\n /**\n * SHA-256 of the invite key the caller generated.\n *\n * @generated from field: bytes key_digest = 4;\n */\n keyDigest: Uint8Array;\n\n /**\n * Zero means 7 days. At most 90 days.\n *\n * @generated from field: uint64 expires_in_ms = 5;\n */\n expiresInMs: bigint;\n\n /**\n * A new User only: the Role for their personal Tag.\n *\n * @generated from field: string role = 6;\n */\n role: string;\n\n /**\n * A new User only: shared Tags their devices may talk to.\n *\n * @generated from field: repeated string allowed_tag_ids = 7;\n */\n allowedTagIds: string[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.InviteUserRequest.\n * Use `create(InviteUserRequestSchema)` to create a new message.\n */\nexport const InviteUserRequestSchema: GenMessage<InviteUserRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 3);\n\n/**\n * @generated from message supertag.runtime.v2.InviteUserResponse\n */\nexport type InviteUserResponse = Message<\"supertag.runtime.v2.InviteUserResponse\"> & {\n /**\n * @generated from field: supertag.runtime.v2.User user = 1;\n */\n user?: User | undefined;\n\n /**\n * The invite key's record, without its secret. Its `user` names the User.\n *\n * @generated from field: supertag.runtime.v2.AuthKey auth_key = 2;\n */\n authKey?: AuthKey | undefined;\n};\n\n/**\n * Describes the message supertag.runtime.v2.InviteUserResponse.\n * Use `create(InviteUserResponseSchema)` to create a new message.\n */\nexport const InviteUserResponseSchema: GenMessage<InviteUserResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 4);\n\n/**\n * @generated from message supertag.runtime.v2.GetUserRequest\n */\nexport type GetUserRequest = Message<\"supertag.runtime.v2.GetUserRequest\"> & {\n /**\n * @generated from field: string name = 1;\n */\n name: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.GetUserRequest.\n * Use `create(GetUserRequestSchema)` to create a new message.\n */\nexport const GetUserRequestSchema: GenMessage<GetUserRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 5);\n\n/**\n * @generated from message supertag.runtime.v2.ListUsersRequest\n */\nexport type ListUsersRequest = Message<\"supertag.runtime.v2.ListUsersRequest\"> & {\n /**\n * At most this many Users; 0 means 100. At most 500.\n *\n * @generated from field: uint32 limit = 1;\n */\n limit: number;\n\n /**\n * The name of the last User on the previous page.\n *\n * @generated from field: string cursor = 2;\n */\n cursor: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListUsersRequest.\n * Use `create(ListUsersRequestSchema)` to create a new message.\n */\nexport const ListUsersRequestSchema: GenMessage<ListUsersRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 6);\n\n/**\n * @generated from message supertag.runtime.v2.ListUsersResponse\n */\nexport type ListUsersResponse = Message<\"supertag.runtime.v2.ListUsersResponse\"> & {\n /**\n * @generated from field: repeated supertag.runtime.v2.User users = 1;\n */\n users: User[];\n\n /**\n * @generated from field: string next_cursor = 2;\n */\n nextCursor: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListUsersResponse.\n * Use `create(ListUsersResponseSchema)` to create a new message.\n */\nexport const ListUsersResponseSchema: GenMessage<ListUsersResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 7);\n\n/**\n * @generated from message supertag.runtime.v2.RevokeAuthKeyRequest\n */\nexport type RevokeAuthKeyRequest = Message<\"supertag.runtime.v2.RevokeAuthKeyRequest\"> & {\n /**\n * @generated from field: string name = 1;\n */\n name: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.RevokeAuthKeyRequest.\n * Use `create(RevokeAuthKeyRequestSchema)` to create a new message.\n */\nexport const RevokeAuthKeyRequestSchema: GenMessage<RevokeAuthKeyRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 8);\n\n/**\n * @generated from message supertag.runtime.v2.GetAuthKeyRequest\n */\nexport type GetAuthKeyRequest = Message<\"supertag.runtime.v2.GetAuthKeyRequest\"> & {\n /**\n * @generated from field: string name = 1;\n */\n name: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.GetAuthKeyRequest.\n * Use `create(GetAuthKeyRequestSchema)` to create a new message.\n */\nexport const GetAuthKeyRequestSchema: GenMessage<GetAuthKeyRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 9);\n\n/**\n * @generated from message supertag.runtime.v2.ListAuthKeysRequest\n */\nexport type ListAuthKeysRequest = Message<\"supertag.runtime.v2.ListAuthKeysRequest\"> & {\n /**\n * At most this many keys; 0 means 100. At most 500.\n *\n * @generated from field: uint32 limit = 1;\n */\n limit: number;\n\n /**\n * The name of the last key on the previous page.\n *\n * @generated from field: string cursor = 2;\n */\n cursor: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListAuthKeysRequest.\n * Use `create(ListAuthKeysRequestSchema)` to create a new message.\n */\nexport const ListAuthKeysRequestSchema: GenMessage<ListAuthKeysRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 10);\n\n/**\n * @generated from message supertag.runtime.v2.ListAuthKeysResponse\n */\nexport type ListAuthKeysResponse = Message<\"supertag.runtime.v2.ListAuthKeysResponse\"> & {\n /**\n * @generated from field: repeated supertag.runtime.v2.AuthKey auth_keys = 1;\n */\n authKeys: AuthKey[];\n\n /**\n * @generated from field: string next_cursor = 2;\n */\n nextCursor: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListAuthKeysResponse.\n * Use `create(ListAuthKeysResponseSchema)` to create a new message.\n */\nexport const ListAuthKeysResponseSchema: GenMessage<ListAuthKeysResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 11);\n\n/**\n * @generated from message supertag.runtime.v2.EnrollRequest\n */\nexport type EnrollRequest = Message<\"supertag.runtime.v2.EnrollRequest\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * 1 to 250 ASCII letters, digits, hyphens, underscores or dots. The\n * enrollee chooses it; the Auth Key does not fix it.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * @generated from field: string operation_id = 3;\n */\n operationId: string;\n\n /**\n * SHA-256 of the new `stcr_` credential.\n *\n * @generated from field: bytes token_digest = 4;\n */\n tokenDigest: Uint8Array;\n};\n\n/**\n * Describes the message supertag.runtime.v2.EnrollRequest.\n * Use `create(EnrollRequestSchema)` to create a new message.\n */\nexport const EnrollRequestSchema: GenMessage<EnrollRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 12);\n\n/**\n * @generated from message supertag.runtime.v2.Enrollment\n */\nexport type Enrollment = Message<\"supertag.runtime.v2.Enrollment\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * `host:NAME`, `gateway:NAME` or `client:NAME`.\n *\n * @generated from field: string principal = 3;\n */\n principal: string;\n\n /**\n * The Auth Key it enrolled with. Empty for a credential set in the Control\n * Plane's startup configuration.\n *\n * @generated from field: string auth_key_name = 4;\n */\n authKeyName: string;\n\n /**\n * @generated from field: int64 enrolled_at_ms = 5;\n */\n enrolledAtMs: bigint;\n\n /**\n * Refreshed at most once a minute.\n *\n * @generated from field: optional int64 last_used_at_ms = 6;\n */\n lastUsedAtMs?: bigint | undefined;\n\n /**\n * @generated from field: optional int64 revoked_at_ms = 7;\n */\n revokedAtMs?: bigint | undefined;\n\n /**\n * 1 for the first credential; increases with each rotation.\n *\n * @generated from field: uint64 credential_revision = 8;\n */\n credentialRevision: bigint;\n\n /**\n * Clients: the Tags it may talk to. Hosts: the Tags it may run.\n *\n * @generated from field: repeated string allowed_tag_ids = 9;\n */\n allowedTagIds: string[];\n\n /**\n * Every Tag. A Gateway with it serves connector accounts no Surface Account\n * names and delivers the admin operator's notifications.\n *\n * @generated from field: bool all_tags = 10;\n */\n allTags: boolean;\n\n /**\n * The User a client device or Worker Host belongs to: every client has one;\n * a Worker Host enrolled with a host Auth Key has none.\n *\n * @generated from field: string user = 11;\n */\n user: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.Enrollment.\n * Use `create(EnrollmentSchema)` to create a new message.\n */\nexport const EnrollmentSchema: GenMessage<Enrollment> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 13);\n\n/**\n * @generated from message supertag.runtime.v2.WhoAmIRequest\n */\nexport type WhoAmIRequest = Message<\"supertag.runtime.v2.WhoAmIRequest\"> & {\n};\n\n/**\n * Describes the message supertag.runtime.v2.WhoAmIRequest.\n * Use `create(WhoAmIRequestSchema)` to create a new message.\n */\nexport const WhoAmIRequestSchema: GenMessage<WhoAmIRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 14);\n\n/**\n * @generated from message supertag.runtime.v2.WhoAmIResponse\n */\nexport type WhoAmIResponse = Message<\"supertag.runtime.v2.WhoAmIResponse\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * Such as `operator:local`, `operator:token:laptop` or `client:alice-laptop`.\n *\n * @generated from field: string principal = 2;\n */\n principal: string;\n\n /**\n * The admin operator, the only one that manages Operator Tokens.\n *\n * @generated from field: bool admin = 3;\n */\n admin: boolean;\n};\n\n/**\n * Describes the message supertag.runtime.v2.WhoAmIResponse.\n * Use `create(WhoAmIResponseSchema)` to create a new message.\n */\nexport const WhoAmIResponseSchema: GenMessage<WhoAmIResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 15);\n\n/**\n * @generated from message supertag.runtime.v2.RotateCredentialRequest\n */\nexport type RotateCredentialRequest = Message<\"supertag.runtime.v2.RotateCredentialRequest\"> & {\n /**\n * With an empty name, the caller's own credential; the role must then be the\n * caller's. Only operators name another enrollee.\n *\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * The current credential_revision. A repeat of a rotation that already\n * applied, with the same digest, returns the same result.\n *\n * @generated from field: uint64 expected_credential_revision = 3;\n */\n expectedCredentialRevision: bigint;\n\n /**\n * @generated from field: bytes token_digest = 4;\n */\n tokenDigest: Uint8Array;\n};\n\n/**\n * Describes the message supertag.runtime.v2.RotateCredentialRequest.\n * Use `create(RotateCredentialRequestSchema)` to create a new message.\n */\nexport const RotateCredentialRequestSchema: GenMessage<RotateCredentialRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 16);\n\n/**\n * @generated from message supertag.runtime.v2.CredentialRotation\n */\nexport type CredentialRotation = Message<\"supertag.runtime.v2.CredentialRotation\"> & {\n /**\n * @generated from field: string principal = 1;\n */\n principal: string;\n\n /**\n * @generated from field: uint64 credential_revision = 2;\n */\n credentialRevision: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.CredentialRotation.\n * Use `create(CredentialRotationSchema)` to create a new message.\n */\nexport const CredentialRotationSchema: GenMessage<CredentialRotation> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 17);\n\n/**\n * @generated from message supertag.runtime.v2.GetEnrollmentRequest\n */\nexport type GetEnrollmentRequest = Message<\"supertag.runtime.v2.GetEnrollmentRequest\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.GetEnrollmentRequest.\n * Use `create(GetEnrollmentRequestSchema)` to create a new message.\n */\nexport const GetEnrollmentRequestSchema: GenMessage<GetEnrollmentRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 18);\n\n/**\n * @generated from message supertag.runtime.v2.ListEnrollmentsRequest\n */\nexport type ListEnrollmentsRequest = Message<\"supertag.runtime.v2.ListEnrollmentsRequest\"> & {\n /**\n * UNSPECIFIED lists every role.\n *\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * 0 means 100; at most 500.\n *\n * @generated from field: uint32 limit = 2;\n */\n limit: number;\n\n /**\n * The `next_cursor` of the previous page.\n *\n * @generated from field: string cursor = 3;\n */\n cursor: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListEnrollmentsRequest.\n * Use `create(ListEnrollmentsRequestSchema)` to create a new message.\n */\nexport const ListEnrollmentsRequestSchema: GenMessage<ListEnrollmentsRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 19);\n\n/**\n * @generated from message supertag.runtime.v2.ListEnrollmentsResponse\n */\nexport type ListEnrollmentsResponse = Message<\"supertag.runtime.v2.ListEnrollmentsResponse\"> & {\n /**\n * @generated from field: repeated supertag.runtime.v2.Enrollment enrollments = 1;\n */\n enrollments: Enrollment[];\n\n /**\n * @generated from field: string next_cursor = 2;\n */\n nextCursor: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListEnrollmentsResponse.\n * Use `create(ListEnrollmentsResponseSchema)` to create a new message.\n */\nexport const ListEnrollmentsResponseSchema: GenMessage<ListEnrollmentsResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 20);\n\n/**\n * @generated from message supertag.runtime.v2.RevokeEnrollmentRequest\n */\nexport type RevokeEnrollmentRequest = Message<\"supertag.runtime.v2.RevokeEnrollmentRequest\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.RevokeEnrollmentRequest.\n * Use `create(RevokeEnrollmentRequestSchema)` to create a new message.\n */\nexport const RevokeEnrollmentRequestSchema: GenMessage<RevokeEnrollmentRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 21);\n\n/**\n * @generated from message supertag.runtime.v2.ResolveCredentialRequest\n */\nexport type ResolveCredentialRequest = Message<\"supertag.runtime.v2.ResolveCredentialRequest\"> & {\n /**\n * SHA-256 of the presented secret.\n *\n * @generated from field: bytes token_digest = 1;\n */\n tokenDigest: Uint8Array;\n\n /**\n * OPERATOR for an Operator Token; HOST, GATEWAY or CLIENT is never sent:\n * UNSPECIFIED resolves an enrolled credential of any role.\n *\n * @generated from field: supertag.runtime.v2.PrincipalRole kind = 2;\n */\n kind: PrincipalRole;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ResolveCredentialRequest.\n * Use `create(ResolveCredentialRequestSchema)` to create a new message.\n */\nexport const ResolveCredentialRequestSchema: GenMessage<ResolveCredentialRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 22);\n\n/**\n * @generated from message supertag.runtime.v2.ResolvedCredential\n */\nexport type ResolvedCredential = Message<\"supertag.runtime.v2.ResolvedCredential\"> & {\n /**\n * @generated from field: supertag.runtime.v2.PrincipalRole role = 1;\n */\n role: PrincipalRole;\n\n /**\n * The name within the role: `token:NAME` for an Operator Token.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * Hosts: the current registration generation.\n *\n * @generated from field: uint64 generation = 3;\n */\n generation: bigint;\n\n /**\n * Clients and Worker Hosts: the User the enrollment belongs to, if any.\n *\n * @generated from field: string user = 4;\n */\n user: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ResolvedCredential.\n * Use `create(ResolvedCredentialSchema)` to create a new message.\n */\nexport const ResolvedCredentialSchema: GenMessage<ResolvedCredential> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 23);\n\n/**\n * @generated from message supertag.runtime.v2.SetTagRunsOnRequest\n */\nexport type SetTagRunsOnRequest = Message<\"supertag.runtime.v2.SetTagRunsOnRequest\"> & {\n /**\n * @generated from field: string tag_id = 1;\n */\n tagId: string;\n\n /**\n * @generated from field: repeated string runs_on = 2;\n */\n runsOn: string[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.SetTagRunsOnRequest.\n * Use `create(SetTagRunsOnRequestSchema)` to create a new message.\n */\nexport const SetTagRunsOnRequestSchema: GenMessage<SetTagRunsOnRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 24);\n\n/**\n * @generated from message supertag.runtime.v2.DiagnoseTaskPlacementRequest\n */\nexport type DiagnoseTaskPlacementRequest = Message<\"supertag.runtime.v2.DiagnoseTaskPlacementRequest\"> & {\n /**\n * @generated from field: string task_id = 1;\n */\n taskId: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.DiagnoseTaskPlacementRequest.\n * Use `create(DiagnoseTaskPlacementRequestSchema)` to create a new message.\n */\nexport const DiagnoseTaskPlacementRequestSchema: GenMessage<DiagnoseTaskPlacementRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 25);\n\n/**\n * @generated from message supertag.runtime.v2.HostPlacement\n */\nexport type HostPlacement = Message<\"supertag.runtime.v2.HostPlacement\"> & {\n /**\n * @generated from field: string host_id = 1;\n */\n hostId: string;\n\n /**\n * @generated from field: supertag.runtime.v2.HostPhase phase = 2;\n */\n phase: HostPhase;\n\n /**\n * @generated from field: repeated string labels = 3;\n */\n labels: string[];\n\n /**\n * Required labels this host does not carry.\n *\n * @generated from field: repeated string missing_labels = 4;\n */\n missingLabels: string[];\n\n /**\n * Carries every required label. Readiness, capacity and harness still apply.\n *\n * @generated from field: bool eligible = 5;\n */\n eligible: boolean;\n\n /**\n * What keeps this host's lanes for the Task's harness from running it, such as file-scope or\n * unsandboxed-commands, or harness when it runs no such lane. Empty when a lane can.\n *\n * @generated from field: string requirement = 6;\n */\n requirement: string;\n\n /**\n * A readable explanation, or empty when requirement is empty.\n *\n * @generated from field: string reason = 7;\n */\n reason: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.HostPlacement.\n * Use `create(HostPlacementSchema)` to create a new message.\n */\nexport const HostPlacementSchema: GenMessage<HostPlacement> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 26);\n\n/**\n * @generated from message supertag.runtime.v2.TaskPlacementDiagnosis\n */\nexport type TaskPlacementDiagnosis = Message<\"supertag.runtime.v2.TaskPlacementDiagnosis\"> & {\n /**\n * @generated from field: string task_id = 1;\n */\n taskId: string;\n\n /**\n * @generated from field: string tag_id = 2;\n */\n tagId: string;\n\n /**\n * @generated from field: supertag.runtime.v2.TaskState state = 3;\n */\n state: TaskState;\n\n /**\n * The Tag's runsOn, plus workspace:NAME for a Task in a Workspace.\n *\n * @generated from field: repeated string required_labels = 4;\n */\n requiredLabels: string[];\n\n /**\n * Labels no bound host carries; every required label when each exists on\n * some bound host but none carries them all.\n *\n * @generated from field: repeated string missing_labels = 5;\n */\n missingLabels: string[];\n\n /**\n * A scheduling requirement such as labels:macos,gpu. execution-limits,\n * runtime-actions, or context when the Task's harness cannot enforce its\n * accepted limits or actions, or load its required Skills.\n * Empty when nothing found keeps a bound host from taking the Task.\n *\n * @generated from field: string requirement = 6;\n */\n requirement: string;\n\n /**\n * A readable explanation, or empty when requirement is empty.\n *\n * @generated from field: string summary = 7;\n */\n summary: string;\n\n /**\n * Bound, unrevoked Worker Hosts in host ID order.\n *\n * @generated from field: repeated supertag.runtime.v2.HostPlacement hosts = 8;\n */\n hosts: HostPlacement[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.TaskPlacementDiagnosis.\n * Use `create(TaskPlacementDiagnosisSchema)` to create a new message.\n */\nexport const TaskPlacementDiagnosisSchema: GenMessage<TaskPlacementDiagnosis> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_placement, 27);\n\n/**\n * Worker Host placement. Labels narrow the hosts bound to a Tag; they never\n * grant access, and a Task that no bound host can take waits.\n *\n * @generated from service supertag.runtime.v2.Placement\n */\nexport const Placement: GenService<{\n /**\n * Replaces a Tag's runsOn labels. An empty list means any bound host.\n *\n * @generated from rpc supertag.runtime.v2.Placement.SetTagRunsOn\n */\n setTagRunsOn: {\n methodKind: \"unary\";\n input: typeof SetTagRunsOnRequestSchema;\n output: typeof TagSchema;\n },\n /**\n * Explains which bound Worker Hosts can take a Task, and why the others cannot.\n *\n * @generated from rpc supertag.runtime.v2.Placement.DiagnoseTask\n */\n diagnoseTask: {\n methodKind: \"unary\";\n input: typeof DiagnoseTaskPlacementRequestSchema;\n output: typeof TaskPlacementDiagnosisSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_placement, 0);\n\n/**\n * Auth Key lifecycle beyond creation. Keys are named by the operator, and a\n * name is never reused. Revocation blocks new joins, including replays of\n * earlier joins; principals that already joined keep their enrollment.\n *\n * @generated from service supertag.runtime.v2.AuthKeys\n */\nexport const AuthKeys: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.AuthKeys.RevokeAuthKey\n */\n revokeAuthKey: {\n methodKind: \"unary\";\n input: typeof RevokeAuthKeyRequestSchema;\n output: typeof AuthKeySchema;\n },\n /**\n * Revoked, expired and used keys included, the earliest created first, then by name.\n *\n * @generated from rpc supertag.runtime.v2.AuthKeys.ListAuthKeys\n */\n listAuthKeys: {\n methodKind: \"unary\";\n input: typeof ListAuthKeysRequestSchema;\n output: typeof ListAuthKeysResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.AuthKeys.GetAuthKey\n */\n getAuthKey: {\n methodKind: \"unary\";\n input: typeof GetAuthKeyRequestSchema;\n output: typeof AuthKeySchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_placement, 1);\n\n/**\n * People admitted to the Control Plane. A User is a person, never a machine: every client device\n * belongs to one, and a Worker Host enrolled with a User's invite key belongs to them.\n *\n * @generated from service supertag.runtime.v2.Users\n */\nexport const Users: GenService<{\n /**\n * Creates the User, or finds an existing one, and issues a new invite key: a reusable Auth Key\n * that enrolls the User's client devices and Worker Hosts.\n *\n * @generated from rpc supertag.runtime.v2.Users.InviteUser\n */\n inviteUser: {\n methodKind: \"unary\";\n input: typeof InviteUserRequestSchema;\n output: typeof InviteUserResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.Users.GetUser\n */\n getUser: {\n methodKind: \"unary\";\n input: typeof GetUserRequestSchema;\n output: typeof UserSchema;\n },\n /**\n * By name, removed Users included.\n *\n * @generated from rpc supertag.runtime.v2.Users.ListUsers\n */\n listUsers: {\n methodKind: \"unary\";\n input: typeof ListUsersRequestSchema;\n output: typeof ListUsersResponseSchema;\n },\n /**\n * Revokes every device, Worker Host, and invite key of the User at once, and moves their\n * personal Tags and unfinished Objectives to `transfer_to`. Refused while the User owns\n * anything and names no one to take it. Removing a removed User changes nothing.\n *\n * @generated from rpc supertag.runtime.v2.Users.RemoveUser\n */\n removeUser: {\n methodKind: \"unary\";\n input: typeof RemoveUserRequestSchema;\n output: typeof RemoveUserResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_placement, 2);\n\n/**\n * Joining a deployment, and the credentials joining issues. A host, Gateway or\n * client enrolls once with an Auth Key of its role and from then on presents\n * its own credential, `stcr_` and 64 hex digits, as the bearer. Only the\n * credential's SHA-256 digest is stored; the enrollee generates the secret, so\n * the Control Plane never receives it. Principals are `host:NAME`,\n * `gateway:NAME` and `client:NAME`; names are never reused within a role.\n *\n * @generated from service supertag.runtime.v2.Enrollments\n */\nexport const Enrollments: GenService<{\n /**\n * Presented with an Auth Key (`stak_` and 64 hex digits) as the bearer: the\n * only call that accepts one. The request's role must equal the key's.\n * Repeating an enrollment with the same operation ID, name and digest returns\n * the same enrollment, until the key is revoked.\n *\n * @generated from rpc supertag.runtime.v2.Enrollments.Enroll\n */\n enroll: {\n methodKind: \"unary\";\n input: typeof EnrollRequestSchema;\n output: typeof EnrollmentSchema;\n },\n /**\n * The caller's own principal.\n *\n * @generated from rpc supertag.runtime.v2.Enrollments.WhoAmI\n */\n whoAmI: {\n methodKind: \"unary\";\n input: typeof WhoAmIRequestSchema;\n output: typeof WhoAmIResponseSchema;\n },\n /**\n * Replaces an enrolled credential. An enrollee rotates its own (empty name);\n * an operator rotates any. The previous credential stops working at once,\n * including for open streams.\n *\n * @generated from rpc supertag.runtime.v2.Enrollments.RotateCredential\n */\n rotateCredential: {\n methodKind: \"unary\";\n input: typeof RotateCredentialRequestSchema;\n output: typeof CredentialRotationSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.Enrollments.GetEnrollment\n */\n getEnrollment: {\n methodKind: \"unary\";\n input: typeof GetEnrollmentRequestSchema;\n output: typeof EnrollmentSchema;\n },\n /**\n * By role, then name.\n *\n * @generated from rpc supertag.runtime.v2.Enrollments.ListEnrollments\n */\n listEnrollments: {\n methodKind: \"unary\";\n input: typeof ListEnrollmentsRequestSchema;\n output: typeof ListEnrollmentsResponseSchema;\n },\n /**\n * Idempotent. The credential is refused from then on, including by calls and\n * streams already in progress. Revoking a host also fences its execution.\n *\n * @generated from rpc supertag.runtime.v2.Enrollments.RevokeEnrollment\n */\n revokeEnrollment: {\n methodKind: \"unary\";\n input: typeof RevokeEnrollmentRequestSchema;\n output: typeof EnrollmentSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_placement, 3);\n\n/**\n * Internal to the Control Plane: its API tier resolves the digest of a\n * presented Operator Token or enrolled credential with the state owner.\n *\n * @generated from service supertag.runtime.v2.CredentialDirectory\n */\nexport const CredentialDirectory: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.CredentialDirectory.Resolve\n */\n resolve: {\n methodKind: \"unary\";\n input: typeof ResolveCredentialRequestSchema;\n output: typeof ResolvedCredentialSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_placement, 4);\n","// @generated by protoc-gen-es v2.15.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file supertag/runtime/v2/workspace_landings.proto (package supertag.runtime.v2, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { BlobHolder, TaskSchema, WorkspaceDeliveryReference } from \"./runtime_pb.js\";\nimport { file_supertag_runtime_v2_runtime } from \"./runtime_pb.js\";\nimport type { Workspace } from \"./workspaces_pb.js\";\nimport { file_supertag_runtime_v2_workspaces } from \"./workspaces_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file supertag/runtime/v2/workspace_landings.proto.\n */\nexport const file_supertag_runtime_v2_workspace_landings: GenFile = /*@__PURE__*/\n fileDesc(\"CixzdXBlcnRhZy9ydW50aW1lL3YyL3dvcmtzcGFjZV9sYW5kaW5ncy5wcm90bxITc3VwZXJ0YWcucnVudGltZS52MiKSBQoQV29ya3NwYWNlTGFuZGluZxISCgpsYW5kaW5nX2lkGAEgASgJEg8KB3Rhc2tfaWQYAiABKAkSDgoGdGFnX2lkGAMgASgJEhIKCnNlc3Npb25faWQYBCABKAkSFAoMd29ya3NwYWNlX2lkGAUgASgJEg4KBnJlbW90ZRgGIAEoCRI3CgRtb2RlGAcgASgOMikuc3VwZXJ0YWcucnVudGltZS52Mi5Xb3Jrc3BhY2VMYW5kaW5nTW9kZRIOCgZicmFuY2gYCCABKAkSDgoGdGFyZ2V0GAkgASgJEkEKCGRlbGl2ZXJ5GAogASgLMi8uc3VwZXJ0YWcucnVudGltZS52Mi5Xb3Jrc3BhY2VEZWxpdmVyeVJlZmVyZW5jZRI5CgVzdGF0ZRgLIAEoDjIqLnN1cGVydGFnLnJ1bnRpbWUudjIuV29ya3NwYWNlTGFuZGluZ1N0YXRlEg4KBnJlYXNvbhgMIAEoCRIVCg1sYW5kZWRfY29tbWl0GA0gASgJEhUKDXRhcmdldF9jb21taXQYDiABKAkSEQoJY29uZmxpY3RzGA8gAygJEh4KEWZvbGxvd191cF90YXNrX2lkGBAgASgJSACIAQESFQoNY3JlYXRlZF9vcmRlchgRIAEoAxITCgthdXRob3JfbmFtZRgSIAEoCRIUCgxhdXRob3JfZW1haWwYEyABKAkSEQoJY29fYXV0aG9yGBQgASgJEg0KBXRpdGxlGBUgASgJEgwKBGJvZHkYFiABKAkSPwoMcHVsbF9yZXF1ZXN0GBcg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kxpc3RVbnZlcmlmaWVkTGFuZGluZ3NSZXNwb25zZRJyChJSZWNvcmRWZXJpZmljYXRpb24SNS5zdXBlcnRhZy5ydW50aW1lLnYyLlJlY29yZExhbmRpbmdWZXJpZmljYXRpb25SZXF1ZXN0GiUuc3VwZXJ0YWcucnVudGltZS52Mi5Xb3Jrc3BhY2VMYW5kaW5nYgZwcm90bzM\", [file_supertag_runtime_v2_runtime, file_supertag_runtime_v2_workspaces]);\n\n/**\n * @generated from message supertag.runtime.v2.WorkspaceLanding\n */\nexport type WorkspaceLanding = Message<\"supertag.runtime.v2.WorkspaceLanding\"> & {\n /**\n * @generated from field: string landing_id = 1;\n */\n landingId: string;\n\n /**\n * @generated from field: string task_id = 2;\n */\n taskId: string;\n\n /**\n * @generated from field: string tag_id = 3;\n */\n tagId: string;\n\n /**\n * @generated from field: string session_id = 4;\n */\n sessionId: string;\n\n /**\n * @generated from field: string workspace_id = 5;\n */\n workspaceId: string;\n\n /**\n * @generated from field: string remote = 6;\n */\n remote: string;\n\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceLandingMode mode = 7;\n */\n mode: WorkspaceLandingMode;\n\n /**\n * The Session's branch, `supertag/session/ID`.\n *\n * @generated from field: string branch = 8;\n */\n branch: string;\n\n /**\n * The merge target, or the pull request's base in review mode; empty for branch mode.\n *\n * @generated from field: string target = 9;\n */\n target: string;\n\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceDeliveryReference delivery = 10;\n */\n delivery?: WorkspaceDeliveryReference | undefined;\n\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceLandingState state = 11;\n */\n state: WorkspaceLandingState;\n\n /**\n * @generated from field: string reason = 12;\n */\n reason: string;\n\n /**\n * Landed: the commit the Session's branch (branch mode) or the target (merge mode) names.\n *\n * @generated from field: string landed_commit = 13;\n */\n landedCommit: string;\n\n /**\n * Conflict: the target commit the Session must merge, and the conflicting paths.\n *\n * @generated from field: string target_commit = 14;\n */\n targetCommit: string;\n\n /**\n * @generated from field: repeated string conflicts = 15;\n */\n conflicts: string[];\n\n /**\n * @generated from field: optional string follow_up_task_id = 16;\n */\n followUpTaskId?: string | undefined;\n\n /**\n * @generated from field: int64 created_order = 17;\n */\n createdOrder: bigint;\n\n /**\n * A merge commit's author: the Tag's name and a SuperTag no-reply address.\n *\n * @generated from field: string author_name = 18;\n */\n authorName: string;\n\n /**\n * @generated from field: string author_email = 19;\n */\n authorEmail: string;\n\n /**\n * The requester, as a `Co-authored-by` trailer value. Empty when there is none.\n *\n * @generated from field: string co_author = 20;\n */\n coAuthor: string;\n\n /**\n * Review mode: the pull request's title and description for this delivery.\n *\n * @generated from field: string title = 21;\n */\n title: string;\n\n /**\n * @generated from field: string body = 22;\n */\n body: string;\n\n /**\n * Review mode, once landed: the pull request the Session's branch is reviewed in.\n *\n * @generated from field: supertag.runtime.v2.WorkspacePullRequest pull_request = 23;\n */\n pullRequest?: WorkspacePullRequest | undefined;\n};\n\n/**\n * Describes the message supertag.runtime.v2.WorkspaceLanding.\n * Use `create(WorkspaceLandingSchema)` to create a new message.\n */\nexport const WorkspaceLandingSchema: GenMessage<WorkspaceLanding> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 0);\n\n/**\n * A pull request a review landing opened or updated.\n *\n * @generated from message supertag.runtime.v2.WorkspacePullRequest\n */\nexport type WorkspacePullRequest = Message<\"supertag.runtime.v2.WorkspacePullRequest\"> & {\n /**\n * The forge's repository, as `OWNER/NAME`, and its numeric ID.\n *\n * @generated from field: string repository = 1;\n */\n repository: string;\n\n /**\n * @generated from field: uint64 repository_id = 2;\n */\n repositoryId: bigint;\n\n /**\n * @generated from field: uint64 number = 3;\n */\n number: bigint;\n\n /**\n * @generated from field: string url = 4;\n */\n url: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.WorkspacePullRequest.\n * Use `create(WorkspacePullRequestSchema)` to create a new message.\n */\nexport const WorkspacePullRequestSchema: GenMessage<WorkspacePullRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 1);\n\n/**\n * @generated from message supertag.runtime.v2.GetWorkspaceLandingRequest\n */\nexport type GetWorkspaceLandingRequest = Message<\"supertag.runtime.v2.GetWorkspaceLandingRequest\"> & {\n /**\n * @generated from field: string landing_id = 1;\n */\n landingId: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.GetWorkspaceLandingRequest.\n * Use `create(GetWorkspaceLandingRequestSchema)` to create a new message.\n */\nexport const GetWorkspaceLandingRequestSchema: GenMessage<GetWorkspaceLandingRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 2);\n\n/**\n * @generated from message supertag.runtime.v2.ReturnLandingConflictRequest\n */\nexport type ReturnLandingConflictRequest = Message<\"supertag.runtime.v2.ReturnLandingConflictRequest\"> & {\n /**\n * @generated from field: string operation_id = 1;\n */\n operationId: string;\n\n /**\n * @generated from field: string tag_id = 2;\n */\n tagId: string;\n\n /**\n * @generated from field: string session_id = 3;\n */\n sessionId: string;\n\n /**\n * The merge target, the commit it named, and the conflicting paths.\n *\n * @generated from field: string target = 4;\n */\n target: string;\n\n /**\n * @generated from field: string target_commit = 5;\n */\n targetCommit: string;\n\n /**\n * @generated from field: repeated string conflicts = 6;\n */\n conflicts: string[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.ReturnLandingConflictRequest.\n * Use `create(ReturnLandingConflictRequestSchema)` to create a new message.\n */\nexport const ReturnLandingConflictRequestSchema: GenMessage<ReturnLandingConflictRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 3);\n\n/**\n * @generated from message supertag.runtime.v2.ListWorkspaceLandingsRequest\n */\nexport type ListWorkspaceLandingsRequest = Message<\"supertag.runtime.v2.ListWorkspaceLandingsRequest\"> & {\n /**\n * @generated from field: string task_id = 1;\n */\n taskId: string;\n\n /**\n * @generated from field: uint32 limit = 2;\n */\n limit: number;\n\n /**\n * @generated from field: int64 before_order = 3;\n */\n beforeOrder: bigint;\n\n /**\n * @generated from field: string session_id = 4;\n */\n sessionId: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListWorkspaceLandingsRequest.\n * Use `create(ListWorkspaceLandingsRequestSchema)` to create a new message.\n */\nexport const ListWorkspaceLandingsRequestSchema: GenMessage<ListWorkspaceLandingsRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 4);\n\n/**\n * @generated from message supertag.runtime.v2.ListWorkspaceLandingsResponse\n */\nexport type ListWorkspaceLandingsResponse = Message<\"supertag.runtime.v2.ListWorkspaceLandingsResponse\"> & {\n /**\n * @generated from field: repeated supertag.runtime.v2.WorkspaceLanding landings = 1;\n */\n landings: WorkspaceLanding[];\n\n /**\n * @generated from field: int64 next_before_order = 2;\n */\n nextBeforeOrder: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListWorkspaceLandingsResponse.\n * Use `create(ListWorkspaceLandingsResponseSchema)` to create a new message.\n */\nexport const ListWorkspaceLandingsResponseSchema: GenMessage<ListWorkspaceLandingsResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 5);\n\n/**\n * A Session's source, pinned once: every Task of the Session starts from the same commit.\n *\n * @generated from message supertag.runtime.v2.WorkspaceSourcePin\n */\nexport type WorkspaceSourcePin = Message<\"supertag.runtime.v2.WorkspaceSourcePin\"> & {\n /**\n * @generated from field: string pin_id = 1;\n */\n pinId: string;\n\n /**\n * @generated from field: string tag_id = 2;\n */\n tagId: string;\n\n /**\n * @generated from field: string session_id = 3;\n */\n sessionId: string;\n\n /**\n * @generated from field: supertag.runtime.v2.Workspace selector = 4;\n */\n selector?: Workspace | undefined;\n\n /**\n * @generated from field: string selector_digest = 5;\n */\n selectorDigest: string;\n\n /**\n * @generated from field: supertag.runtime.v2.Workspace resolved = 6;\n */\n resolved?: Workspace | undefined;\n\n /**\n * @generated from field: uint64 created_order = 7;\n */\n createdOrder: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.WorkspaceSourcePin.\n * Use `create(WorkspaceSourcePinSchema)` to create a new message.\n */\nexport const WorkspaceSourcePinSchema: GenMessage<WorkspaceSourcePin> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 6);\n\n/**\n * @generated from message supertag.runtime.v2.ListPendingWorkspaceSourcesRequest\n */\nexport type ListPendingWorkspaceSourcesRequest = Message<\"supertag.runtime.v2.ListPendingWorkspaceSourcesRequest\"> & {\n /**\n * @generated from field: uint64 after_order = 1;\n */\n afterOrder: bigint;\n\n /**\n * @generated from field: uint32 limit = 2;\n */\n limit: number;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListPendingWorkspaceSourcesRequest.\n * Use `create(ListPendingWorkspaceSourcesRequestSchema)` to create a new message.\n */\nexport const ListPendingWorkspaceSourcesRequestSchema: GenMessage<ListPendingWorkspaceSourcesRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 7);\n\n/**\n * @generated from message supertag.runtime.v2.ListPendingWorkspaceSourcesResponse\n */\nexport type ListPendingWorkspaceSourcesResponse = Message<\"supertag.runtime.v2.ListPendingWorkspaceSourcesResponse\"> & {\n /**\n * @generated from field: repeated supertag.runtime.v2.WorkspaceSourcePin pins = 1;\n */\n pins: WorkspaceSourcePin[];\n\n /**\n * @generated from field: uint64 next_after_order = 2;\n */\n nextAfterOrder: bigint;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListPendingWorkspaceSourcesResponse.\n * Use `create(ListPendingWorkspaceSourcesResponseSchema)` to create a new message.\n */\nexport const ListPendingWorkspaceSourcesResponseSchema: GenMessage<ListPendingWorkspaceSourcesResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 8);\n\n/**\n * @generated from message supertag.runtime.v2.PinWorkspaceSourceRequest\n */\nexport type PinWorkspaceSourceRequest = Message<\"supertag.runtime.v2.PinWorkspaceSourceRequest\"> & {\n /**\n * @generated from field: string pin_id = 1;\n */\n pinId: string;\n\n /**\n * @generated from field: string selector_digest = 2;\n */\n selectorDigest: string;\n\n /**\n * @generated from field: string resolved_ref = 3;\n */\n resolvedRef: string;\n\n /**\n * @generated from field: string commit = 4;\n */\n commit: string;\n\n /**\n * Set instead of a commit when the source cannot be read; the Session's queued Tasks fail\n * with it.\n *\n * @generated from field: string error = 5;\n */\n error: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.PinWorkspaceSourceRequest.\n * Use `create(PinWorkspaceSourceRequestSchema)` to create a new message.\n */\nexport const PinWorkspaceSourceRequestSchema: GenMessage<PinWorkspaceSourceRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 9);\n\n/**\n * @generated from message supertag.runtime.v2.ListUnverifiedLandingsRequest\n */\nexport type ListUnverifiedLandingsRequest = Message<\"supertag.runtime.v2.ListUnverifiedLandingsRequest\"> & {\n /**\n * @generated from field: uint32 limit = 1;\n */\n limit: number;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListUnverifiedLandingsRequest.\n * Use `create(ListUnverifiedLandingsRequestSchema)` to create a new message.\n */\nexport const ListUnverifiedLandingsRequestSchema: GenMessage<ListUnverifiedLandingsRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 10);\n\n/**\n * @generated from message supertag.runtime.v2.ListUnverifiedLandingsResponse\n */\nexport type ListUnverifiedLandingsResponse = Message<\"supertag.runtime.v2.ListUnverifiedLandingsResponse\"> & {\n /**\n * @generated from field: repeated supertag.runtime.v2.UnverifiedLanding landings = 1;\n */\n landings: UnverifiedLanding[];\n};\n\n/**\n * Describes the message supertag.runtime.v2.ListUnverifiedLandingsResponse.\n * Use `create(ListUnverifiedLandingsResponseSchema)` to create a new message.\n */\nexport const ListUnverifiedLandingsResponseSchema: GenMessage<ListUnverifiedLandingsResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 11);\n\n/**\n * @generated from message supertag.runtime.v2.UnverifiedLanding\n */\nexport type UnverifiedLanding = Message<\"supertag.runtime.v2.UnverifiedLanding\"> & {\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceLanding landing = 1;\n */\n landing?: WorkspaceLanding | undefined;\n\n /**\n * The remote Workspace as the landing's Task recorded it, to read the branch with.\n *\n * @generated from field: supertag.runtime.v2.Workspace workspace = 2;\n */\n workspace?: Workspace | undefined;\n};\n\n/**\n * Describes the message supertag.runtime.v2.UnverifiedLanding.\n * Use `create(UnverifiedLandingSchema)` to create a new message.\n */\nexport const UnverifiedLandingSchema: GenMessage<UnverifiedLanding> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 12);\n\n/**\n * @generated from message supertag.runtime.v2.RecordLandingVerificationRequest\n */\nexport type RecordLandingVerificationRequest = Message<\"supertag.runtime.v2.RecordLandingVerificationRequest\"> & {\n /**\n * @generated from field: string landing_id = 1;\n */\n landingId: string;\n\n /**\n * The commit the remote's Session branch names; empty when the branch is missing.\n *\n * @generated from field: string remote_commit = 2;\n */\n remoteCommit: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.RecordLandingVerificationRequest.\n * Use `create(RecordLandingVerificationRequestSchema)` to create a new message.\n */\nexport const RecordLandingVerificationRequestSchema: GenMessage<RecordLandingVerificationRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 13);\n\n/**\n * @generated from message supertag.runtime.v2.ClaimWorkspaceLandingRequest\n */\nexport type ClaimWorkspaceLandingRequest = Message<\"supertag.runtime.v2.ClaimWorkspaceLandingRequest\"> & {\n /**\n * @generated from field: string operation_id = 1;\n */\n operationId: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ClaimWorkspaceLandingRequest.\n * Use `create(ClaimWorkspaceLandingRequestSchema)` to create a new message.\n */\nexport const ClaimWorkspaceLandingRequestSchema: GenMessage<ClaimWorkspaceLandingRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 14);\n\n/**\n * @generated from message supertag.runtime.v2.WorkspaceLandingLease\n */\nexport type WorkspaceLandingLease = Message<\"supertag.runtime.v2.WorkspaceLandingLease\"> & {\n /**\n * @generated from field: string landing_id = 1;\n */\n landingId: string;\n\n /**\n * @generated from field: string lease_token = 2;\n */\n leaseToken: string;\n};\n\n/**\n * Describes the message supertag.runtime.v2.WorkspaceLandingLease.\n * Use `create(WorkspaceLandingLeaseSchema)` to create a new message.\n */\nexport const WorkspaceLandingLeaseSchema: GenMessage<WorkspaceLandingLease> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 15);\n\n/**\n * @generated from message supertag.runtime.v2.ClaimWorkspaceLandingResponse\n */\nexport type ClaimWorkspaceLandingResponse = Message<\"supertag.runtime.v2.ClaimWorkspaceLandingResponse\"> & {\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceLanding landing = 1;\n */\n landing?: WorkspaceLanding | undefined;\n\n /**\n * @generated from field: string lease_token = 2;\n */\n leaseToken: string;\n\n /**\n * @generated from field: uint64 valid_for_ms = 3;\n */\n validForMs: bigint;\n\n /**\n * A Worker Host's claims only: the Attempt whose Workspace state on the claiming host holds\n * the delivered commit.\n *\n * @generated from field: supertag.runtime.v2.BlobHolder holder = 4;\n */\n holder?: BlobHolder | undefined;\n\n /**\n * Git delivery's claims only: the push credential's name, which its review adapter uses.\n *\n * @generated from field: string credential = 5;\n */\n credential: string;\n\n /**\n * A Worker Host's claims and renewals only: the remote Workspace as the landing's Task\n * recorded it, whose push credential `WorkspaceGitAccess.Mint` grants for the lease.\n *\n * @generated from field: supertag.runtime.v2.Workspace workspace = 6;\n */\n workspace?: Workspace | undefined;\n};\n\n/**\n * Describes the message supertag.runtime.v2.ClaimWorkspaceLandingResponse.\n * Use `create(ClaimWorkspaceLandingResponseSchema)` to create a new message.\n */\nexport const ClaimWorkspaceLandingResponseSchema: GenMessage<ClaimWorkspaceLandingResponse> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 16);\n\n/**\n * @generated from message supertag.runtime.v2.RecordWorkspaceLandingRequest\n */\nexport type RecordWorkspaceLandingRequest = Message<\"supertag.runtime.v2.RecordWorkspaceLandingRequest\"> & {\n /**\n * @generated from field: supertag.runtime.v2.WorkspaceLandingLease lease = 1;\n */\n lease?: WorkspaceLandingLease | undefined;\n\n /**\n * @generated from field: string operation_id = 2;\n */\n operationId: string;\n\n /**\n * Queued (retry later), Landed, Conflict, or Held.\n *\n * @generated from field: supertag.runtime.v2.WorkspaceLandingState state = 3;\n */\n state: WorkspaceLandingState;\n\n /**\n * @generated from field: string reason = 4;\n */\n reason: string;\n\n /**\n * @generated from field: string landed_commit = 5;\n */\n landedCommit: string;\n\n /**\n * @generated from field: string target_commit = 6;\n */\n targetCommit: string;\n\n /**\n * @generated from field: repeated string conflicts = 7;\n */\n conflicts: string[];\n\n /**\n * Queued only: how long to wait before the next try.\n *\n * @generated from field: uint64 retry_after_ms = 8;\n */\n retryAfterMs: bigint;\n\n /**\n * Landed in review mode: the pull request opened or updated.\n *\n * @generated from field: supertag.runtime.v2.WorkspacePullRequest pull_request = 9;\n */\n pullRequest?: WorkspacePullRequest | undefined;\n};\n\n/**\n * Describes the message supertag.runtime.v2.RecordWorkspaceLandingRequest.\n * Use `create(RecordWorkspaceLandingRequestSchema)` to create a new message.\n */\nexport const RecordWorkspaceLandingRequestSchema: GenMessage<RecordWorkspaceLandingRequest> = /*@__PURE__*/\n messageDesc(file_supertag_runtime_v2_workspace_landings, 17);\n\n/**\n * @generated from enum supertag.runtime.v2.WorkspaceLandingMode\n */\nexport enum WorkspaceLandingMode {\n /**\n * @generated from enum value: WORKSPACE_LANDING_MODE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: WORKSPACE_LANDING_MODE_BRANCH = 1;\n */\n BRANCH = 1,\n\n /**\n * @generated from enum value: WORKSPACE_LANDING_MODE_MERGE = 2;\n */\n MERGE = 2,\n\n /**\n * @generated from enum value: WORKSPACE_LANDING_MODE_REVIEW = 3;\n */\n REVIEW = 3,\n}\n\n/**\n * Describes the enum supertag.runtime.v2.WorkspaceLandingMode.\n */\nexport const WorkspaceLandingModeSchema: GenEnum<WorkspaceLandingMode> = /*@__PURE__*/\n enumDesc(file_supertag_runtime_v2_workspace_landings, 0);\n\n/**\n * @generated from enum supertag.runtime.v2.WorkspaceLandingState\n */\nexport enum WorkspaceLandingState {\n /**\n * @generated from enum value: WORKSPACE_LANDING_STATE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Waiting for git delivery, or for the Worker Host holding the delivery to reconnect.\n *\n * @generated from enum value: WORKSPACE_LANDING_STATE_QUEUED = 1;\n */\n QUEUED = 1,\n\n /**\n * @generated from enum value: WORKSPACE_LANDING_STATE_CLAIMED = 2;\n */\n CLAIMED = 2,\n\n /**\n * @generated from enum value: WORKSPACE_LANDING_STATE_LANDED = 3;\n */\n LANDED = 3,\n\n /**\n * The Session's changes conflict with the target. Nothing was pushed to the target, and the\n * Session received a follow-up Task to merge the target and resolve the conflicts.\n *\n * @generated from enum value: WORKSPACE_LANDING_STATE_CONFLICT = 4;\n */\n CONFLICT = 4,\n\n /**\n * Refused until someone acts, such as a branch moved outside SuperTag or a missing credential.\n *\n * @generated from enum value: WORKSPACE_LANDING_STATE_HELD = 5;\n */\n HELD = 5,\n\n /**\n * A newer delivery of the same Session replaced it before it landed.\n *\n * @generated from enum value: WORKSPACE_LANDING_STATE_SUPERSEDED = 6;\n */\n SUPERSEDED = 6,\n}\n\n/**\n * Describes the enum supertag.runtime.v2.WorkspaceLandingState.\n */\nexport const WorkspaceLandingStateSchema: GenEnum<WorkspaceLandingState> = /*@__PURE__*/\n enumDesc(file_supertag_runtime_v2_workspace_landings, 1);\n\n/**\n * Operators see where each Session's changes landed, separately from the Task's own result:\n * a Task succeeds whether or not its changes reached the remote.\n *\n * @generated from service supertag.runtime.v2.WorkspaceLandings\n */\nexport const WorkspaceLandings: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.WorkspaceLandings.Get\n */\n get: {\n methodKind: \"unary\";\n input: typeof GetWorkspaceLandingRequestSchema;\n output: typeof WorkspaceLandingSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.WorkspaceLandings.List\n */\n list: {\n methodKind: \"unary\";\n input: typeof ListWorkspaceLandingsRequestSchema;\n output: typeof ListWorkspaceLandingsResponseSchema;\n },\n /**\n * A local Workspace's merge, which `supertag up` makes in the operator's own repository,\n * conflicted: the Session receives a follow-up Task that merges the target and resolves it.\n *\n * @generated from rpc supertag.runtime.v2.WorkspaceLandings.ReturnConflict\n */\n returnConflict: {\n methodKind: \"unary\";\n input: typeof ReturnLandingConflictRequestSchema;\n output: typeof TaskSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_workspace_landings, 0);\n\n/**\n * The Worker Host holding a delivery lands it: it pushes the Session's branch, and in merge mode\n * merges it into the target, from its own copy of the delivered commit, with credentials the\n * Control Plane mints for the one push. A host claims only landings of deliveries it holds.\n *\n * @generated from service supertag.runtime.v2.HostLandings\n */\nexport const HostLandings: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.HostLandings.Claim\n */\n claim: {\n methodKind: \"unary\";\n input: typeof ClaimWorkspaceLandingRequestSchema;\n output: typeof ClaimWorkspaceLandingResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.HostLandings.Renew\n */\n renew: {\n methodKind: \"unary\";\n input: typeof WorkspaceLandingLeaseSchema;\n output: typeof ClaimWorkspaceLandingResponseSchema;\n },\n /**\n * In review mode, a host records the pushed branch as Landed without a pull request; the\n * Control Plane's git delivery then opens or updates the pull request.\n *\n * @generated from rpc supertag.runtime.v2.HostLandings.Record\n */\n record: {\n methodKind: \"unary\";\n input: typeof RecordWorkspaceLandingRequestSchema;\n output: typeof WorkspaceLandingSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_workspace_landings, 1);\n\n/**\n * Internal to the Control Plane: git delivery pins each Session's source, and opens or updates\n * the pull request of a review landing whose branch a Worker Host pushed. It claims only those.\n *\n * @generated from service supertag.runtime.v2.GitDelivery\n */\nexport const GitDelivery: GenService<{\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.ListPendingSources\n */\n listPendingSources: {\n methodKind: \"unary\";\n input: typeof ListPendingWorkspaceSourcesRequestSchema;\n output: typeof ListPendingWorkspaceSourcesResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.PinSource\n */\n pinSource: {\n methodKind: \"unary\";\n input: typeof PinWorkspaceSourceRequestSchema;\n output: typeof WorkspaceSourcePinSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.Claim\n */\n claim: {\n methodKind: \"unary\";\n input: typeof ClaimWorkspaceLandingRequestSchema;\n output: typeof ClaimWorkspaceLandingResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.Renew\n */\n renew: {\n methodKind: \"unary\";\n input: typeof WorkspaceLandingLeaseSchema;\n output: typeof ClaimWorkspaceLandingResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.Record\n */\n record: {\n methodKind: \"unary\";\n input: typeof RecordWorkspaceLandingRequestSchema;\n output: typeof WorkspaceLandingSchema;\n },\n /**\n * Each Session's latest landing whose Session branch a Worker Host pushed and git delivery has\n * not checked yet. Git delivery reads the branch with `ls-remote` and records what it named.\n *\n * @generated from rpc supertag.runtime.v2.GitDelivery.ListUnverified\n */\n listUnverified: {\n methodKind: \"unary\";\n input: typeof ListUnverifiedLandingsRequestSchema;\n output: typeof ListUnverifiedLandingsResponseSchema;\n },\n /**\n * @generated from rpc supertag.runtime.v2.GitDelivery.RecordVerification\n */\n recordVerification: {\n methodKind: \"unary\";\n input: typeof RecordLandingVerificationRequestSchema;\n output: typeof WorkspaceLandingSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_supertag_runtime_v2_workspace_landings, 2);\n","import { createHash, randomBytes } from \"node:crypto\";\nimport { isIP, type Socket, connect as tcpConnect } from \"node:net\";\nimport { Duplex } from \"node:stream\";\nimport { connect as tlsConnect } from \"node:tls\";\n\n// A `wss://` or `ws://` Gateway URL carries the same gRPC connection inside a WebSocket, for\n// platforms whose proxy forwards only HTTP/1.1. The tunnel is a byte pipe: SuperTag's own TLS,\n// with any client certificate, runs end to end inside it, so a proxy that terminates the outer\n// `wss://` TLS sees only ciphertext. This matches the Rust transport (core/crates/transport).\n\n/** The largest WebSocket message either side sends or accepts. */\nexport const TUNNEL_MAX_MESSAGE = 256 * 1024;\n/** How often the client pings the Gateway; a peer silent for three intervals is gone. */\nexport const TUNNEL_PING_MS = 20_000;\n/** The largest upgrade response head read before the tunnel is refused. */\nconst MAX_RESPONSE_HEAD = 16 * 1024;\nconst WEBSOCKET_GUID = \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\";\n\nconst OP_CONTINUATION = 0x0;\nconst OP_TEXT = 0x1;\nconst OP_BINARY = 0x2;\nconst OP_CLOSE = 0x8;\nconst OP_PING = 0x9;\nconst OP_PONG = 0xa;\n\n/** The native gRPC origin a tunnel URL carries, without the WebSocket path. */\nexport function tunnelOrigin(url: URL): string {\n const scheme = url.protocol === \"wss:\" ? \"https\" : \"http\";\n const port = url.port || (url.protocol === \"wss:\" ? \"443\" : \"80\");\n return `${scheme}://${url.hostname}:${port}`;\n}\n\n/**\n * The code of every error a tunnel fails with. connect-node knows only Node's own socket codes,\n * so the Gateway client reports a call whose cause carries this code as Unavailable, as gRPC\n * does for a broken connection.\n */\nexport const TUNNEL_FAILURE = \"ERR_SUPERTAG_TUNNEL\";\n\nfunction failure(message: string, code = TUNNEL_FAILURE): Error {\n return Object.assign(new Error(message), { code });\n}\n\nfunction headerHasToken(value: string | undefined, token: string): boolean {\n return (value ?? \"\").split(\",\").some((part) => part.trim().toLowerCase() === token);\n}\n\n/** Outer TLS for a `wss://` tunnel: the platform's edge certificate. */\nexport interface OuterTls {\n readonly ca: ReadonlyArray<string | Buffer> | undefined;\n}\n\n/**\n * One WebSocket tunnel as a byte stream: binary messages in both directions, masked frames out,\n * at most {@link TUNNEL_MAX_MESSAGE} bytes each. It pings on an interval, which keeps proxies from\n * closing an idle tunnel, and fails when the peer has sent nothing, not even a pong, for three\n * intervals. Writes made before the upgrade completes wait for it.\n */\nexport class TunnelSocket extends Duplex {\n readonly #url: URL;\n readonly #ping: number;\n #socket: Socket | undefined;\n #ready: Promise<void>;\n #open = false;\n #pending: Buffer = Buffer.alloc(0);\n #fragmented = false;\n #message = 0;\n #last = Date.now();\n #timer: NodeJS.Timeout | undefined;\n #closing = false;\n\n constructor(url: URL, outer: OuterTls | undefined, ping = TUNNEL_PING_MS) {\n super({ allowHalfOpen: false });\n this.#url = url;\n this.#ping = ping;\n this.#ready = this.#dial(outer).catch((error: unknown) => {\n // No cause is attached: connect-node reads codes along the cause chain, and would report\n // a reset socket's ECONNRESET as Aborted.\n const message = error instanceof Error ? error.message : String(error);\n throw failure(\n message.startsWith(\"the WebSocket tunnel\")\n ? message\n : `the WebSocket tunnel could not open: ${message}`,\n );\n });\n this.#ready.then(\n () => this.emit(\"tunnel\"),\n (error: Error) => this.destroy(error),\n );\n }\n\n async #dial(outer: OuterTls | undefined): Promise<void> {\n const url = this.#url;\n const host = url.hostname.replace(/^\\[|\\]$/gu, \"\");\n const port = Number(url.port || (url.protocol === \"wss:\" ? 443 : 80));\n const socket =\n outer === undefined\n ? tcpConnect({ host, port })\n : tlsConnect({\n host,\n port,\n servername: isIP(host) === 0 ? host : undefined,\n ALPNProtocols: [\"http/1.1\"],\n ca: outer.ca as (string | Buffer)[] | undefined,\n minVersion: \"TLSv1.2\",\n rejectUnauthorized: true,\n });\n this.#socket = socket;\n socket.setNoDelay(true);\n await new Promise<void>((resolve, reject) => {\n const ready = () => {\n socket.off(\"error\", reject);\n socket.off(\"close\", closed);\n resolve();\n };\n const closed = () => reject(failure(\"the WebSocket tunnel connection closed\"));\n socket.once(outer === undefined ? \"connect\" : \"secureConnect\", ready);\n socket.once(\"error\", reject);\n socket.once(\"close\", closed);\n });\n const key = randomBytes(16).toString(\"base64\");\n // No Origin header: SuperTag listeners refuse upgrades that carry one, so a web page cannot\n // open a tunnel.\n socket.write(\n `GET ${url.pathname || \"/\"} HTTP/1.1\\r\\nHost: ${url.host}\\r\\nUpgrade: websocket\\r\\n` +\n `Connection: Upgrade\\r\\nSec-WebSocket-Key: ${key}\\r\\nSec-WebSocket-Version: 13\\r\\n\\r\\n`,\n );\n const { head, rest } = await new Promise<{ head: string; rest: Buffer }>((resolve, reject) => {\n let read = Buffer.alloc(0);\n const done = (error?: Error) => {\n socket.off(\"data\", data);\n socket.off(\"error\", done);\n socket.off(\"close\", closed);\n if (error) reject(error);\n };\n const closed = () =>\n done(failure(\"the WebSocket tunnel upgrade failed: the connection closed\"));\n const data = (chunk: Buffer) => {\n read = Buffer.concat([read, chunk]);\n const end = read.indexOf(\"\\r\\n\\r\\n\");\n if (end >= 0) {\n done();\n resolve({ head: read.subarray(0, end).toString(\"latin1\"), rest: read.subarray(end + 4) });\n } else if (read.length > MAX_RESPONSE_HEAD) {\n done(failure(\"the WebSocket tunnel upgrade failed: the response head is too large\"));\n }\n };\n socket.on(\"data\", data);\n socket.once(\"error\", done);\n socket.once(\"close\", closed);\n });\n const [status = \"\", ...lines] = head.split(\"\\r\\n\");\n const headers = new Map<string, string>();\n for (const line of lines) {\n const colon = line.indexOf(\":\");\n if (colon <= 0) continue;\n const name = line.slice(0, colon).trim().toLowerCase();\n const value = line.slice(colon + 1).trim();\n headers.set(name, headers.has(name) ? `${headers.get(name)}, ${value}` : value);\n }\n const accept = createHash(\"sha1\")\n .update(key + WEBSOCKET_GUID)\n .digest(\"base64\");\n if (\n !/^HTTP\\/1\\.1 101(?: |$)/u.test(status) ||\n headers.get(\"upgrade\")?.toLowerCase() !== \"websocket\" ||\n !headerHasToken(headers.get(\"connection\"), \"upgrade\") ||\n headers.get(\"sec-websocket-accept\") !== accept\n ) {\n throw failure(\n `the WebSocket tunnel upgrade was refused: ${status.replace(/^HTTP\\/1\\.1 /u, \"\").replace(/[^\\x20-\\x7e]/gu, \"\")}`,\n );\n }\n this.#open = true;\n this.#last = Date.now();\n socket.on(\"data\", (chunk: Buffer) => this.#receive(chunk));\n socket.on(\"error\", (error) =>\n this.destroy(failure(`the WebSocket tunnel connection failed: ${error.message}`)),\n );\n socket.on(\"close\", () => {\n if (!this.destroyed) this.destroy(failure(\"the WebSocket tunnel connection closed\"));\n });\n this.#timer = setInterval(() => this.#keepalive(), this.#ping);\n this.#timer.unref();\n if (rest.length > 0) this.#receive(rest);\n }\n\n #keepalive() {\n const socket = this.#socket;\n if (socket === undefined || this.destroyed) return;\n // A paused read side is this end's backpressure, not the peer's silence.\n if (!socket.isPaused() && Date.now() - this.#last >= 3 * this.#ping) {\n this.destroy(failure(\"the WebSocket tunnel peer stopped answering\"));\n return;\n }\n this.#send(OP_PING, Buffer.alloc(0));\n }\n\n /** Reads every complete frame in the received bytes. */\n #receive(chunk: Buffer) {\n this.#pending = this.#pending.length === 0 ? chunk : Buffer.concat([this.#pending, chunk]);\n try {\n while (!this.destroyed) {\n const frame = this.#frame();\n if (frame === undefined) return;\n this.#handle(frame.fin, frame.opcode, frame.payload);\n }\n } catch (error) {\n this.destroy(error as Error);\n }\n }\n\n #frame(): { fin: boolean; opcode: number; payload: Buffer } | undefined {\n const buffer = this.#pending;\n if (buffer.length < 2) return undefined;\n const first = buffer[0] as number;\n const second = buffer[1] as number;\n if ((first & 0x70) !== 0 || (second & 0x80) !== 0) {\n throw failure(\"the WebSocket tunnel peer sent an invalid frame\");\n }\n let length = second & 0x7f;\n let offset = 2;\n if (length === 126) {\n if (buffer.length < 4) return undefined;\n length = buffer.readUInt16BE(2);\n offset = 4;\n } else if (length === 127) {\n if (buffer.length < 10) return undefined;\n const extended = buffer.readBigUInt64BE(2);\n if (extended > BigInt(TUNNEL_MAX_MESSAGE)) {\n throw failure(\"the WebSocket tunnel message is too large\");\n }\n length = Number(extended);\n offset = 10;\n }\n if (length > TUNNEL_MAX_MESSAGE) throw failure(\"the WebSocket tunnel message is too large\");\n const fin = (first & 0x80) !== 0;\n const opcode = first & 0x0f;\n if (opcode >= OP_CLOSE && (!fin || length > 125)) {\n throw failure(\"the WebSocket tunnel peer sent an invalid control frame\");\n }\n if (buffer.length < offset + length) return undefined;\n const payload = buffer.subarray(offset, offset + length);\n this.#pending = buffer.subarray(offset + length);\n return { fin, opcode, payload };\n }\n\n #handle(fin: boolean, opcode: number, payload: Buffer) {\n this.#last = Date.now();\n switch (opcode) {\n case OP_BINARY:\n case OP_CONTINUATION: {\n if ((opcode === OP_BINARY) === this.#fragmented) {\n throw failure(\"the WebSocket tunnel peer sent an invalid fragment\");\n }\n if (opcode === OP_BINARY) this.#message = 0;\n this.#message += payload.length;\n if (this.#message > TUNNEL_MAX_MESSAGE) {\n throw failure(\"the WebSocket tunnel message is too large\");\n }\n this.#fragmented = !fin;\n // Copy: the payload is a view of the receive buffer, which later chunks replace.\n if (payload.length > 0 && !this.push(Buffer.from(payload))) this.#socket?.pause();\n return;\n }\n case OP_PING:\n this.#send(OP_PONG, payload);\n return;\n case OP_PONG:\n return;\n case OP_CLOSE: {\n // The Gateway never ends a tunnel this side still uses: its close is a failure, which\n // the calls on the tunnel report, not an end of stream HTTP/2 would take as clean.\n const unexpected = !this.#closing;\n this.#closing = true;\n this.#send(OP_CLOSE, payload.subarray(0, Math.min(payload.length, 2)));\n if (unexpected) throw failure(\"the Gateway closed the WebSocket tunnel\");\n this.push(null);\n this.#socket?.end();\n return;\n }\n case OP_TEXT:\n throw failure(\"the WebSocket tunnel carries only binary messages\");\n default:\n throw failure(\"the WebSocket tunnel peer sent an unknown frame\");\n }\n }\n\n /** Writes one final, masked frame. */\n #send(opcode: number, payload: Buffer, callback?: (error?: Error | null) => void) {\n const socket = this.#socket;\n if (socket === undefined || socket.destroyed || !socket.writable) {\n callback?.(failure(\"the WebSocket tunnel is closed\"));\n return;\n }\n const length = payload.length;\n const extended = length < 126 ? 0 : length <= 0xffff ? 2 : 8;\n const frame = Buffer.allocUnsafe(2 + extended + 4 + length);\n frame[0] = 0x80 | opcode;\n if (extended === 0) frame[1] = 0x80 | length;\n else if (extended === 2) {\n frame[1] = 0x80 | 126;\n frame.writeUInt16BE(length, 2);\n } else {\n frame[1] = 0x80 | 127;\n frame.writeBigUInt64BE(BigInt(length), 2);\n }\n const start = 2 + extended + 4;\n const mask = randomBytes(4);\n mask.copy(frame, 2 + extended);\n for (let i = 0; i < length; i++) {\n frame[start + i] = (payload[i] as number) ^ (mask[i & 3] as number);\n }\n socket.write(frame, callback);\n }\n\n override _write(\n chunk: Buffer,\n _encoding: BufferEncoding,\n callback: (error?: Error | null) => void,\n ) {\n const write = () => {\n for (let offset = 0; offset < chunk.length; offset += TUNNEL_MAX_MESSAGE) {\n const end = Math.min(chunk.length, offset + TUNNEL_MAX_MESSAGE);\n this.#send(\n OP_BINARY,\n chunk.subarray(offset, end),\n end === chunk.length ? callback : undefined,\n );\n }\n if (chunk.length === 0) callback();\n };\n if (this.#open) write();\n else this.#ready.then(write, (error: unknown) => callback(error as Error));\n }\n\n override _read() {\n this.#socket?.resume();\n }\n\n override _final(callback: (error?: Error | null) => void) {\n if (this.#open && !this.#closing) {\n this.#closing = true;\n this.#send(OP_CLOSE, Buffer.from([0x03, 0xe8]));\n }\n this.#socket?.end();\n callback();\n }\n\n override _destroy(error: Error | null, callback: (error?: Error | null) => void) {\n clearInterval(this.#timer);\n const socket = this.#socket;\n if (socket !== undefined && !socket.destroyed) {\n if (this.#open && !this.#closing) {\n this.#closing = true;\n this.#send(OP_CLOSE, Buffer.from([0x03, 0xe8]));\n }\n socket.destroy();\n }\n callback(error);\n }\n\n /** Lets the process exit while only this tunnel is open, as a TCP socket would. */\n unref(): this {\n this.#socket?.unref();\n return this;\n }\n\n ref(): this {\n this.#socket?.ref();\n return this;\n }\n}\n","import type { ClientHttp2Stream, ClientSessionOptions, Http2Session } from \"node:http2\";\nimport { isIP, type Socket, connect as tcpConnect } from \"node:net\";\nimport * as tls from \"node:tls\";\nimport { Code, ConnectError, createClient, type Interceptor } from \"@connectrpc/connect\";\nimport { createGrpcTransport, Http2SessionManager } from \"@connectrpc/connect-node\";\nimport {\n ArtifactCatalog,\n ArtifactPublications,\n ArtifactVolumes,\n} from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/artifact_pb.js\";\nimport { Memories } from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/memories_pb.js\";\nimport {\n ProtocolNegotiation,\n ServiceRole,\n} from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/negotiation_pb.js\";\nimport { Enrollments } from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/placement_pb.js\";\nimport {\n PolicyCatalog,\n SurfacePolicyCatalog,\n} from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/policy_pb.js\";\nimport {\n Conversations,\n Inbox,\n LiveInputs,\n Mailbox,\n ManifestRelationships,\n NetworkLogs,\n Objectives,\n Operator,\n OperatorEvents,\n TaskFiles,\n Teams,\n WorkSessions,\n} from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/runtime_pb.js\";\nimport { Schedules } from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/schedules_pb.js\";\nimport { WorkspaceLandings } from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/workspace_landings_pb.js\";\nimport {\n WorkspaceCredentials,\n Workspaces,\n} from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/workspaces_pb.js\";\nimport { TUNNEL_FAILURE, TunnelSocket, tunnelOrigin } from \"./tunnel.js\";\n\nexport { Code, ConnectError } from \"@connectrpc/connect\";\nexport { PrincipalRole } from \"../../../harnesses/sdk/src/rust-harness/gen/supertag/runtime/v2/runtime_pb.js\";\n\nexport interface GatewayClientOptions {\n /**\n * An `https://` origin, a loopback `http://` origin, or a `wss://` or loopback `ws://` tunnel\n * URL, which may have a path. A tunnel carries the same gRPC connection inside a WebSocket,\n * with the Gateway's own TLS running end to end inside a `wss://` tunnel.\n */\n readonly url: string;\n /** An operator token, Operator Token, enrolled credential, or Auth Key: ASCII, no spaces. */\n readonly token: string;\n /**\n * PEM certificate authority for a Gateway with a private TLS certificate. It replaces the\n * trusted roots for the Gateway's own TLS; a `wss://` tunnel's outer TLS trusts it beside them.\n */\n readonly ca?: string | Buffer;\n /** PEM client identity for a Gateway that requires mutual TLS. */\n readonly identity?: { readonly cert: string | Buffer; readonly key: string | Buffer };\n /** The release this client names while negotiating, up to 64 ASCII characters. */\n readonly buildVersion?: string;\n /**\n * How long opening a connection may take: TCP, TLS and, for a tunnel, the WebSocket upgrade.\n * Defaults to 5 seconds, or 30 for a tunnel, whose platform proxy may hold the upgrade while\n * it starts a Gateway that scaled to zero.\n */\n readonly connectTimeoutMs?: number;\n}\n\n/** Names, on every call, the protocol version this client negotiated with the Gateway. */\nconst PROTOCOL_HEADER = \"x-supertag-protocol\";\n/** The SuperTag protocol versions this client speaks. */\nconst PROTOCOL_VERSIONS = [7];\nconst protocolVersions: readonly number[] = Object.freeze(PROTOCOL_VERSIONS);\n\nexport { protocolVersions as PROTOCOL_VERSIONS };\n\n/** HTTP/2 keepalive, as the Rust transport's KEEPALIVE_INTERVAL and KEEPALIVE_TIMEOUT. */\nconst KEEPALIVE_INTERVAL_MS = 10_000;\nconst KEEPALIVE_TIMEOUT_MS = 10_000;\nconst MAX_MESSAGE_BYTES = 1024 * 1024;\nconst MAX_BUILD_VERSION = 64;\nconst MAX_OFFERED_VERSIONS = 32;\n\ninterface Endpoint {\n /** The URL as given, without a trailing slash: it names the Gateway in errors. */\n readonly name: string;\n /** The native gRPC origin calls go to. */\n readonly origin: URL;\n /** The tunnel URL, when connections go through a WebSocket. */\n readonly tunnel: URL | undefined;\n readonly tls: boolean;\n}\n\nfunction loopback(url: URL): boolean {\n const host = url.hostname.replace(/^\\[|\\]$/gu, \"\");\n return (isIP(host) === 4 && host.startsWith(\"127.\")) || host === \"::1\";\n}\n\nfunction gatewayEndpoint(value: string): Endpoint {\n if (/[\\s\\\\#?]/u.test(value)) throw new Error(invalidUrl);\n const tunnel = /^wss?:\\/\\//u.test(value);\n if (\n tunnel ? !/^wss?:\\/\\/[^/@]+(?:\\/.*)?$/u.test(value) : !/^https?:\\/\\/[^/@]+\\/?$/u.test(value)\n ) {\n throw new Error(invalidUrl);\n }\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n throw new Error(invalidUrl);\n }\n if (url.hostname === \"\" || url.port === \"0\") throw new Error(\"Gateway URL must use a valid port\");\n const cleartext = url.protocol === \"http:\" || url.protocol === \"ws:\";\n if (cleartext && !loopback(url)) {\n throw new Error(\"Cleartext Gateway URL must use a loopback IP address\");\n }\n return {\n name: value.replace(/\\/+$/u, \"\"),\n origin: tunnel ? new URL(tunnelOrigin(url)) : url,\n tunnel: tunnel ? url : undefined,\n tls: !cleartext,\n };\n}\n\nconst invalidUrl =\n \"Gateway URL must be an HTTP or HTTPS origin, or a WS or WSS tunnel URL, without credentials, query, or fragment\";\n\n/**\n * The roots the OS trusts beside Node's bundled ones, read once per process: reading them can\n * block for a while (the macOS keychain). Node releases without `tls.getCACertificates` keep\n * their bundled roots.\n */\nlet roots: readonly string[] | undefined;\nfunction trustedRoots(): readonly string[] {\n if (roots === undefined) {\n const read = (tls as { getCACertificates?: (type: string) => string[] }).getCACertificates;\n roots =\n typeof read === \"function\"\n ? [...new Set([...read(\"default\"), ...read(\"system\")])]\n : tls.rootCertificates;\n }\n return roots;\n}\n\n/** Opens each HTTP/2 connection within the connect timeout, natively or through a tunnel. */\nfunction connector(\n endpoint: Endpoint,\n options: GatewayClientOptions,\n timeoutMs: number,\n): NonNullable<ClientSessionOptions[\"createConnection\"]> {\n const host = endpoint.origin.hostname.replace(/^\\[|\\]$/gu, \"\");\n const inner: tls.ConnectionOptions = {\n host,\n servername: isIP(host) === 0 ? host : undefined,\n ALPNProtocols: [\"h2\"],\n ca: options.ca ?? [...trustedRoots()],\n cert: options.identity?.cert,\n key: options.identity?.key,\n minVersion: \"TLSv1.2\",\n rejectUnauthorized: true,\n };\n return () => {\n let socket: Socket | TunnelSocket;\n let ready: string;\n if (endpoint.tunnel !== undefined) {\n const outer =\n endpoint.tunnel.protocol === \"wss:\"\n ? { ca: [...trustedRoots(), ...(options.ca === undefined ? [] : [options.ca])] }\n : undefined;\n const tunnel = new TunnelSocket(endpoint.tunnel, outer);\n if (endpoint.tls) {\n socket = tls.connect({ ...inner, socket: tunnel });\n ready = \"secureConnect\";\n } else {\n socket = tunnel;\n ready = \"tunnel\";\n }\n } else if (endpoint.tls) {\n socket = tls.connect({ ...inner, port: Number(endpoint.origin.port || 443) });\n ready = \"secureConnect\";\n } else {\n socket = tcpConnect({ host, port: Number(endpoint.origin.port || 80) });\n ready = \"connect\";\n }\n const timer = setTimeout(() => {\n socket.destroy(\n Object.assign(new Error(`Could not connect to the Gateway within ${timeoutMs} ms`), {\n code: \"ETIMEDOUT\",\n }),\n );\n }, timeoutMs);\n timer.unref();\n socket.once(ready, () => clearTimeout(timer));\n socket.once(\"close\", () => clearTimeout(timer));\n return socket;\n };\n}\n\n/**\n * Starts reading a response stream as soon as it exists. Node.js 24 fails an async iterator\n * created on an HTTP/2 stream that has already closed with ERR_STREAM_PREMATURE_CLOSE, even when\n * the stream ended cleanly, and connect-node creates its iterator only once a promise for the\n * response headers settles. Over a native socket Node runs microtasks between the HTTP/2 frames\n * of one read, so the iterator exists before the trailers close the stream. A tunnel's bytes reach\n * HTTP/2 from JavaScript instead (Node's JSStreamSocket), which handles every frame of a WebSocket\n * message before any microtask runs, so a small reply closes its stream first. The iterator made\n * here holds at most the one message it has read until connect-node asks for it.\n */\nfunction readFromTheStart(stream: ClientHttp2Stream) {\n const iterator = stream[Symbol.asyncIterator]();\n const first = iterator.next();\n // The caller sees a failure when it reads; an unread one must not be unhandled.\n first.catch(() => {});\n stream[Symbol.asyncIterator] = async function* (): AsyncGenerator<unknown, undefined> {\n try {\n for (let read = await first; !read.done; read = await iterator.next()) yield read.value;\n return undefined;\n } finally {\n await iterator.return?.();\n }\n };\n}\n\n/**\n * The session manager every call goes through. Besides reading each response from the start, it\n * keeps an error listener on every session that carried a call: connect-node stops listening for\n * a session's errors once it leaves the session, as `close()` after a failed call does, and Node\n * emits a failed session's error as it closes, after the calls on it already reported it.\n */\nclass SessionManager extends Http2SessionManager {\n readonly #watched = new WeakSet<Http2Session>();\n\n override async request(...args: Parameters<Http2SessionManager[\"request\"]>) {\n const stream = await super.request(...args);\n readFromTheStart(stream);\n const session = stream.session;\n if (session !== undefined && !this.#watched.has(session)) {\n this.#watched.add(session);\n session.on(\"error\", () => {});\n }\n return stream;\n }\n}\n\n/** Whether `error` or any error it was caused by is a tunnel failure. */\nfunction tunnelFailure(error: unknown): boolean {\n for (let cause = error, depth = 0; cause instanceof Error && depth < 8; depth++) {\n if ((cause as { code?: unknown }).code === TUNNEL_FAILURE) return true;\n cause = cause.cause;\n }\n return false;\n}\n\n/** A call that failed because its tunnel failed is Unavailable, as over a broken connection. */\nfunction unavailable(error: unknown): unknown {\n if (!tunnelFailure(error)) return error;\n const status = ConnectError.from(error);\n return new ConnectError(status.rawMessage, Code.Unavailable, status.metadata, undefined, error);\n}\n\nconst tunnelFailures: Interceptor = (next) => async (request) => {\n let response: Awaited<ReturnType<typeof next>>;\n try {\n response = await next(request);\n } catch (error) {\n throw unavailable(error);\n }\n if (!response.stream) return response;\n const messages = response.message;\n return {\n ...response,\n message: (async function* () {\n try {\n yield* messages;\n } catch (error) {\n throw unavailable(error);\n }\n })(),\n };\n};\n\n/** Up to 64 visible ASCII characters of a peer's release, as the Rust client keeps them. */\nfunction printable(build: string): string {\n const kept = [...build].filter((c) => c > \" \" && c < \"\\x7f\").slice(0, MAX_BUILD_VERSION);\n return kept.length === 0 ? \"unknown\" : kept.join(\"\");\n}\n\n/** \"protocol 3\", or \"protocols 2, 3\". */\nfunction spoken(versions: readonly number[]): string {\n return versions.length === 1 ? `protocol ${versions[0]}` : `protocols ${versions.join(\", \")}`;\n}\n\n/** The release and versions in a negotiation refusal, if it names them. */\nfunction parseRefusal(message: string): { build: string; versions: number[] } | undefined {\n const match = /\\(SuperTag ([^)]*)\\) speaks protocol versions \\[([^\\]]*)\\]/u.exec(message);\n if (!match) return undefined;\n const versions = (match[2] as string).split(\",\").map((item) => item.trim());\n if (versions.length === 0 || versions.length > MAX_OFFERED_VERSIONS) return undefined;\n if (!versions.every((item) => /^[0-9]{1,10}$/u.test(item))) return undefined;\n return { build: printable(match[1] as string), versions: versions.map(Number) };\n}\n\n/**\n * The Gateway is a SuperTag release that speaks none of this client's protocol versions.\n * Retrying cannot help: one side must be upgraded. The message names both releases, where the\n * Gateway runs, and which side to upgrade.\n */\nexport class ProtocolMismatchError extends ConnectError {\n /** The protocol versions this client speaks. */\n readonly ourVersions: readonly number[];\n /** The protocol versions the Gateway speaks, when it named them. */\n readonly peerVersions: readonly number[] | undefined;\n /** The Gateway's release, when it named it. */\n readonly peerBuild: string | undefined;\n /** The Gateway URL this client was configured with. */\n readonly endpoint: string;\n\n /** ConnectError's own check accepts any ConnectError; this one follows the prototype chain. */\n static override [Symbol.hasInstance](value: unknown): boolean {\n return Function.prototype[Symbol.hasInstance].call(ProtocolMismatchError, value);\n }\n\n constructor(\n endpoint: string,\n peer: { build: string; versions: readonly number[] } | undefined,\n refusal?: string,\n ) {\n let message = `This client speaks SuperTag ${spoken(PROTOCOL_VERSIONS)}, but the Gateway at ${endpoint} `;\n if (peer === undefined) {\n const reason = (refusal ?? \"\")\n .replace(/\\p{Cc}/gu, \"\")\n .slice(0, 512)\n .replace(/[. ]+$/u, \"\");\n message += `refused it: ${reason || \"no reason given\"}. Run the same SuperTag release on both.`;\n } else {\n message += `runs SuperTag ${peer.build} (${spoken(peer.versions)}). `;\n const peerMax = Math.max(...peer.versions);\n const ourMax = Math.max(...PROTOCOL_VERSIONS);\n if (peerMax < Math.min(...PROTOCOL_VERSIONS)) message += \"Upgrade the Gateway.\";\n else if (ourMax < Math.min(...peer.versions)) message += \"Upgrade this client.\";\n else message += \"Run the same SuperTag release on both.\";\n }\n super(message, Code.FailedPrecondition);\n // The name stays \"ConnectError\": connect recognizes its errors by name, and would otherwise\n // wrap this one in a plain ConnectError on its way to the caller.\n this.ourVersions = protocolVersions;\n this.peerVersions = peer === undefined ? undefined : Object.freeze([...peer.versions]);\n this.peerBuild = peer?.build;\n this.endpoint = endpoint;\n }\n}\n\nfunction refusedByGateway(error: unknown, endpoint: string): ConnectError {\n const status = ConnectError.from(error);\n if (status.code === Code.Unimplemented) {\n return new ConnectError(\n \"incompatible SuperTag protocol: the Gateway does not offer SuperTag protocol negotiation\",\n Code.FailedPrecondition,\n );\n }\n if (\n status.code === Code.FailedPrecondition &&\n status.rawMessage.startsWith(\"incompatible SuperTag protocol\")\n ) {\n const peer = parseRefusal(status.rawMessage);\n return new ProtocolMismatchError(endpoint, peer, peer ? undefined : status.rawMessage);\n }\n if (\n status.code === Code.FailedPrecondition ||\n status.code === Code.PermissionDenied ||\n status.code === Code.InvalidArgument\n ) {\n return new ConnectError(\n `the SuperTag Gateway refused this operator client: ${status.rawMessage}`,\n Code.FailedPrecondition,\n );\n }\n return status;\n}\n\nfunction protocolRefusal(error: unknown): boolean {\n const status = ConnectError.from(error);\n return (\n status.code === Code.FailedPrecondition &&\n (status.rawMessage.startsWith(\"incompatible SuperTag protocol\") ||\n status.rawMessage.includes(\"did not negotiate a protocol version\"))\n );\n}\n\n/** 1 to `limit` ASCII graphic characters: the Rust bearer rule's alphabet. */\nfunction graphic(value: string, limit: number): boolean {\n return value.length > 0 && value.length <= limit && /^[\\x21-\\x7e]+$/u.test(value);\n}\n\n/** What the Gateway agreed to while negotiating. */\nexport interface Negotiation {\n /** The protocol version every call names. */\n readonly protocolVersion: number;\n /** The Gateway's SuperTag release, such as `0.3.4`; `unknown` when it named none. */\n readonly gatewayBuild: string;\n}\n\n/**\n * Connect operator applications to the SuperTag Gateway over gRPC. The first call negotiates the\n * SuperTag protocol version, which every call then names; the Gateway refuses calls without it.\n */\nexport function createGatewayClient(options: GatewayClientOptions) {\n const endpoint = gatewayEndpoint(options.url);\n // As the Rust clients' bearer rule: 1 to 8192 ASCII graphic characters.\n if (!graphic(options.token, 8192)) throw new Error(\"Invalid operator token\");\n const buildVersion = options.buildVersion ?? \"supertag-ai\";\n if (!graphic(buildVersion, MAX_BUILD_VERSION)) {\n throw new Error(\"Build version must be 1 to 64 ASCII characters without spaces\");\n }\n if (!endpoint.tls && (options.ca !== undefined || options.identity !== undefined)) {\n throw new Error(\"Gateway TLS options require HTTPS or WSS\");\n }\n const connectTimeoutMs = options.connectTimeoutMs ?? (endpoint.tunnel ? 30_000 : 5_000);\n if (!Number.isInteger(connectTimeoutMs) || connectTimeoutMs <= 0) {\n throw new Error(\"Connect timeout must be a positive whole number of milliseconds\");\n }\n\n const session = new SessionManager(\n endpoint.origin,\n {\n idleConnectionTimeoutMs: 1_000,\n pingIntervalMs: KEEPALIVE_INTERVAL_MS,\n pingTimeoutMs: KEEPALIVE_TIMEOUT_MS,\n },\n { createConnection: connector(endpoint, options, connectTimeoutMs) },\n );\n const authorization = `Bearer ${options.token}`;\n let closed = false;\n // The exchange carries no credentials.\n const negotiator = createClient(\n ProtocolNegotiation,\n createGrpcTransport({\n baseUrl: endpoint.origin.origin,\n sessionManager: session,\n readMaxBytes: 4096,\n writeMaxBytes: 4096,\n interceptors: [tunnelFailures],\n }),\n );\n let negotiated: Promise<Negotiation> | undefined;\n const negotiateOnce = () => {\n if (closed) return Promise.reject(new Error(\"Gateway client is closed\"));\n negotiated ??= (async () => {\n let answer: Awaited<ReturnType<typeof negotiator.negotiate>>;\n try {\n answer = await negotiator.negotiate(\n {\n role: ServiceRole.CLIENT,\n protocolVersions: [...PROTOCOL_VERSIONS],\n buildVersion,\n },\n { timeoutMs: 5_000 + connectTimeoutMs },\n );\n } catch (error) {\n throw refusedByGateway(error, endpoint.name);\n }\n if (answer.role !== ServiceRole.GATEWAY) {\n throw new ConnectError(\n \"this operator client expected a SuperTag Gateway but reached another service\",\n Code.FailedPrecondition,\n );\n }\n if (\n !PROTOCOL_VERSIONS.includes(answer.protocolVersion) ||\n !answer.protocolVersions.includes(answer.protocolVersion)\n ) {\n const versions = answer.protocolVersions.slice(0, MAX_OFFERED_VERSIONS);\n throw new ProtocolMismatchError(endpoint.name, {\n build: printable(answer.buildVersion),\n versions: versions.length > 0 ? versions : [answer.protocolVersion],\n });\n }\n return {\n protocolVersion: answer.protocolVersion,\n gatewayBuild: printable(answer.buildVersion),\n };\n })().catch((error: unknown) => {\n negotiated = undefined;\n throw error;\n });\n return negotiated;\n };\n const transport = createGrpcTransport({\n baseUrl: endpoint.origin.origin,\n sessionManager: session,\n readMaxBytes: MAX_MESSAGE_BYTES,\n writeMaxBytes: MAX_MESSAGE_BYTES,\n interceptors: [\n (next) => async (request) => {\n if (closed) throw new Error(\"Gateway client is closed\");\n request.header.set(\"authorization\", authorization);\n request.header.set(PROTOCOL_HEADER, String((await negotiateOnce()).protocolVersion));\n try {\n return await next(request);\n } catch (error) {\n // A Gateway replaced by another release refuses the held version; negotiate again.\n if (protocolRefusal(error)) negotiated = undefined;\n throw error;\n }\n },\n tunnelFailures,\n ],\n });\n return {\n operator: createClient(Operator, transport),\n conversations: createClient(Conversations, transport),\n events: createClient(OperatorEvents, transport),\n objectives: createClient(Objectives, transport),\n inbox: createClient(Inbox, transport),\n workSessions: createClient(WorkSessions, transport),\n teams: createClient(Teams, transport),\n mailbox: createClient(Mailbox, transport),\n liveInputs: createClient(LiveInputs, transport),\n policy: createClient(PolicyCatalog, transport),\n manifestRelationships: createClient(ManifestRelationships, transport),\n surfaces: createClient(SurfacePolicyCatalog, transport),\n workspaces: createClient(Workspaces, transport),\n workspaceCredentials: createClient(WorkspaceCredentials, transport),\n workspaceLandings: createClient(WorkspaceLandings, transport),\n artifacts: createClient(ArtifactCatalog, transport),\n artifactPublications: createClient(ArtifactPublications, transport),\n volumes: createClient(ArtifactVolumes, transport),\n enrollments: createClient(Enrollments, transport),\n memories: createClient(Memories, transport),\n networkLogs: createClient(NetworkLogs, transport),\n schedules: createClient(Schedules, transport),\n taskFiles: createClient(TaskFiles, transport),\n /**\n * Negotiates the protocol version now, without credentials, and returns it. Calls negotiate\n * on their own; this tells whether the Gateway is reachable and compatible before any is\n * made. A Gateway from another release rejects it with {@link ProtocolMismatchError}.\n */\n async negotiate(): Promise<number> {\n return (await negotiateOnce()).protocolVersion;\n },\n /** Negotiates as {@link negotiate} does, and also returns the Gateway's release. */\n negotiation(): Promise<Negotiation> {\n return negotiateOnce();\n },\n close() {\n closed = true;\n session.abort();\n },\n };\n}\n\nexport type GatewayClient = ReturnType<typeof createGatewayClient>;\n"]}
|