@distilled.cloud/namespacelabs 0.0.0 → 1.0.0-rc.20

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.
Files changed (216) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +121 -4
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +55 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +33 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +42 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +7 -0
  16. package/lib/index.lazy.js +7 -0
  17. package/lib/index.lazy.js.map +1 -0
  18. package/lib/pagination.d.ts +2 -0
  19. package/lib/pagination.d.ts.map +1 -0
  20. package/lib/pagination.js +1 -0
  21. package/lib/protocol.d.ts +15 -0
  22. package/lib/protocol.d.ts.map +1 -0
  23. package/lib/protocol.js +1 -0
  24. package/lib/retry.d.ts +12 -0
  25. package/lib/retry.d.ts.map +1 -0
  26. package/lib/retry.js +1 -0
  27. package/lib/services/artifacts.d.ts +260 -0
  28. package/lib/services/artifacts.d.ts.map +1 -0
  29. package/lib/services/artifacts.js +2 -0
  30. package/lib/services/artifacts.js.map +1 -0
  31. package/lib/services/audit.d.ts +149 -0
  32. package/lib/services/audit.d.ts.map +1 -0
  33. package/lib/services/audit.js +2 -0
  34. package/lib/services/audit.js.map +1 -0
  35. package/lib/services/bazel.d.ts +173 -0
  36. package/lib/services/bazel.d.ts.map +1 -0
  37. package/lib/services/bazel.js +2 -0
  38. package/lib/services/bazel.js.map +1 -0
  39. package/lib/services/bazel_cache.d.ts +118 -0
  40. package/lib/services/bazel_cache.d.ts.map +1 -0
  41. package/lib/services/bazel_cache.js +2 -0
  42. package/lib/services/bazel_cache.js.map +1 -0
  43. package/lib/services/builder.d.ts +234 -0
  44. package/lib/services/builder.d.ts.map +1 -0
  45. package/lib/services/builder.js +2 -0
  46. package/lib/services/builder.js.map +1 -0
  47. package/lib/services/buildkite_jobs.d.ts +121 -0
  48. package/lib/services/buildkite_jobs.d.ts.map +1 -0
  49. package/lib/services/buildkite_jobs.js +2 -0
  50. package/lib/services/buildkite_jobs.js.map +1 -0
  51. package/lib/services/buildkite_queue.d.ts +178 -0
  52. package/lib/services/buildkite_queue.d.ts.map +1 -0
  53. package/lib/services/buildkite_queue.js +2 -0
  54. package/lib/services/buildkite_queue.js.map +1 -0
  55. package/lib/services/compute.d.ts +1057 -0
  56. package/lib/services/compute.d.ts.map +1 -0
  57. package/lib/services/compute.js +43 -0
  58. package/lib/services/compute.js.map +1 -0
  59. package/lib/services/compute_command.d.ts +112 -0
  60. package/lib/services/compute_command.d.ts.map +1 -0
  61. package/lib/services/compute_command.js +2 -0
  62. package/lib/services/compute_command.js.map +1 -0
  63. package/lib/services/compute_observability.d.ts +157 -0
  64. package/lib/services/compute_observability.d.ts.map +1 -0
  65. package/lib/services/compute_observability.js +2 -0
  66. package/lib/services/compute_observability.js.map +1 -0
  67. package/lib/services/compute_storage.d.ts +371 -0
  68. package/lib/services/compute_storage.d.ts.map +1 -0
  69. package/lib/services/compute_storage.js +33 -0
  70. package/lib/services/compute_storage.js.map +1 -0
  71. package/lib/services/compute_usage.d.ts +275 -0
  72. package/lib/services/compute_usage.d.ts.map +1 -0
  73. package/lib/services/compute_usage.js +2 -0
  74. package/lib/services/compute_usage.js.map +1 -0
  75. package/lib/services/egress.d.ts +183 -0
  76. package/lib/services/egress.d.ts.map +1 -0
  77. package/lib/services/egress.js +2 -0
  78. package/lib/services/egress.js.map +1 -0
  79. package/lib/services/experimental_compute_reservation.d.ts +662 -0
  80. package/lib/services/experimental_compute_reservation.d.ts.map +1 -0
  81. package/lib/services/experimental_compute_reservation.js +23 -0
  82. package/lib/services/experimental_compute_reservation.js.map +1 -0
  83. package/lib/services/experimental_remote_results.d.ts +488 -0
  84. package/lib/services/experimental_remote_results.d.ts.map +1 -0
  85. package/lib/services/experimental_remote_results.js +2 -0
  86. package/lib/services/experimental_remote_results.js.map +1 -0
  87. package/lib/services/github_image.d.ts +154 -0
  88. package/lib/services/github_image.d.ts.map +1 -0
  89. package/lib/services/github_image.js +2 -0
  90. package/lib/services/github_image.js.map +1 -0
  91. package/lib/services/github_jobs.d.ts +175 -0
  92. package/lib/services/github_jobs.d.ts.map +1 -0
  93. package/lib/services/github_jobs.js +2 -0
  94. package/lib/services/github_jobs.js.map +1 -0
  95. package/lib/services/github_profile.d.ts +288 -0
  96. package/lib/services/github_profile.d.ts.map +1 -0
  97. package/lib/services/github_profile.js +2 -0
  98. package/lib/services/github_profile.js.map +1 -0
  99. package/lib/services/gradle_cache.d.ts +117 -0
  100. package/lib/services/gradle_cache.d.ts.map +1 -0
  101. package/lib/services/gradle_cache.js +2 -0
  102. package/lib/services/gradle_cache.js.map +1 -0
  103. package/lib/services/httpcache.d.ts +117 -0
  104. package/lib/services/httpcache.d.ts.map +1 -0
  105. package/lib/services/httpcache.js +2 -0
  106. package/lib/services/httpcache.js.map +1 -0
  107. package/lib/services/iam_tenant.d.ts +373 -0
  108. package/lib/services/iam_tenant.d.ts.map +1 -0
  109. package/lib/services/iam_tenant.js +39 -0
  110. package/lib/services/iam_tenant.js.map +1 -0
  111. package/lib/services/iam_tenant_membership.d.ts +106 -0
  112. package/lib/services/iam_tenant_membership.d.ts.map +1 -0
  113. package/lib/services/iam_tenant_membership.js +2 -0
  114. package/lib/services/iam_tenant_membership.js.map +1 -0
  115. package/lib/services/iam_token.d.ts +249 -0
  116. package/lib/services/iam_token.d.ts.map +1 -0
  117. package/lib/services/iam_token.js +2 -0
  118. package/lib/services/iam_token.js.map +1 -0
  119. package/lib/services/image.d.ts +214 -0
  120. package/lib/services/image.d.ts.map +1 -0
  121. package/lib/services/image.js +2 -0
  122. package/lib/services/image.js.map +1 -0
  123. package/lib/services/index.d.ts +30 -0
  124. package/lib/services/index.d.ts.map +1 -0
  125. package/lib/services/index.js +29 -0
  126. package/lib/services/private_devbox.d.ts +1156 -0
  127. package/lib/services/private_devbox.d.ts.map +1 -0
  128. package/lib/services/private_devbox.js +81 -0
  129. package/lib/services/private_devbox.js.map +1 -0
  130. package/lib/services/private_user_sessions.d.ts +137 -0
  131. package/lib/services/private_user_sessions.d.ts.map +1 -0
  132. package/lib/services/private_user_sessions.js +2 -0
  133. package/lib/services/private_user_sessions.js.map +1 -0
  134. package/lib/services/registry.d.ts +365 -0
  135. package/lib/services/registry.d.ts.map +1 -0
  136. package/lib/services/registry.js +34 -0
  137. package/lib/services/registry.js.map +1 -0
  138. package/lib/services/testing.d.ts +152 -0
  139. package/lib/services/testing.d.ts.map +1 -0
  140. package/lib/services/testing.js +2 -0
  141. package/lib/services/testing.js.map +1 -0
  142. package/lib/services/vault.d.ts +195 -0
  143. package/lib/services/vault.d.ts.map +1 -0
  144. package/lib/services/vault.js +2 -0
  145. package/lib/services/vault.js.map +1 -0
  146. package/lib/services.lazy/artifacts.js +1 -0
  147. package/lib/services.lazy/audit.js +1 -0
  148. package/lib/services.lazy/bazel.js +1 -0
  149. package/lib/services.lazy/bazel_cache.js +1 -0
  150. package/lib/services.lazy/builder.js +1 -0
  151. package/lib/services.lazy/buildkite_jobs.js +1 -0
  152. package/lib/services.lazy/buildkite_queue.js +1 -0
  153. package/lib/services.lazy/compute.js +4 -0
  154. package/lib/services.lazy/compute_command.js +1 -0
  155. package/lib/services.lazy/compute_observability.js +1 -0
  156. package/lib/services.lazy/compute_storage.js +4 -0
  157. package/lib/services.lazy/compute_usage.js +1 -0
  158. package/lib/services.lazy/egress.js +1 -0
  159. package/lib/services.lazy/experimental_compute_reservation.js +4 -0
  160. package/lib/services.lazy/experimental_remote_results.js +1 -0
  161. package/lib/services.lazy/github_image.js +1 -0
  162. package/lib/services.lazy/github_jobs.js +1 -0
  163. package/lib/services.lazy/github_profile.js +1 -0
  164. package/lib/services.lazy/gradle_cache.js +1 -0
  165. package/lib/services.lazy/httpcache.js +1 -0
  166. package/lib/services.lazy/iam_tenant.js +4 -0
  167. package/lib/services.lazy/iam_tenant_membership.js +1 -0
  168. package/lib/services.lazy/iam_token.js +1 -0
  169. package/lib/services.lazy/image.js +1 -0
  170. package/lib/services.lazy/index.js +3 -0
  171. package/lib/services.lazy/private_devbox.js +4 -0
  172. package/lib/services.lazy/private_user_sessions.js +1 -0
  173. package/lib/services.lazy/registry.js +4 -0
  174. package/lib/services.lazy/testing.js +1 -0
  175. package/lib/services.lazy/vault.js +1 -0
  176. package/lib/traits.d.ts +3 -0
  177. package/lib/traits.d.ts.map +1 -0
  178. package/lib/traits.js +1 -0
  179. package/package.json +82 -2
  180. package/src/credentials.ts +164 -0
  181. package/src/errors.ts +47 -0
  182. package/src/index.ts +48 -0
  183. package/src/pagination.ts +1 -0
  184. package/src/protocol.ts +82 -0
  185. package/src/retry.ts +28 -0
  186. package/src/services/artifacts.ts +761 -0
  187. package/src/services/audit.ts +315 -0
  188. package/src/services/bazel.ts +415 -0
  189. package/src/services/bazel_cache.ts +211 -0
  190. package/src/services/builder.ts +568 -0
  191. package/src/services/buildkite_jobs.ts +222 -0
  192. package/src/services/buildkite_queue.ts +445 -0
  193. package/src/services/compute.ts +2794 -0
  194. package/src/services/compute_command.ts +212 -0
  195. package/src/services/compute_observability.ts +428 -0
  196. package/src/services/compute_storage.ts +1159 -0
  197. package/src/services/compute_usage.ts +730 -0
  198. package/src/services/egress.ts +508 -0
  199. package/src/services/experimental_compute_reservation.ts +1488 -0
  200. package/src/services/experimental_remote_results.ts +1157 -0
  201. package/src/services/github_image.ts +293 -0
  202. package/src/services/github_jobs.ts +381 -0
  203. package/src/services/github_profile.ts +721 -0
  204. package/src/services/gradle_cache.ts +263 -0
  205. package/src/services/httpcache.ts +263 -0
  206. package/src/services/iam_tenant.ts +1355 -0
  207. package/src/services/iam_tenant_membership.ts +245 -0
  208. package/src/services/iam_token.ts +780 -0
  209. package/src/services/image.ts +594 -0
  210. package/src/services/index.ts +30 -0
  211. package/src/services/private_devbox.ts +4217 -0
  212. package/src/services/private_user_sessions.ts +402 -0
  213. package/src/services/registry.ts +1234 -0
  214. package/src/services/testing.ts +386 -0
  215. package/src/services/vault.ts +514 -0
  216. package/src/traits.ts +36 -0
