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

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 (219) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +130 -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 +73 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +59 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +44 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +6 -0
  16. package/lib/pagination.d.ts +2 -0
  17. package/lib/pagination.d.ts.map +1 -0
  18. package/lib/pagination.js +1 -0
  19. package/lib/protocol.d.ts +19 -0
  20. package/lib/protocol.d.ts.map +1 -0
  21. package/lib/protocol.js +1 -0
  22. package/lib/retry.d.ts +12 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +1 -0
  25. package/lib/services/buildkite_jobs.d.ts +129 -0
  26. package/lib/services/buildkite_jobs.d.ts.map +1 -0
  27. package/lib/services/buildkite_jobs.js +2 -0
  28. package/lib/services/buildkite_jobs.js.map +1 -0
  29. package/lib/services/buildkite_queue.d.ts +186 -0
  30. package/lib/services/buildkite_queue.d.ts.map +1 -0
  31. package/lib/services/buildkite_queue.js +2 -0
  32. package/lib/services/buildkite_queue.js.map +1 -0
  33. package/lib/services/index.d.ts +3 -0
  34. package/lib/services/index.d.ts.map +1 -0
  35. package/lib/services/index.js +2 -0
  36. package/lib/services.lazy/buildkite_jobs.js +1 -0
  37. package/lib/services.lazy/buildkite_queue.js +1 -0
  38. package/lib/services.lazy/index.js +3 -0
  39. package/lib/traits.d.ts +3 -0
  40. package/lib/traits.d.ts.map +1 -0
  41. package/lib/traits.js +1 -0
  42. package/lib/unstable-services/artifacts.d.ts +268 -0
  43. package/lib/unstable-services/artifacts.d.ts.map +1 -0
  44. package/lib/unstable-services/artifacts.js +2 -0
  45. package/lib/unstable-services/artifacts.js.map +1 -0
  46. package/lib/unstable-services/audit.d.ts +157 -0
  47. package/lib/unstable-services/audit.d.ts.map +1 -0
  48. package/lib/unstable-services/audit.js +2 -0
  49. package/lib/unstable-services/audit.js.map +1 -0
  50. package/lib/unstable-services/bazel.d.ts +181 -0
  51. package/lib/unstable-services/bazel.d.ts.map +1 -0
  52. package/lib/unstable-services/bazel.js +2 -0
  53. package/lib/unstable-services/bazel.js.map +1 -0
  54. package/lib/unstable-services/bazel_cache.d.ts +126 -0
  55. package/lib/unstable-services/bazel_cache.d.ts.map +1 -0
  56. package/lib/unstable-services/bazel_cache.js +2 -0
  57. package/lib/unstable-services/bazel_cache.js.map +1 -0
  58. package/lib/unstable-services/builder.d.ts +242 -0
  59. package/lib/unstable-services/builder.d.ts.map +1 -0
  60. package/lib/unstable-services/builder.js +2 -0
  61. package/lib/unstable-services/builder.js.map +1 -0
  62. package/lib/unstable-services/compute.d.ts +1124 -0
  63. package/lib/unstable-services/compute.d.ts.map +1 -0
  64. package/lib/unstable-services/compute.js +47 -0
  65. package/lib/unstable-services/compute.js.map +1 -0
  66. package/lib/unstable-services/compute_command.d.ts +120 -0
  67. package/lib/unstable-services/compute_command.d.ts.map +1 -0
  68. package/lib/unstable-services/compute_command.js +2 -0
  69. package/lib/unstable-services/compute_command.js.map +1 -0
  70. package/lib/unstable-services/compute_observability.d.ts +165 -0
  71. package/lib/unstable-services/compute_observability.d.ts.map +1 -0
  72. package/lib/unstable-services/compute_observability.js +2 -0
  73. package/lib/unstable-services/compute_observability.js.map +1 -0
  74. package/lib/unstable-services/compute_storage.d.ts +379 -0
  75. package/lib/unstable-services/compute_storage.d.ts.map +1 -0
  76. package/lib/unstable-services/compute_storage.js +33 -0
  77. package/lib/unstable-services/compute_storage.js.map +1 -0
  78. package/lib/unstable-services/compute_usage.d.ts +283 -0
  79. package/lib/unstable-services/compute_usage.d.ts.map +1 -0
  80. package/lib/unstable-services/compute_usage.js +2 -0
  81. package/lib/unstable-services/compute_usage.js.map +1 -0
  82. package/lib/unstable-services/egress.d.ts +191 -0
  83. package/lib/unstable-services/egress.d.ts.map +1 -0
  84. package/lib/unstable-services/egress.js +2 -0
  85. package/lib/unstable-services/egress.js.map +1 -0
  86. package/lib/unstable-services/experimental_compute_reservation.d.ts +672 -0
  87. package/lib/unstable-services/experimental_compute_reservation.d.ts.map +1 -0
  88. package/lib/unstable-services/experimental_compute_reservation.js +23 -0
  89. package/lib/unstable-services/experimental_compute_reservation.js.map +1 -0
  90. package/lib/unstable-services/experimental_remote_results.d.ts +496 -0
  91. package/lib/unstable-services/experimental_remote_results.d.ts.map +1 -0
  92. package/lib/unstable-services/experimental_remote_results.js +2 -0
  93. package/lib/unstable-services/experimental_remote_results.js.map +1 -0
  94. package/lib/unstable-services/github_image.d.ts +162 -0
  95. package/lib/unstable-services/github_image.d.ts.map +1 -0
  96. package/lib/unstable-services/github_image.js +2 -0
  97. package/lib/unstable-services/github_image.js.map +1 -0
  98. package/lib/unstable-services/github_jobs.d.ts +183 -0
  99. package/lib/unstable-services/github_jobs.d.ts.map +1 -0
  100. package/lib/unstable-services/github_jobs.js +2 -0
  101. package/lib/unstable-services/github_jobs.js.map +1 -0
  102. package/lib/unstable-services/github_profile.d.ts +296 -0
  103. package/lib/unstable-services/github_profile.d.ts.map +1 -0
  104. package/lib/unstable-services/github_profile.js +2 -0
  105. package/lib/unstable-services/github_profile.js.map +1 -0
  106. package/lib/unstable-services/gradle_cache.d.ts +125 -0
  107. package/lib/unstable-services/gradle_cache.d.ts.map +1 -0
  108. package/lib/unstable-services/gradle_cache.js +2 -0
  109. package/lib/unstable-services/gradle_cache.js.map +1 -0
  110. package/lib/unstable-services/httpcache.d.ts +125 -0
  111. package/lib/unstable-services/httpcache.d.ts.map +1 -0
  112. package/lib/unstable-services/httpcache.js +2 -0
  113. package/lib/unstable-services/httpcache.js.map +1 -0
  114. package/lib/unstable-services/iam_tenant.d.ts +457 -0
  115. package/lib/unstable-services/iam_tenant.d.ts.map +1 -0
  116. package/lib/unstable-services/iam_tenant.js +45 -0
  117. package/lib/unstable-services/iam_tenant.js.map +1 -0
  118. package/lib/unstable-services/iam_tenant_membership.d.ts +114 -0
  119. package/lib/unstable-services/iam_tenant_membership.d.ts.map +1 -0
  120. package/lib/unstable-services/iam_tenant_membership.js +2 -0
  121. package/lib/unstable-services/iam_tenant_membership.js.map +1 -0
  122. package/lib/unstable-services/iam_token.d.ts +257 -0
  123. package/lib/unstable-services/iam_token.d.ts.map +1 -0
  124. package/lib/unstable-services/iam_token.js +2 -0
  125. package/lib/unstable-services/iam_token.js.map +1 -0
  126. package/lib/unstable-services/image.d.ts +222 -0
  127. package/lib/unstable-services/image.d.ts.map +1 -0
  128. package/lib/unstable-services/image.js +2 -0
  129. package/lib/unstable-services/image.js.map +1 -0
  130. package/lib/unstable-services/index.d.ts +28 -0
  131. package/lib/unstable-services/index.d.ts.map +1 -0
  132. package/lib/unstable-services/index.js +27 -0
  133. package/lib/unstable-services/private_devbox.d.ts +1180 -0
  134. package/lib/unstable-services/private_devbox.d.ts.map +1 -0
  135. package/lib/unstable-services/private_devbox.js +81 -0
  136. package/lib/unstable-services/private_devbox.js.map +1 -0
  137. package/lib/unstable-services/private_user_sessions.d.ts +145 -0
  138. package/lib/unstable-services/private_user_sessions.d.ts.map +1 -0
  139. package/lib/unstable-services/private_user_sessions.js +2 -0
  140. package/lib/unstable-services/private_user_sessions.js.map +1 -0
  141. package/lib/unstable-services/registry.d.ts +373 -0
  142. package/lib/unstable-services/registry.d.ts.map +1 -0
  143. package/lib/unstable-services/registry.js +34 -0
  144. package/lib/unstable-services/registry.js.map +1 -0
  145. package/lib/unstable-services/testing.d.ts +160 -0
  146. package/lib/unstable-services/testing.d.ts.map +1 -0
  147. package/lib/unstable-services/testing.js +2 -0
  148. package/lib/unstable-services/testing.js.map +1 -0
  149. package/lib/unstable-services/vault.d.ts +203 -0
  150. package/lib/unstable-services/vault.d.ts.map +1 -0
  151. package/lib/unstable-services/vault.js +2 -0
  152. package/lib/unstable-services/vault.js.map +1 -0
  153. package/lib/unstable-services.lazy/artifacts.js +1 -0
  154. package/lib/unstable-services.lazy/audit.js +1 -0
  155. package/lib/unstable-services.lazy/bazel.js +1 -0
  156. package/lib/unstable-services.lazy/bazel_cache.js +1 -0
  157. package/lib/unstable-services.lazy/builder.js +1 -0
  158. package/lib/unstable-services.lazy/compute.js +4 -0
  159. package/lib/unstable-services.lazy/compute_command.js +1 -0
  160. package/lib/unstable-services.lazy/compute_observability.js +1 -0
  161. package/lib/unstable-services.lazy/compute_storage.js +4 -0
  162. package/lib/unstable-services.lazy/compute_usage.js +1 -0
  163. package/lib/unstable-services.lazy/egress.js +1 -0
  164. package/lib/unstable-services.lazy/experimental_compute_reservation.js +4 -0
  165. package/lib/unstable-services.lazy/experimental_remote_results.js +1 -0
  166. package/lib/unstable-services.lazy/github_image.js +1 -0
  167. package/lib/unstable-services.lazy/github_jobs.js +1 -0
  168. package/lib/unstable-services.lazy/github_profile.js +1 -0
  169. package/lib/unstable-services.lazy/gradle_cache.js +1 -0
  170. package/lib/unstable-services.lazy/httpcache.js +1 -0
  171. package/lib/unstable-services.lazy/iam_tenant.js +4 -0
  172. package/lib/unstable-services.lazy/iam_tenant_membership.js +1 -0
  173. package/lib/unstable-services.lazy/iam_token.js +1 -0
  174. package/lib/unstable-services.lazy/image.js +1 -0
  175. package/lib/unstable-services.lazy/index.js +3 -0
  176. package/lib/unstable-services.lazy/private_devbox.js +4 -0
  177. package/lib/unstable-services.lazy/private_user_sessions.js +1 -0
  178. package/lib/unstable-services.lazy/registry.js +4 -0
  179. package/lib/unstable-services.lazy/testing.js +1 -0
  180. package/lib/unstable-services.lazy/vault.js +1 -0
  181. package/package.json +89 -2
  182. package/src/credentials.ts +208 -0
  183. package/src/errors.ts +71 -0
  184. package/src/index.ts +50 -0
  185. package/src/pagination.ts +1 -0
  186. package/src/protocol.ts +83 -0
  187. package/src/retry.ts +28 -0
  188. package/src/services/buildkite_jobs.ts +230 -0
  189. package/src/services/buildkite_queue.ts +453 -0
  190. package/src/services/index.ts +3 -0
  191. package/src/traits.ts +36 -0
  192. package/src/unstable-services/artifacts.ts +769 -0
  193. package/src/unstable-services/audit.ts +323 -0
  194. package/src/unstable-services/bazel.ts +423 -0
  195. package/src/unstable-services/bazel_cache.ts +219 -0
  196. package/src/unstable-services/builder.ts +576 -0
  197. package/src/unstable-services/compute.ts +2991 -0
  198. package/src/unstable-services/compute_command.ts +220 -0
  199. package/src/unstable-services/compute_observability.ts +436 -0
  200. package/src/unstable-services/compute_storage.ts +1167 -0
  201. package/src/unstable-services/compute_usage.ts +738 -0
  202. package/src/unstable-services/egress.ts +516 -0
  203. package/src/unstable-services/experimental_compute_reservation.ts +1499 -0
  204. package/src/unstable-services/experimental_remote_results.ts +1165 -0
  205. package/src/unstable-services/github_image.ts +301 -0
  206. package/src/unstable-services/github_jobs.ts +389 -0
  207. package/src/unstable-services/github_profile.ts +729 -0
  208. package/src/unstable-services/gradle_cache.ts +271 -0
  209. package/src/unstable-services/httpcache.ts +271 -0
  210. package/src/unstable-services/iam_tenant.ts +1720 -0
  211. package/src/unstable-services/iam_tenant_membership.ts +253 -0
  212. package/src/unstable-services/iam_token.ts +788 -0
  213. package/src/unstable-services/image.ts +602 -0
  214. package/src/unstable-services/index.ts +28 -0
  215. package/src/unstable-services/private_devbox.ts +4256 -0
  216. package/src/unstable-services/private_user_sessions.ts +410 -0
  217. package/src/unstable-services/registry.ts +1242 -0
  218. package/src/unstable-services/testing.ts +394 -0
  219. package/src/unstable-services/vault.ts +522 -0
@@ -0,0 +1,423 @@
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 { NamespaceLabsServiceErrors } from "../errors.ts";
7
+ import { paginateCursor } from "../pagination.ts";
8
+ import {
9
+ NamespaceLabsProtocol,
10
+ type NamespaceLabsOpError,
11
+ type NamespaceLabsOpContext,
12
+ } from "../protocol.ts";
13
+ import * as Retry from "../retry.ts";
14
+ import * as T from "../traits.ts";
15
+ // Schema table, filled on first reach (see __S at the end).
16
+ const __s: any[] = [];
17
+
18
+ export type { NamespaceLabsOpError, NamespaceLabsOpContext };
19
+
20
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
21
+ const TELEMETRY = {
22
+ system: "namespacelabs-api",
23
+ responseHeaders: [
24
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
25
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
26
+ ],
27
+ prefix: "Namespacelabs",
28
+ service: "BazelService",
29
+ propagate: "w3c",
30
+ } as const;
31
+
32
+ export class AlreadyExists
33
+ extends /*@__PURE__*/ T.applyErrorMatchers(
34
+ /*@__PURE__*/ S.TaggedError<AlreadyExists>()("AlreadyExists", {
35
+ message: S.String,
36
+ body: S.Unknown,
37
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
38
+ }).pipe(C.withConflictError),
39
+ [{ status: 409, body: { "/code": "already_exists" } }],
40
+ ) {}
41
+
42
+ export class FailedPrecondition
43
+ extends /*@__PURE__*/ T.applyErrorMatchers(
44
+ /*@__PURE__*/ S.TaggedError<FailedPrecondition>()("FailedPrecondition", {
45
+ message: S.String,
46
+ body: S.Unknown,
47
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
48
+ }).pipe(C.withBadRequestError),
49
+ [{ status: 400, body: { "/code": "failed_precondition" } }],
50
+ ) {}
51
+
52
+ export class InvalidArgument
53
+ extends /*@__PURE__*/ T.applyErrorMatchers(
54
+ /*@__PURE__*/ S.TaggedError<InvalidArgument>()("InvalidArgument", {
55
+ message: S.String,
56
+ body: S.Unknown,
57
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
58
+ }).pipe(C.withBadRequestError),
59
+ [{ status: 400, body: { "/code": "invalid_argument" } }],
60
+ ) {}
61
+
62
+ export class NotFound
63
+ extends /*@__PURE__*/ T.applyErrorMatchers(
64
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
65
+ message: S.String,
66
+ body: S.Unknown,
67
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
68
+ }).pipe(C.withBadRequestError),
69
+ [{ status: 404 }],
70
+ ) {}
71
+
72
+ export class PermissionDenied
73
+ extends /*@__PURE__*/ T.applyErrorMatchers(
74
+ /*@__PURE__*/ S.TaggedError<PermissionDenied>()("PermissionDenied", {
75
+ message: S.String,
76
+ body: S.Unknown,
77
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
78
+ }).pipe(C.withAuthError),
79
+ [{ status: 403 }],
80
+ ) {}
81
+
82
+ export class ResourceExhausted
83
+ extends /*@__PURE__*/ T.applyErrorMatchers(
84
+ /*@__PURE__*/ S.TaggedError<ResourceExhausted>()("ResourceExhausted", {
85
+ message: S.String,
86
+ body: S.Unknown,
87
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
88
+ retryAfter: /*@__PURE__*/ S.optional(S.Duration),
89
+ }).pipe(C.withThrottlingError),
90
+ [{ status: 429 }],
91
+ ) {}
92
+
93
+ export class Unauthenticated
94
+ extends /*@__PURE__*/ T.applyErrorMatchers(
95
+ /*@__PURE__*/ S.TaggedError<Unauthenticated>()("Unauthenticated", {
96
+ message: S.String,
97
+ body: S.Unknown,
98
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
99
+ }).pipe(C.withAuthError),
100
+ [{ status: 401 }],
101
+ ) {}
102
+
103
+ /** Controls which authentication mode the returned cluster endpoints expect. */
104
+ export type BazelExecutionAuthMode =
105
+ | "BAZEL_EXECUTION_AUTH_MODE_UNSPECIFIED"
106
+ | "BAZEL_EXECUTION_AUTH_MODE_MTLS"
107
+ | "BAZEL_EXECUTION_AUTH_MODE_STATIC";
108
+ export interface EnsureClusterRequest {
109
+ /** Stable identifier that disambiguates multiple parallel execution clusters for the same tenant. Used to derive the unique tags. Defaults to "default" when empty. Must be a valid DNS subdomain segment. */
110
+ key?: string | undefined;
111
+ /** Authentication mode the client intends to use. Determines which endpoints are returned. Defaults to mTLS when unset. */
112
+ authMode?: BazelExecutionAuthMode | (string & {}) | undefined;
113
+ /** When true, the returned response includes a remote asset endpoint suitable for use with bazel's `--experimental_remote_downloader`. The backing storage instance always serves the remote asset API; this flag only controls whether the endpoint is surfaced to the client. */
114
+ enableRemoteAssetApi?: boolean | undefined;
115
+ }
116
+ export type StringList = Array<string>;
117
+ export interface EnsureClusterResponse {
118
+ /** gRPC endpoint clients use to reach the scheduler. Authentication matches the requested auth_mode: an mTLS client certificate (port 444) by default, or a static bearer token against the public endpoint (port 443) when static auth was requested. Empty for storage-only access. Format: [protocol://]host:port */
119
+ schedulerEndpoint: string;
120
+ /** gRPC endpoint clients use to reach the storage instance, with the same authentication semantics as scheduler_endpoint. Format: [protocol://]host:port */
121
+ storageEndpoint: string;
122
+ /** Recommended value for Bazel's `--jobs` flag. */
123
+ recommendedBazelJobs: number;
124
+ /** Recommended value for Bazel's `--remote_timeout` flag, in seconds. */
125
+ recommendedBazelRemoteTimeoutSeconds: number;
126
+ /** Recommended value for Bazel's `--remote_local_fallback` flag. */
127
+ recommendedBazelRemoteLocalFallback: boolean;
128
+ /** Recommended value for Bazel's `--remote_download_outputs` flag. */
129
+ recommendedBazelRemoteDownloadOutputs: string;
130
+ /** A gRPC endpoint where build events can be sent to (e.g. `bazel build --bes_backend=<endpoint>`). Empty when build event ingestion is not enabled for the tenant. Format: [protocol://]host:port */
131
+ buildEventEndpoint: string;
132
+ /** For which domains the credential helper should be enabled. Used to authenticate build event uploads in the default (mTLS) auth mode, where the client certificate cannot authenticate the bearer-only build event endpoint. Empty when build event ingestion is not enabled for the tenant. */
133
+ credentialHelperDomains: StringList;
134
+ /** A remote asset endpoint to use with bazel's `--experimental_remote_downloader`. Authentication matches the requested auth_mode, like scheduler_endpoint and storage_endpoint. Only set when the request set enable_remote_asset_api. Format: [protocol://]host:port */
135
+ remoteAssetEndpoint: string;
136
+ /** Base URL where Bazel can link to uploaded build event results (e.g. `bazel build --bes_results_url=<url>`). Empty when build event ingestion is not enabled for the tenant. */
137
+ buildEventResultsUrl: string;
138
+ }
139
+ export type BazelStorageAccessMode =
140
+ | "BAZEL_STORAGE_ACCESS_MODE_UNSPECIFIED"
141
+ | "BAZEL_STORAGE_ACCESS_MODE_READ_ONLY"
142
+ | "BAZEL_STORAGE_ACCESS_MODE_READ_WRITE";
143
+ export interface EnsureStorageClusterRequest {
144
+ /** Stable identifier shared with the corresponding execution cluster. Defaults to "default" when empty. Must be a valid DNS subdomain segment. */
145
+ key?: string | undefined;
146
+ /** Authentication mode the client intends to use. Determines which endpoint is returned. Defaults to mTLS when unset. */
147
+ authMode?: BazelExecutionAuthMode | (string & {}) | undefined;
148
+ /** When true, the returned response includes a remote asset endpoint when the resolved storage access mode is read-write. */
149
+ enableRemoteAssetApi?: boolean | undefined;
150
+ /** Requested storage access. Read-write requires bazel/storage write access. Read-only requires bazel/storage read or write access. When unset, access is derived from the caller's permissions for backwards compatibility. */
151
+ accessMode?: BazelStorageAccessMode | (string & {}) | undefined;
152
+ }
153
+ export interface EnsureStorageClusterResponse {
154
+ /** gRPC endpoint clients use to reach the storage instance with the resolved access mode. Format: [protocol://]host:port */
155
+ storageEndpoint: string;
156
+ /** A remote asset endpoint to use with Bazel's `--experimental_remote_downloader`. Only set for read-write access when the request set enable_remote_asset_api. Format: [protocol://]host:port */
157
+ remoteAssetEndpoint: string;
158
+ /** Recommended value for Bazel's `--remote_upload_local_results` flag. */
159
+ recommendedBazelRemoteUploadLocalResults: boolean;
160
+ /** A gRPC endpoint where build events can be sent. */
161
+ buildEventEndpoint: string;
162
+ /** Base URL where Bazel can link to uploaded build event results. */
163
+ buildEventResultsUrl: string;
164
+ }
165
+ export interface ListInvocationsRequest {
166
+ /** The maximum number of invocations to return. Defaults to 50 and may not exceed 100. */
167
+ maxEntries?: number | undefined;
168
+ /** If a previous response returned a pagination_cursor, pass it here to continue listing invocations. The cursor preserves the time filters from the original request; not_older_than and older_than are ignored when it is set. */
169
+ paginationCursor?: string | undefined;
170
+ /** Don't return invocations that started before this timestamp. */
171
+ notOlderThan?: string | undefined;
172
+ /** Only return invocations that started before this timestamp. */
173
+ olderThan?: string | undefined;
174
+ }
175
+ export interface InvocationListEntry {
176
+ /** The Bazel invocation identifier reported to the build event service. */
177
+ invocationId: string;
178
+ /** The build identifier reported to the build event service. */
179
+ buildId: string;
180
+ /** The project identifier reported to the build event service. */
181
+ projectId: string;
182
+ /** When the invocation started. */
183
+ startedAt?: string | undefined;
184
+ /** When the invocation completed. Unset while it is still running. */
185
+ completedAt?: string | undefined;
186
+ /** The Bazel command that started the invocation (e.g. "build", "test"). */
187
+ command: string;
188
+ /** The target patterns passed to the invocation (e.g. "//foo:bar"). */
189
+ targetPatterns: StringList;
190
+ }
191
+ export type InvocationListEntryList = Array<InvocationListEntry>;
192
+ export interface ListInvocationsResponse {
193
+ /** Invocations matching the request filters, ordered newest first. */
194
+ invocations: InvocationListEntryList;
195
+ /** If set, there are additional invocations. Pass this cursor to a subsequent ListInvocations call to continue listing them. */
196
+ paginationCursor: string;
197
+ }
198
+ export type EnsureClusterError =
199
+ | InvalidArgument
200
+ | FailedPrecondition
201
+ | Unauthenticated
202
+ | PermissionDenied
203
+ | NotFound
204
+ | AlreadyExists
205
+ | ResourceExhausted
206
+ | NamespaceLabsOpError;
207
+ /** Returns remote execution cluster configuration for the caller's environment. Creates necessary resources if they don't exist. */
208
+ export const ensureCluster: API.OperationMethod<
209
+ EnsureClusterRequest,
210
+ EnsureClusterResponse,
211
+ EnsureClusterError,
212
+ NamespaceLabsOpContext
213
+ > = /*@__PURE__*/ API.make(() => ({
214
+ input: __S(0, __c0, 0) as any as S.Schema<EnsureClusterRequest>,
215
+ output: __S(1, __c0, 1) as any as S.Schema<EnsureClusterResponse>,
216
+ errors: [
217
+ InvalidArgument,
218
+ FailedPrecondition,
219
+ Unauthenticated,
220
+ PermissionDenied,
221
+ NotFound,
222
+ AlreadyExists,
223
+ ResourceExhausted,
224
+ ],
225
+ serviceErrors: NamespaceLabsServiceErrors,
226
+ protocol: NamespaceLabsProtocol,
227
+ retry: Retry.Retry,
228
+ telemetry: TELEMETRY,
229
+ span: "EnsureCluster",
230
+ }));
231
+
232
+ export type EnsureStorageClusterError =
233
+ | InvalidArgument
234
+ | FailedPrecondition
235
+ | Unauthenticated
236
+ | PermissionDenied
237
+ | NotFound
238
+ | AlreadyExists
239
+ | ResourceExhausted
240
+ | NamespaceLabsOpError;
241
+ /** Returns remote cache configuration for the caller's environment. Creates necessary resources if they don't exist. */
242
+ export const ensureStorageCluster: API.OperationMethod<
243
+ EnsureStorageClusterRequest,
244
+ EnsureStorageClusterResponse,
245
+ EnsureStorageClusterError,
246
+ NamespaceLabsOpContext
247
+ > = /*@__PURE__*/ API.make(() => ({
248
+ input: __S(8, __c2, 0) as any as S.Schema<EnsureStorageClusterRequest>,
249
+ output: __S(9, __c2, 1) as any as S.Schema<EnsureStorageClusterResponse>,
250
+ errors: [
251
+ InvalidArgument,
252
+ FailedPrecondition,
253
+ Unauthenticated,
254
+ PermissionDenied,
255
+ NotFound,
256
+ AlreadyExists,
257
+ ResourceExhausted,
258
+ ],
259
+ serviceErrors: NamespaceLabsServiceErrors,
260
+ protocol: NamespaceLabsProtocol,
261
+ retry: Retry.Retry,
262
+ telemetry: TELEMETRY,
263
+ span: "EnsureStorageCluster",
264
+ }));
265
+
266
+ export type ListInvocationsError =
267
+ | InvalidArgument
268
+ | FailedPrecondition
269
+ | Unauthenticated
270
+ | PermissionDenied
271
+ | NotFound
272
+ | AlreadyExists
273
+ | ResourceExhausted
274
+ | NamespaceLabsOpError;
275
+ /** Lists Bazel invocations for the caller's tenant, newest first. */
276
+ export const listInvocations: API.PaginatedOperationMethod<
277
+ ListInvocationsRequest,
278
+ ListInvocationsResponse,
279
+ ListInvocationsError,
280
+ NamespaceLabsOpContext,
281
+ InvocationListEntry
282
+ > = /*@__PURE__*/ API.makePaginated(
283
+ () => ({
284
+ input: __S(12, __c3, 0) as any as S.Schema<ListInvocationsRequest>,
285
+ output: __S(15, __c3, 3) as any as S.Schema<ListInvocationsResponse>,
286
+ errors: [
287
+ InvalidArgument,
288
+ FailedPrecondition,
289
+ Unauthenticated,
290
+ PermissionDenied,
291
+ NotFound,
292
+ AlreadyExists,
293
+ ResourceExhausted,
294
+ ],
295
+ serviceErrors: NamespaceLabsServiceErrors,
296
+ protocol: NamespaceLabsProtocol,
297
+ retry: Retry.Retry,
298
+ telemetry: TELEMETRY,
299
+ span: "ListInvocations",
300
+ pagination: {
301
+ mode: "cursor",
302
+ inputToken: "paginationCursor",
303
+ outputToken: "paginationCursor",
304
+ items: "invocations",
305
+ pageSize: "maxEntries",
306
+ } as const,
307
+ }),
308
+ paginateCursor,
309
+ ) as any;
310
+
311
+ // Schema builders: each runs one schema initializer, on that schema's first use.
312
+ function __c0(j: number): any {
313
+ switch (j) {
314
+ case 0:
315
+ return S.suspend(() =>
316
+ S.Struct({
317
+ key: S.optional(S.String),
318
+ authMode: S.optional(S.String),
319
+ enableRemoteAssetApi: S.optional(S.Boolean),
320
+ }).pipe(
321
+ T.Http({
322
+ method: "POST",
323
+ uri: "/namespace.cloud.integrations.bazel.v1beta.BazelService/EnsureCluster",
324
+ code: 200,
325
+ }),
326
+ ),
327
+ ).annotate({ identifier: "EnsureClusterRequest" });
328
+ case 1:
329
+ return S.suspend(() =>
330
+ S.Struct({
331
+ schedulerEndpoint: S.String,
332
+ storageEndpoint: S.String,
333
+ recommendedBazelJobs: S.Number,
334
+ recommendedBazelRemoteTimeoutSeconds: S.Number,
335
+ recommendedBazelRemoteLocalFallback: S.Boolean,
336
+ recommendedBazelRemoteDownloadOutputs: S.String,
337
+ buildEventEndpoint: S.String,
338
+ credentialHelperDomains: __S(4, __c1, 0),
339
+ remoteAssetEndpoint: S.String,
340
+ buildEventResultsUrl: S.String,
341
+ }),
342
+ ).annotate({ identifier: "EnsureClusterResponse" });
343
+ }
344
+ }
345
+ function __c1(j: number): any {
346
+ switch (j) {
347
+ case 0:
348
+ return S.Array(S.String);
349
+ }
350
+ }
351
+ function __c2(j: number): any {
352
+ switch (j) {
353
+ case 0:
354
+ return S.suspend(() =>
355
+ S.Struct({
356
+ key: S.optional(S.String),
357
+ authMode: S.optional(S.String),
358
+ enableRemoteAssetApi: S.optional(S.Boolean),
359
+ accessMode: S.optional(S.String),
360
+ }).pipe(
361
+ T.Http({
362
+ method: "POST",
363
+ uri: "/namespace.cloud.integrations.bazel.v1beta.BazelService/EnsureStorageCluster",
364
+ code: 200,
365
+ }),
366
+ ),
367
+ ).annotate({ identifier: "EnsureStorageClusterRequest" });
368
+ case 1:
369
+ return S.suspend(() =>
370
+ S.Struct({
371
+ storageEndpoint: S.String,
372
+ remoteAssetEndpoint: S.String,
373
+ recommendedBazelRemoteUploadLocalResults: S.Boolean,
374
+ buildEventEndpoint: S.String,
375
+ buildEventResultsUrl: S.String,
376
+ }),
377
+ ).annotate({ identifier: "EnsureStorageClusterResponse" });
378
+ }
379
+ }
380
+ function __c3(j: number): any {
381
+ switch (j) {
382
+ case 0:
383
+ return S.suspend(() =>
384
+ S.Struct({
385
+ maxEntries: S.optional(S.Number),
386
+ paginationCursor: S.optional(S.String),
387
+ notOlderThan: S.optional(S.String),
388
+ olderThan: S.optional(S.String),
389
+ }).pipe(
390
+ T.Http({
391
+ method: "POST",
392
+ uri: "/namespace.cloud.integrations.bazel.v1beta.BazelService/ListInvocations",
393
+ code: 200,
394
+ }),
395
+ ),
396
+ ).annotate({ identifier: "ListInvocationsRequest" });
397
+ case 1:
398
+ return S.suspend(() =>
399
+ S.Struct({
400
+ invocationId: S.String,
401
+ buildId: S.String,
402
+ projectId: S.String,
403
+ startedAt: S.optional(S.String),
404
+ completedAt: S.optional(S.String),
405
+ command: S.String,
406
+ targetPatterns: __S(4, __c1, 0),
407
+ }),
408
+ ).annotate({ identifier: "InvocationListEntry" });
409
+ case 2:
410
+ return S.Array(__S(13, __c3, 1));
411
+ case 3:
412
+ return S.suspend(() =>
413
+ S.Struct({
414
+ invocations: __S(14, __c3, 2),
415
+ paginationCursor: S.String,
416
+ }),
417
+ ).annotate({ identifier: "ListInvocationsResponse" });
418
+ }
419
+ }
420
+ // Schema table: entry i is schema j of builder f, made on first reach.
421
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
422
+ return (__s[i] ??= __L.at(f, j));
423
+ }
@@ -0,0 +1,219 @@
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 type * as Redacted from "effect/Redacted";
7
+ import { NamespaceLabsServiceErrors } from "../errors.ts";
8
+ import {
9
+ NamespaceLabsProtocol,
10
+ type NamespaceLabsOpError,
11
+ type NamespaceLabsOpContext,
12
+ } from "../protocol.ts";
13
+ import * as Retry from "../retry.ts";
14
+ import * as T from "../traits.ts";
15
+ // Schema table, filled on first reach (see __S at the end).
16
+ const __s: any[] = [];
17
+
18
+ export type { NamespaceLabsOpError, NamespaceLabsOpContext };
19
+
20
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
21
+ const TELEMETRY = {
22
+ system: "namespacelabs-api",
23
+ responseHeaders: [
24
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
25
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
26
+ ],
27
+ prefix: "Namespacelabs",
28
+ service: "BazelCacheService",
29
+ propagate: "w3c",
30
+ } as const;
31
+
32
+ export class AlreadyExists
33
+ extends /*@__PURE__*/ T.applyErrorMatchers(
34
+ /*@__PURE__*/ S.TaggedError<AlreadyExists>()("AlreadyExists", {
35
+ message: S.String,
36
+ body: S.Unknown,
37
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
38
+ }).pipe(C.withConflictError),
39
+ [{ status: 409, body: { "/code": "already_exists" } }],
40
+ ) {}
41
+
42
+ export class FailedPrecondition
43
+ extends /*@__PURE__*/ T.applyErrorMatchers(
44
+ /*@__PURE__*/ S.TaggedError<FailedPrecondition>()("FailedPrecondition", {
45
+ message: S.String,
46
+ body: S.Unknown,
47
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
48
+ }).pipe(C.withBadRequestError),
49
+ [{ status: 400, body: { "/code": "failed_precondition" } }],
50
+ ) {}
51
+
52
+ export class InvalidArgument
53
+ extends /*@__PURE__*/ T.applyErrorMatchers(
54
+ /*@__PURE__*/ S.TaggedError<InvalidArgument>()("InvalidArgument", {
55
+ message: S.String,
56
+ body: S.Unknown,
57
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
58
+ }).pipe(C.withBadRequestError),
59
+ [{ status: 400, body: { "/code": "invalid_argument" } }],
60
+ ) {}
61
+
62
+ export class NotFound
63
+ extends /*@__PURE__*/ T.applyErrorMatchers(
64
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
65
+ message: S.String,
66
+ body: S.Unknown,
67
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
68
+ }).pipe(C.withBadRequestError),
69
+ [{ status: 404 }],
70
+ ) {}
71
+
72
+ export class PermissionDenied
73
+ extends /*@__PURE__*/ T.applyErrorMatchers(
74
+ /*@__PURE__*/ S.TaggedError<PermissionDenied>()("PermissionDenied", {
75
+ message: S.String,
76
+ body: S.Unknown,
77
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
78
+ }).pipe(C.withAuthError),
79
+ [{ status: 403 }],
80
+ ) {}
81
+
82
+ export class ResourceExhausted
83
+ extends /*@__PURE__*/ T.applyErrorMatchers(
84
+ /*@__PURE__*/ S.TaggedError<ResourceExhausted>()("ResourceExhausted", {
85
+ message: S.String,
86
+ body: S.Unknown,
87
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
88
+ retryAfter: /*@__PURE__*/ S.optional(S.Duration),
89
+ }).pipe(C.withThrottlingError),
90
+ [{ status: 429 }],
91
+ ) {}
92
+
93
+ export class Unauthenticated
94
+ extends /*@__PURE__*/ T.applyErrorMatchers(
95
+ /*@__PURE__*/ S.TaggedError<Unauthenticated>()("Unauthenticated", {
96
+ message: S.String,
97
+ body: S.Unknown,
98
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
99
+ }).pipe(C.withAuthError),
100
+ [{ status: 401 }],
101
+ ) {}
102
+
103
+ export interface EnsureBazelCacheRequest {
104
+ /** A key to identify the purpose. Currently 'ci' or 'workstation' are supported. */
105
+ key?: string | undefined;
106
+ /** Cache version number. */
107
+ version?: string | undefined;
108
+ /** Optional site preference (e.g., "iad", "ord"). If not set, the site is determined from the caller's location or workload context. */
109
+ site?: string | undefined;
110
+ /** When true, the returned response will include a remote asset endpoint suitable for use with bazel's `--experimental_remote_downloader`. */
111
+ enableRemoteAssetApi?: boolean | undefined;
112
+ /** Experimental: request a direct mTLS endpoint that terminates TLS at ingress and forwards to the cache's plaintext gRPC backend. */
113
+ experimentalDirectMtls?: boolean | undefined;
114
+ /** Experimental: suffix appended to the backing cache volume name and unique tag. */
115
+ experimentalCacheName?: string | undefined;
116
+ }
117
+ export type StringList = Array<string>;
118
+ export interface EnsureBazelCacheResponse {
119
+ /** The gRPC endpoint to connect to (e.g., `bazel build --remote_cache=<endpoint>`). Format: [protocol://]host:port */
120
+ cacheEndpoint: string;
121
+ /** An endpoint for HTTPS access to the cache with client certificate authentication. Format: https://host:port */
122
+ httpsMtlsCacheEndpoint: string;
123
+ /** An endpoint for HTTPS access to the cache with header-based authentication. Format: https://host:port */
124
+ httpsCacheEndpoint: string;
125
+ /** The PEM-encoded CA certificate(s) that should be used to verify server certificates of Namespace services that accept the issued client certificate. The PEM container will contain one or more PEM "CERTIFICATE" blocks. */
126
+ serverCaPem: string;
127
+ /** The PEM-encoded client certificate that can be used by Bazel to connect to the cache. */
128
+ clientCertPem: string;
129
+ /** The PEM-encoded client key that can be used by Bazel to connect to the cache. */
130
+ clientKeyPem: string | Redacted.Redacted<string>;
131
+ /** Until when is the returned cache configuration usable. */
132
+ expiresAt?: string | undefined;
133
+ /** For which domains the credential helper should be enabled. An empty list means that we do not use the credential helper. */
134
+ credentialHelperDomains: StringList;
135
+ /** A gRPC endpoint where we can send the build events to (e.g., `bazel build --bes_backend=<endpoint>`). Format: [protocol://]host:port */
136
+ buildEventEndpoint: string;
137
+ /** A remote asset endpoint to use with bazel's `--experimental_remote_downloader`. Format: [protocol://]host:port */
138
+ remoteAssetEndpoint: string;
139
+ /** Set to true when the returned cache endpoint expects workload mTLS (i.e. the request set experimental_direct_mtls). */
140
+ useWorkloadMtls: boolean;
141
+ }
142
+ export type EnsureBazelCacheError =
143
+ | InvalidArgument
144
+ | FailedPrecondition
145
+ | Unauthenticated
146
+ | PermissionDenied
147
+ | NotFound
148
+ | AlreadyExists
149
+ | ResourceExhausted
150
+ | NamespaceLabsOpError;
151
+ /** Returns cache configuration for the caller's environment. Creates necessary resources if they don't exist. */
152
+ export const ensureBazelCache: API.OperationMethod<
153
+ EnsureBazelCacheRequest,
154
+ EnsureBazelCacheResponse,
155
+ EnsureBazelCacheError,
156
+ NamespaceLabsOpContext
157
+ > = /*@__PURE__*/ API.make(() => ({
158
+ input: __S(0, __c0, 0) as any as S.Schema<EnsureBazelCacheRequest>,
159
+ output: __S(2, __c0, 2) as any as S.Schema<EnsureBazelCacheResponse>,
160
+ errors: [
161
+ InvalidArgument,
162
+ FailedPrecondition,
163
+ Unauthenticated,
164
+ PermissionDenied,
165
+ NotFound,
166
+ AlreadyExists,
167
+ ResourceExhausted,
168
+ ],
169
+ serviceErrors: NamespaceLabsServiceErrors,
170
+ protocol: NamespaceLabsProtocol,
171
+ retry: Retry.Retry,
172
+ telemetry: TELEMETRY,
173
+ span: "EnsureBazelCache",
174
+ }));
175
+
176
+ // Schema builders: each runs one schema initializer, on that schema's first use.
177
+ function __c0(j: number): any {
178
+ switch (j) {
179
+ case 0:
180
+ return S.suspend(() =>
181
+ S.Struct({
182
+ key: S.optional(S.String),
183
+ version: S.optional(S.String),
184
+ site: S.optional(S.String),
185
+ enableRemoteAssetApi: S.optional(S.Boolean),
186
+ experimentalDirectMtls: S.optional(S.Boolean),
187
+ experimentalCacheName: S.optional(S.String),
188
+ }).pipe(
189
+ T.Http({
190
+ method: "POST",
191
+ uri: "/namespace.cloud.integrations.bazel.v1beta.BazelCacheService/EnsureBazelCache",
192
+ code: 200,
193
+ }),
194
+ ),
195
+ ).annotate({ identifier: "EnsureBazelCacheRequest" });
196
+ case 1:
197
+ return S.Array(S.String);
198
+ case 2:
199
+ return S.suspend(() =>
200
+ S.Struct({
201
+ cacheEndpoint: S.String,
202
+ httpsMtlsCacheEndpoint: S.String,
203
+ httpsCacheEndpoint: S.String,
204
+ serverCaPem: S.String,
205
+ clientCertPem: S.String,
206
+ clientKeyPem: S.String.pipe(T.SensitiveValue({})),
207
+ expiresAt: S.optional(S.String),
208
+ credentialHelperDomains: __S(1, __c0, 1),
209
+ buildEventEndpoint: S.String,
210
+ remoteAssetEndpoint: S.String,
211
+ useWorkloadMtls: S.Boolean,
212
+ }),
213
+ ).annotate({ identifier: "EnsureBazelCacheResponse" });
214
+ }
215
+ }
216
+ // Schema table: entry i is schema j of builder f, made on first reach.
217
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
218
+ return (__s[i] ??= __L.at(f, j));
219
+ }