@@ -0,0 +1,721 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ import * as C from "@distilled.cloud/core/category";
3
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (buf.build/namespace/cloud -> smithy). Do not edit.
4
+ import * as S from "@distilled.cloud/core/schema-lite";
5
+ import * as __L from "@distilled.cloud/core/schema-lite";
6
+ import { UnknownNamespaceLabsError } from "../errors.ts";
7
+ import {
8
+ NamespaceLabsProtocol,
9
+ type NamespaceLabsOpError,
10
+ type NamespaceLabsOpContext,
11
+ } from "../protocol.ts";
12
+ import * as Retry from "../retry.ts";
13
+ import * as T from "../traits.ts";
14
+ // Schema table, filled on first reach (see __S at the end).
15
+ const __s: any[] = [];
16
+
17
+ export type { NamespaceLabsOpError, NamespaceLabsOpContext };
18
+
19
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
20
+ const TELEMETRY = {
21
+ system: "namespacelabs-api",
22
+ responseHeaders: [
23
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
24
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
25
+ ],
26
+ prefix: "Namespacelabs",
27
+ service: "ProfileService",
28
+ propagate: "w3c",
29
+ } as const;
30
+
31
+ export class AlreadyExists
32
+ extends /*@__PURE__*/ T.applyErrorMatchers(
33
+ /*@__PURE__*/ S.TaggedError<AlreadyExists>()("AlreadyExists", {
34
+ message: S.String,
35
+ body: S.Unknown,
36
+ }).pipe(C.withConflictError),
37
+ [{ status: 409, body: { "/code": "already_exists" } }],
38
+ ) {}
39
+
40
+ export class FailedPrecondition
41
+ extends /*@__PURE__*/ T.applyErrorMatchers(
42
+ /*@__PURE__*/ S.TaggedError<FailedPrecondition>()("FailedPrecondition", {
43
+ message: S.String,
44
+ body: S.Unknown,
45
+ }).pipe(C.withBadRequestError),
46
+ [{ status: 400, body: { "/code": "failed_precondition" } }],
47
+ ) {}
48
+
49
+ export class InvalidArgument
50
+ extends /*@__PURE__*/ T.applyErrorMatchers(
51
+ /*@__PURE__*/ S.TaggedError<InvalidArgument>()("InvalidArgument", {
52
+ message: S.String,
53
+ body: S.Unknown,
54
+ }).pipe(C.withBadRequestError),
55
+ [{ status: 400, body: { "/code": "invalid_argument" } }],
56
+ ) {}
57
+
58
+ export class NotFound
59
+ extends /*@__PURE__*/ T.applyErrorMatchers(
60
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
61
+ message: S.String,
62
+ body: S.Unknown,
63
+ }).pipe(C.withBadRequestError),
64
+ [{ status: 404 }],
65
+ ) {}
66
+
67
+ export class PermissionDenied
68
+ extends /*@__PURE__*/ T.applyErrorMatchers(
69
+ /*@__PURE__*/ S.TaggedError<PermissionDenied>()("PermissionDenied", {
70
+ message: S.String,
71
+ body: S.Unknown,
72
+ }).pipe(C.withAuthError),
73
+ [{ status: 403 }],
74
+ ) {}
75
+
76
+ export class ResourceExhausted
77
+ extends /*@__PURE__*/ T.applyErrorMatchers(
78
+ /*@__PURE__*/ S.TaggedError<ResourceExhausted>()("ResourceExhausted", {
79
+ message: S.String,
80
+ body: S.Unknown,
81
+ }).pipe(C.withThrottlingError),
82
+ [{ status: 429 }],
83
+ ) {}
84
+
85
+ export class Unauthenticated
86
+ extends /*@__PURE__*/ T.applyErrorMatchers(
87
+ /*@__PURE__*/ S.TaggedError<Unauthenticated>()("Unauthenticated", {
88
+ message: S.String,
89
+ body: S.Unknown,
90
+ }).pipe(C.withAuthError),
91
+ [{ status: 401 }],
92
+ ) {}
93
+
94
+ /** Labels are key/value pairs attached to entities such as tenants. */
95
+ export interface Label {
96
+ /** A name is an string up to 63 bytes that matches the regular expression `^[a-z]([a-z0-9-.]*[a-z0-9])?$`. */
97
+ name?: string | undefined;
98
+ /** Label values are arbitrary values up to 255 bytes. */
99
+ value?: string | undefined;
100
+ }
101
+ export type LabelList = Array<Label>;
102
+ /** Defines an instance shape: the combination of CPU, RAM and Disk that the instance should use. The size of the ephemeral disk automatically scales with the selected CPU/RAM allocation. See also https://namespace.so/docs/architecture/compute/machine-shapes#storage-allocation Usable values are constrained by policy, and are typically only settable in values as powers of two. */
103
+ export interface InstanceShape {
104
+ /** Number of virtual CPUs. Typically a power of two (e.g. 2, 4, 8, 16). */
105
+ virtualCpu?: number | undefined;
106
+ /** Memory in megabytes. Typically scales with CPU (e.g. 2048 per vCPU). */
107
+ memoryMegabytes?: number | undefined;
108
+ /** Architecture of the instance, e.g. "amd64" or "arm64". */
109
+ machineArch?: string | undefined;
110
+ /** Operating system of the instance, e.g. "linux" or "macos". */
111
+ os?: string | undefined;
112
+ /** Provide additional constraints to instance selection. Available selectors: https://namespace.so/docs/architecture/compute/macos#available-selectors */
113
+ selectors?: LabelList | undefined;
114
+ }
115
+ export type StringList = Array<string>;
116
+ /** CacheVolumeSettings configures persistent volumes attached to runners. */
117
+ export interface CacheVolumeSettings {
118
+ /** Total size of the volume in gigabytes. */
119
+ volumeSizeGb?: number | undefined;
120
+ /** Reserved size that cannot be used by the cache, in gigabytes. */
121
+ volumeReservedSizeGb?: number | undefined;
122
+ /** If true, includes container image cache in this volume. */
123
+ bundledContainerCache?: boolean | undefined;
124
+ /** If true, includes BuildKit cache in this volume. */
125
+ bundledBuildkitCache?: boolean | undefined;
126
+ /** If true, includes git repository mirror in this volume. */
127
+ bundledGitMirror?: boolean | undefined;
128
+ /** If true, includes runner tools cache in this volume. */
129
+ bundledRunnerToolsCache?: boolean | undefined;
130
+ /** If true, includes GitHub Actions cache in this volume. */
131
+ bundledRunnerActionsCache?: boolean | undefined;
132
+ /** List of branches allowed to write to this cache volume. If empty, all branches can write. */
133
+ allowCommitFromBranch?: StringList | undefined;
134
+ }
135
+ export type CacheVolumeSettingsList = Array<CacheVolumeSettings>;
136
+ /** BuilderMode controls how container builds are executed. */
137
+ export type BuilderMode =
138
+ | "BUILDER_MODE_UNSPECIFIED"
139
+ | "USE_REMOTE_BUILDER"
140
+ | "USE_LOCAL_CACHE"
141
+ | "NO_CACHING";
142
+ /** UbuntuBaseImageSpec defines Ubuntu APT package customizations for runner images. */
143
+ export interface UbuntuBaseImageSpec {
144
+ /** List of Ubuntu APT packages to install. */
145
+ aptPackage?: StringList | undefined;
146
+ }
147
+ /** DockerBaseImageSpec defines Dockerfile-based customizations for runner images. */
148
+ export interface DockerBaseImageSpec {
149
+ /** Custom Dockerfile content to run as a layer on top of the base image. */
150
+ dockerfileContent?: string | undefined;
151
+ }
152
+ /** CustomRunnerImageSpec defines the specification for a custom runner image. */
153
+ export interface CustomRunnerImageSpec {
154
+ /** Ubuntu APT package customizations. */
155
+ ubuntuSpec?: UbuntuBaseImageSpec | undefined;
156
+ /** Dockerfile-based customizations. */
157
+ dockerSpec?: DockerBaseImageSpec | undefined;
158
+ }
159
+ export type NetworkPolicyEgressPolicy =
160
+ | "EGRESS_POLICY_UNKNOWN"
161
+ | "EGRESS_POLICY_NONE"
162
+ | "EGRESS_POLICY_DOMAIN_ALLOW_LIST"
163
+ | "EGRESS_POLICY_TAG";
164
+ /** NetworkPolicy configures network egress restrictions for runners. */
165
+ export interface NetworkPolicy {
166
+ /** Egress policy controlling outbound network access. */
167
+ egress?: NetworkPolicyEgressPolicy | (string & {}) | undefined;
168
+ /** List of domains allowed for egress when policy is DOMAIN_ALLOW_LIST. Must be empty unless egress is DOMAIN_ALLOW_LIST. */
169
+ egressDomainAllowList?: StringList | undefined;
170
+ /** When true, runs the egress domain allow list in advisory mode: traffic is not blocked, but egress decisions are still recorded. Must be false unless egress is DOMAIN_ALLOW_LIST. */
171
+ advisory?: boolean | undefined;
172
+ /** Tag of the workspace egress policy to apply when policy is TAG. Must be empty unless egress is TAG. */
173
+ egressPolicyTag?: string | undefined;
174
+ }
175
+ /** AccessLevel controls which Namespace features the runner workload can use. */
176
+ export type AccessLevel =
177
+ | "ACCESS_LEVEL_UNSPECIFIED"
178
+ | "ACCESS_LEVEL_PERMISSIVE"
179
+ | "ACCESS_LEVEL_LIMITED"
180
+ | "ACCESS_LEVEL_RESTRICTED"
181
+ | "ACCESS_LEVEL_CUSTOM";
182
+ /** Defines a permission grant on a resource. Permissions are used to restrict what a token is allowed to do. See https://namespace.so/docs/security/permissions for a list of available resource types and actions. */
183
+ export interface Permission {
184
+ /** The type of resource this permission applies to, e.g. "instance", "vault/object", "token/revokable". */
185
+ resourceType?: string | undefined;
186
+ /** The specific resource ID, or empty for all resources of this type. */
187
+ resourceId?: string | undefined;
188
+ /** The set of actions allowed on the resource, e.g. "create", "list", "describe". */
189
+ actions?: StringList | undefined;
190
+ }
191
+ export type PermissionList = Array<Permission>;
192
+ /** RunnerProfileSpec contains the configurable specification for a runner profile. */
193
+ export interface RunnerProfileSpec {
194
+ /** Stable user-configurable alias. Must be unique within the workspace and can be changed. This is used to reference the profile in GitHub Actions workflow files. */
195
+ tag?: string | undefined;
196
+ /** Human-friendly description of the profile. */
197
+ description?: string | undefined;
198
+ /** Operating system label (e.g., "ubuntu-22.04", "ubuntu-24.04"). This determines the base image used for runners. */
199
+ os?: string | undefined;
200
+ /** Instance shape defining CPU, memory, and other compute resources. */
201
+ instanceShape?: InstanceShape | undefined;
202
+ /** Cache volume configuration for persistent storage across runner instances. */
203
+ cacheVolumeSettings?: CacheVolumeSettingsList | undefined;
204
+ /** Builder mode controls how builds are executed. */
205
+ builderMode?: BuilderMode | (string & {}) | undefined;
206
+ /** List of experimental features to enable for runners using this profile. */
207
+ experimentalFeatures?: StringList | undefined;
208
+ /** Optional emoji to visually identify the profile in UI. */
209
+ emoji?: string | undefined;
210
+ /** Specification for a custom runner image with additional packages or configuration. */
211
+ customRunnerImageSpec?: CustomRunnerImageSpec | undefined;
212
+ /** Network policy for egress restrictions. */
213
+ networkPolicy?: NetworkPolicy | undefined;
214
+ /** Controls which Namespace features the runner workload can access. */
215
+ accessLevel?: AccessLevel | (string & {}) | undefined;
216
+ /** Size of the swap file to provision on the runner, in megabytes. */
217
+ swapSizeMb?: number | undefined;
218
+ customPermissions?: PermissionList | undefined;
219
+ }
220
+ export interface CreateProfileRequest {
221
+ /** Profile specification. */
222
+ spec?: RunnerProfileSpec | undefined;
223
+ }
224
+ export type CustomRunnerImageStatusStatus = "STATUS_UNKNOWN" | "BUILDING" | "FAILED" | "READY";
225
+ /** CustomRunnerImageStatus contains the build and deployment status of a custom image. */
226
+ export interface CustomRunnerImageStatus {
227
+ /** Full image reference (registry path and tag). */
228
+ imageRef: string;
229
+ /** Current build status. */
230
+ status: CustomRunnerImageStatusStatus;
231
+ /** Error message from the last build failure, if any. */
232
+ lastBuildError: string;
233
+ /** Timestamp when the build started. */
234
+ startedBuildAt?: string | undefined;
235
+ /** Timestamp when the build completed successfully. */
236
+ builtAt?: string | undefined;
237
+ /** Timestamp of the last build error. */
238
+ lastErrorAt?: string | undefined;
239
+ /** Build reference identifier. */
240
+ buildRef: string;
241
+ }
242
+ /** CustomRunnerImage combines custom image spec with its build status. */
243
+ export interface CustomRunnerImage {
244
+ /** Image specification. */
245
+ imageSpec?: CustomRunnerImageSpec | undefined;
246
+ /** Build and deployment status. */
247
+ imageStatus?: CustomRunnerImageStatus | undefined;
248
+ }
249
+ export type CustomRunnerImageList = Array<CustomRunnerImage>;
250
+ /** RunnerProfileStatus contains runtime status information about a profile. */
251
+ export interface RunnerProfileStatus {
252
+ /** Status of all custom runner images, ordered by version (oldest first). */
253
+ customRunnerImage: CustomRunnerImageList;
254
+ }
255
+ /** RunnerProfileWithStatus combines profile specification with its runtime status. */
256
+ export interface RunnerProfileWithStatus {
257
+ /** Unique stable identifier for the profile. */
258
+ profileId: string;
259
+ /** Profile specification. */
260
+ spec?: RunnerProfileSpec | undefined;
261
+ /** Version number incremented on each update. Used for optimistic concurrency control. */
262
+ version: string;
263
+ /** Timestamp when the profile was created. */
264
+ createdAt?: string | undefined;
265
+ /** Timestamp when the profile was last updated. */
266
+ updatedAt?: string | undefined;
267
+ /** Runtime status information. */
268
+ status?: RunnerProfileStatus | undefined;
269
+ }
270
+ export interface CreateProfileResponse {
271
+ /** The created profile with runtime status. */
272
+ profile?: RunnerProfileWithStatus | undefined;
273
+ }
274
+ export interface DeleteProfileRequest {
275
+ /** Profile ID to delete. */
276
+ profileId?: string | undefined;
277
+ }
278
+ export interface DeleteProfileResponse {}
279
+ export interface ListProfilesRequest {}
280
+ export type RunnerProfileWithStatusList = Array<RunnerProfileWithStatus>;
281
+ export interface ListProfilesResponse {
282
+ /** List of profiles with runtime status. */
283
+ profiles: RunnerProfileWithStatusList;
284
+ }
285
+ export interface RebuildProfileImageRequest {
286
+ profileId?: string | undefined;
287
+ }
288
+ export interface RebuildProfileImageResponse {
289
+ status?: RunnerProfileStatus | undefined;
290
+ }
291
+ export interface UpdateProfileRequest {
292
+ /** Profile ID to update. */
293
+ profileId?: string | undefined;
294
+ /** Updated profile specification. */
295
+ spec?: RunnerProfileSpec | undefined;
296
+ /** If set, the update only succeeds if the stored version matches this value. This provides optimistic concurrency control. */
297
+ updateVersion?: string | undefined;
298
+ }
299
+ export interface UpdateProfileResponse {
300
+ /** The updated profile with runtime status. */
301
+ profile?: RunnerProfileWithStatus | undefined;
302
+ }
303
+ export type CreateProfileError =
304
+ | InvalidArgument
305
+ | FailedPrecondition
306
+ | Unauthenticated
307
+ | PermissionDenied
308
+ | NotFound
309
+ | AlreadyExists
310
+ | ResourceExhausted
311
+ | NamespaceLabsOpError;
312
+ /** Creates a new runner profile with the specified configuration. The profile's tag must be unique within the workspace. */
313
+ export const createProfile: API.OperationMethod<
314
+ CreateProfileRequest,
315
+ CreateProfileResponse,
316
+ CreateProfileError,
317
+ NamespaceLabsOpContext
318
+ > = /*@__PURE__*/ API.make(() => ({
319
+ input: __S(32, __c2, 0) as any as S.Schema<CreateProfileRequest>,
320
+ output: __S(48, __c3, 0) as any as S.Schema<CreateProfileResponse>,
321
+ errors: [
322
+ InvalidArgument,
323
+ FailedPrecondition,
324
+ Unauthenticated,
325
+ PermissionDenied,
326
+ NotFound,
327
+ AlreadyExists,
328
+ ResourceExhausted,
329
+ UnknownNamespaceLabsError,
330
+ ],
331
+ protocol: NamespaceLabsProtocol,
332
+ retry: Retry.Retry,
333
+ telemetry: TELEMETRY,
334
+ span: "CreateProfile",
335
+ }));
336
+
337
+ export type DeleteProfileError =
338
+ | InvalidArgument
339
+ | FailedPrecondition
340
+ | Unauthenticated
341
+ | PermissionDenied
342
+ | NotFound
343
+ | AlreadyExists
344
+ | ResourceExhausted
345
+ | NamespaceLabsOpError;
346
+ /** Deletes a runner profile. Active runners using this profile will continue to run, but no new runners will be created with it. */
347
+ export const deleteProfile: API.OperationMethod<
348
+ DeleteProfileRequest,
349
+ DeleteProfileResponse,
350
+ DeleteProfileError,
351
+ NamespaceLabsOpContext
352
+ > = /*@__PURE__*/ API.make(() => ({
353
+ input: __S(96, __c6, 0) as any as S.Schema<DeleteProfileRequest>,
354
+ output: __S(97, __c6, 1) as any as S.Schema<DeleteProfileResponse>,
355
+ errors: [
356
+ InvalidArgument,
357
+ FailedPrecondition,
358
+ Unauthenticated,
359
+ PermissionDenied,
360
+ NotFound,
361
+ AlreadyExists,
362
+ ResourceExhausted,
363
+ UnknownNamespaceLabsError,
364
+ ],
365
+ protocol: NamespaceLabsProtocol,
366
+ retry: Retry.Retry,
367
+ telemetry: TELEMETRY,
368
+ span: "DeleteProfile",
369
+ }));
370
+
371
+ export type ListProfilesError =
372
+ | InvalidArgument
373
+ | FailedPrecondition
374
+ | Unauthenticated
375
+ | PermissionDenied
376
+ | NotFound
377
+ | AlreadyExists
378
+ | ResourceExhausted
379
+ | NamespaceLabsOpError;
380
+ /** Lists all runner profiles in the workspace. */
381
+ export const listProfiles: API.OperationMethod<
382
+ ListProfilesRequest,
383
+ ListProfilesResponse,
384
+ ListProfilesError,
385
+ NamespaceLabsOpContext
386
+ > = /*@__PURE__*/ API.make(() => ({
387
+ input: __S(112, __c7, 0) as any as S.Schema<ListProfilesRequest>,
388
+ output: __S(114, __c7, 2) as any as S.Schema<ListProfilesResponse>,
389
+ errors: [
390
+ InvalidArgument,
391
+ FailedPrecondition,
392
+ Unauthenticated,
393
+ PermissionDenied,
394
+ NotFound,
395
+ AlreadyExists,
396
+ ResourceExhausted,
397
+ UnknownNamespaceLabsError,
398
+ ],
399
+ protocol: NamespaceLabsProtocol,
400
+ retry: Retry.Retry,
401
+ telemetry: TELEMETRY,
402
+ span: "ListProfiles",
403
+ }));
404
+
405
+ export type RebuildProfileImageError =
406
+ | InvalidArgument
407
+ | FailedPrecondition
408
+ | Unauthenticated
409
+ | PermissionDenied
410
+ | NotFound
411
+ | AlreadyExists
412
+ | ResourceExhausted
413
+ | NamespaceLabsOpError;
414
+ /** Triggers the rebuild of the custom base image of a runner profile. */
415
+ export const rebuildProfileImage: API.OperationMethod<
416
+ RebuildProfileImageRequest,
417
+ RebuildProfileImageResponse,
418
+ RebuildProfileImageError,
419
+ NamespaceLabsOpContext
420
+ > = /*@__PURE__*/ API.make(() => ({
421
+ input: __S(0, __c0, 0) as any as S.Schema<RebuildProfileImageRequest>,
422
+ output: __S(1, __c0, 1) as any as S.Schema<RebuildProfileImageResponse>,
423
+ errors: [
424
+ InvalidArgument,
425
+ FailedPrecondition,
426
+ Unauthenticated,
427
+ PermissionDenied,
428
+ NotFound,
429
+ AlreadyExists,
430
+ ResourceExhausted,
431
+ UnknownNamespaceLabsError,
432
+ ],
433
+ protocol: NamespaceLabsProtocol,
434
+ retry: Retry.Retry,
435
+ telemetry: TELEMETRY,
436
+ span: "RebuildProfileImage",
437
+ }));
438
+
439
+ export type UpdateProfileError =
440
+ | InvalidArgument
441
+ | FailedPrecondition
442
+ | Unauthenticated
443
+ | PermissionDenied
444
+ | NotFound
445
+ | AlreadyExists
446
+ | ResourceExhausted
447
+ | NamespaceLabsOpError;
448
+ /** Updates an existing runner profile. The update can be conditional based on the current version to prevent concurrent modifications. */
449
+ export const updateProfile: API.OperationMethod<
450
+ UpdateProfileRequest,
451
+ UpdateProfileResponse,
452
+ UpdateProfileError,
453
+ NamespaceLabsOpContext
454
+ > = /*@__PURE__*/ API.make(() => ({
455
+ input: __S(16, __c1, 0) as any as S.Schema<UpdateProfileRequest>,
456
+ output: __S(48, __c3, 0) as any as S.Schema<UpdateProfileResponse>,
457
+ errors: [
458
+ InvalidArgument,
459
+ FailedPrecondition,
460
+ Unauthenticated,
461
+ PermissionDenied,
462
+ NotFound,
463
+ AlreadyExists,
464
+ ResourceExhausted,
465
+ UnknownNamespaceLabsError,
466
+ ],
467
+ protocol: NamespaceLabsProtocol,
468
+ retry: Retry.Retry,
469
+ telemetry: TELEMETRY,
470
+ span: "UpdateProfile",
471
+ }));
472
+
473
+ // Schema builders: each runs one schema initializer, on that schema's first use.
474
+ function __c0(j: number): any {
475
+ switch (j) {
476
+ case 0:
477
+ return S.suspend(() =>
478
+ S.Struct({
479
+ profileId: S.optional(S.String),
480
+ }).pipe(
481
+ T.Http({
482
+ method: "POST",
483
+ uri: "/namespace.cloud.github.v1beta.ProfileService/RebuildProfileImage",
484
+ code: 200,
485
+ }),
486
+ ),
487
+ ).annotate({ identifier: "RebuildProfileImageRequest" });
488
+ case 1:
489
+ return S.suspend(() =>
490
+ S.Struct({
491
+ status: S.optional(__S(71, __c4, 7)),
492
+ }),
493
+ ).annotate({ identifier: "RebuildProfileImageResponse" });
494
+ }
495
+ }
496
+ function __c1(j: number): any {
497
+ switch (j) {
498
+ case 0:
499
+ return S.suspend(() =>
500
+ S.Struct({
501
+ profileId: S.optional(S.String),
502
+ spec: S.optional(__S(88, __c5, 8)),
503
+ updateVersion: S.optional(S.String),
504
+ }).pipe(
505
+ T.Http({
506
+ method: "POST",
507
+ uri: "/namespace.cloud.github.v1beta.ProfileService/UpdateProfile",
508
+ code: 200,
509
+ }),
510
+ ),
511
+ ).annotate({ identifier: "UpdateProfileRequest" });
512
+ }
513
+ }
514
+ function __c2(j: number): any {
515
+ switch (j) {
516
+ case 0:
517
+ return S.suspend(() =>
518
+ S.Struct({
519
+ spec: S.optional(__S(88, __c5, 8)),
520
+ }).pipe(
521
+ T.Http({
522
+ method: "POST",
523
+ uri: "/namespace.cloud.github.v1beta.ProfileService/CreateProfile",
524
+ code: 200,
525
+ }),
526
+ ),
527
+ ).annotate({ identifier: "CreateProfileRequest" });
528
+ }
529
+ }
530
+ function __c3(j: number): any {
531
+ switch (j) {
532
+ case 0:
533
+ return S.suspend(() =>
534
+ S.Struct({
535
+ profile: S.optional(__S(89, __c5, 9)),
536
+ }),
537
+ ).annotate({ identifier: "CreateProfileResponse" });
538
+ }
539
+ }
540
+ function __c4(j: number): any {
541
+ switch (j) {
542
+ case 0:
543
+ return S.Array(S.String);
544
+ case 1:
545
+ return S.suspend(() =>
546
+ S.Struct({
547
+ aptPackage: S.optional(__S(64, __c4, 0)),
548
+ }),
549
+ ).annotate({ identifier: "UbuntuBaseImageSpec" });
550
+ case 2:
551
+ return S.suspend(() =>
552
+ S.Struct({
553
+ dockerfileContent: S.optional(S.String),
554
+ }),
555
+ ).annotate({ identifier: "DockerBaseImageSpec" });
556
+ case 3:
557
+ return S.suspend(() =>
558
+ S.Struct({
559
+ ubuntuSpec: S.optional(__S(65, __c4, 1)),
560
+ dockerSpec: S.optional(__S(66, __c4, 2)),
561
+ }),
562
+ ).annotate({ identifier: "CustomRunnerImageSpec" });
563
+ case 4:
564
+ return S.suspend(() =>
565
+ S.Struct({
566
+ imageRef: S.String,
567
+ status: S.String,
568
+ lastBuildError: S.String,
569
+ startedBuildAt: S.optional(S.String),
570
+ builtAt: S.optional(S.String),
571
+ lastErrorAt: S.optional(S.String),
572
+ buildRef: S.String,
573
+ }),
574
+ ).annotate({ identifier: "CustomRunnerImageStatus" });
575
+ case 5:
576
+ return S.suspend(() =>
577
+ S.Struct({
578
+ imageSpec: S.optional(__S(67, __c4, 3)),
579
+ imageStatus: S.optional(__S(68, __c4, 4)),
580
+ }),
581
+ ).annotate({ identifier: "CustomRunnerImage" });
582
+ case 6:
583
+ return S.Array(__S(69, __c4, 5));
584
+ case 7:
585
+ return S.suspend(() =>
586
+ S.Struct({
587
+ customRunnerImage: __S(70, __c4, 6),
588
+ }),
589
+ ).annotate({ identifier: "RunnerProfileStatus" });
590
+ }
591
+ }
592
+ function __c5(j: number): any {
593
+ switch (j) {
594
+ case 0:
595
+ return S.suspend(() =>
596
+ S.Struct({
597
+ name: S.optional(S.String),
598
+ value: S.optional(S.String),
599
+ }),
600
+ ).annotate({ identifier: "Label" });
601
+ case 1:
602
+ return S.Array(__S(80, __c5, 0));
603
+ case 2:
604
+ return S.suspend(() =>
605
+ S.Struct({
606
+ virtualCpu: S.optional(S.Number),
607
+ memoryMegabytes: S.optional(S.Number),
608
+ machineArch: S.optional(S.String),
609
+ os: S.optional(S.String),
610
+ selectors: S.optional(__S(81, __c5, 1)),
611
+ }),
612
+ ).annotate({ identifier: "InstanceShape" });
613
+ case 3:
614
+ return S.suspend(() =>
615
+ S.Struct({
616
+ volumeSizeGb: S.optional(S.Number),
617
+ volumeReservedSizeGb: S.optional(S.Number),
618
+ bundledContainerCache: S.optional(S.Boolean),
619
+ bundledBuildkitCache: S.optional(S.Boolean),
620
+ bundledGitMirror: S.optional(S.Boolean),
621
+ bundledRunnerToolsCache: S.optional(S.Boolean),
622
+ bundledRunnerActionsCache: S.optional(S.Boolean),
623
+ allowCommitFromBranch: S.optional(__S(64, __c4, 0)),
624
+ }),
625
+ ).annotate({ identifier: "CacheVolumeSettings" });
626
+ case 4:
627
+ return S.Array(__S(83, __c5, 3));
628
+ case 5:
629
+ return S.suspend(() =>
630
+ S.Struct({
631
+ egress: S.optional(S.String),
632
+ egressDomainAllowList: S.optional(__S(64, __c4, 0)),
633
+ advisory: S.optional(S.Boolean),
634
+ egressPolicyTag: S.optional(S.String),
635
+ }),
636
+ ).annotate({ identifier: "NetworkPolicy" });
637
+ case 6:
638
+ return S.suspend(() =>
639
+ S.Struct({
640
+ resourceType: S.optional(S.String),
641
+ resourceId: S.optional(S.String),
642
+ actions: S.optional(__S(64, __c4, 0)),
643
+ }),
644
+ ).annotate({ identifier: "Permission" });
645
+ case 7:
646
+ return S.Array(__S(86, __c5, 6));
647
+ case 8:
648
+ return S.suspend(() =>
649
+ S.Struct({
650
+ tag: S.optional(S.String),
651
+ description: S.optional(S.String),
652
+ os: S.optional(S.String),
653
+ instanceShape: S.optional(__S(82, __c5, 2)),
654
+ cacheVolumeSettings: S.optional(__S(84, __c5, 4)),
655
+ builderMode: S.optional(S.String),
656
+ experimentalFeatures: S.optional(__S(64, __c4, 0)),
657
+ emoji: S.optional(S.String),
658
+ customRunnerImageSpec: S.optional(__S(67, __c4, 3)),
659
+ networkPolicy: S.optional(__S(85, __c5, 5)),
660
+ accessLevel: S.optional(S.String),
661
+ swapSizeMb: S.optional(S.Number),
662
+ customPermissions: S.optional(__S(87, __c5, 7)),
663
+ }),
664
+ ).annotate({ identifier: "RunnerProfileSpec" });
665
+ case 9:
666
+ return S.suspend(() =>
667
+ S.Struct({
668
+ profileId: S.String,
669
+ spec: S.optional(__S(88, __c5, 8)),
670
+ version: S.String,
671
+ createdAt: S.optional(S.String),
672
+ updatedAt: S.optional(S.String),
673
+ status: S.optional(__S(71, __c4, 7)),
674
+ }),
675
+ ).annotate({ identifier: "RunnerProfileWithStatus" });
676
+ }
677
+ }
678
+ function __c6(j: number): any {
679
+ switch (j) {
680
+ case 0:
681
+ return S.suspend(() =>
682
+ S.Struct({
683
+ profileId: S.optional(S.String),
684
+ }).pipe(
685
+ T.Http({
686
+ method: "POST",
687
+ uri: "/namespace.cloud.github.v1beta.ProfileService/DeleteProfile",
688
+ code: 200,
689
+ }),
690
+ ),
691
+ ).annotate({ identifier: "DeleteProfileRequest" });
692
+ case 1:
693
+ return S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteProfileResponse" });
694
+ }
695
+ }
696
+ function __c7(j: number): any {
697
+ switch (j) {
698
+ case 0:
699
+ return S.suspend(() =>
700
+ S.Struct({}).pipe(
701
+ T.Http({
702
+ method: "POST",
703
+ uri: "/namespace.cloud.github.v1beta.ProfileService/ListProfiles",
704
+ code: 200,
705
+ }),
706
+ ),
707
+ ).annotate({ identifier: "ListProfilesRequest" });
708
+ case 1:
709
+ return S.Array(__S(89, __c5, 9));
710
+ case 2:
711
+ return S.suspend(() =>
712
+ S.Struct({
713
+ profiles: __S(113, __c7, 1),
714
+ }),
715
+ ).annotate({ identifier: "ListProfilesResponse" });
716
+ }
717
+ }
718
+ // Schema table: entry i is schema j of builder f, made on first reach.
719
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
720
+ return (__s[i] ??= __L.at(f, j));
721
+ }