@cat-factory/contracts 0.283.1 → 0.284.0

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.
@@ -0,0 +1,720 @@
1
+ import * as v from 'valibot';
2
+ /** The secret-bundle key the Kubernetes env backend reads the ServiceAccount token from. */
3
+ export declare const KUBERNETES_ENV_TOKEN_SECRET_KEY = "apiToken";
4
+ /**
5
+ * How the manifests at `path` are turned into apiserver-ready resources. `raw` (the
6
+ * default, and the only one the in-Worker native REST adapter handles) treats `path` as
7
+ * a single manifest file or a flat directory of already-valid YAML docs. `kustomize`
8
+ * treats `path` as an overlay directory (`kustomization.yaml` + `resources`/`components`/
9
+ * `bases`) that must be `kustomize build`-rendered before apply — which only the
10
+ * container-backed deploy adapter can do (it shells out to real `kustomize`/`helm`).
11
+ */
12
+ export declare const kubernetesRendererSchema: v.PicklistSchema<["raw", "kustomize"], undefined>;
13
+ export type KubernetesRenderer = v.InferOutput<typeof kubernetesRendererSchema>;
14
+ /**
15
+ * Where the per-PR manifests are read from. `colocated` reads them from the block's
16
+ * own repo at the PR head branch; `separate` reads them from a different repo (the
17
+ * Kubernetes definition often lives outside the service repo). `renderer` (absent ⇒
18
+ * `raw`) selects how `path` is turned into resources; `kustomize` requires the
19
+ * container-backed deploy adapter.
20
+ */
21
+ export declare const kubernetesManifestSourceSchema: v.VariantSchema<"type", [v.ObjectSchema<{
22
+ readonly type: v.LiteralSchema<"colocated", undefined>;
23
+ /** File or directory path within the PR repo (read at the PR head branch). */
24
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
25
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
26
+ }, undefined>, v.ObjectSchema<{
27
+ readonly type: v.LiteralSchema<"separate", undefined>;
28
+ /** `owner/repo` of the manifests repo. */
29
+ readonly repo: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be \"owner/repo\"">]>;
30
+ /** Branch/tag/sha to read at; absent ⇒ that repo's default branch. */
31
+ readonly ref: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
32
+ /** File or directory path within the manifests repo. */
33
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
34
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
35
+ }, undefined>], undefined>;
36
+ export type KubernetesManifestSource = v.InferOutput<typeof kubernetesManifestSourceSchema>;
37
+ /** How the environment URL is derived once the manifests are applied. */
38
+ export declare const kubernetesUrlSourceSchema: v.VariantSchema<"source", [v.ObjectSchema<{
39
+ readonly source: v.LiteralSchema<"ingressTemplate", undefined>;
40
+ /** Host template, e.g. `{{branch}}.preview.example.com`; rendered with the provision vars. */
41
+ readonly hostTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
42
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
43
+ }, undefined>, v.ObjectSchema<{
44
+ readonly source: v.LiteralSchema<"ingressStatus", undefined>;
45
+ /** Ingress object to read `.status.loadBalancer` from; absent ⇒ the only Ingress applied. */
46
+ readonly ingressName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
47
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
48
+ }, undefined>, v.ObjectSchema<{
49
+ readonly source: v.LiteralSchema<"serviceStatus", undefined>;
50
+ /** Service object to read `.status.loadBalancer` (k3s ServiceLB) from. */
51
+ readonly serviceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
52
+ readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
53
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
54
+ }, undefined>, v.ObjectSchema<{
55
+ readonly source: v.LiteralSchema<"gatewayStatus", undefined>;
56
+ /** Gateway-API `Gateway` to read `.status.addresses[]` from; absent ⇒ the only one applied. */
57
+ readonly gatewayName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
58
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
59
+ }, undefined>, v.ObjectSchema<{
60
+ readonly source: v.LiteralSchema<"httpRouteStatus", undefined>;
61
+ /** `HTTPRoute` whose `parentRefs` resolve to the Gateway address; absent ⇒ the only one applied. */
62
+ readonly httpRouteName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
63
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
64
+ }, undefined>], undefined>;
65
+ export type KubernetesUrlSource = v.InferOutput<typeof kubernetesUrlSourceSchema>;
66
+ /**
67
+ * Whether a stored value is still a `source` this build knows how to derive a URL from —
68
+ * DERIVED from the variant's own members, so it cannot drift from them the way a second
69
+ * hand-written list would (the {@link isBinaryModality} treatment, for the same reason).
70
+ *
71
+ * The discriminant is a closed vocabulary that is nonetheless PERSISTED, on every stored
72
+ * Kubernetes environment config. A reader that maps it through an exhaustive `switch` is
73
+ * therefore total against the TYPE and partial against the DATA: a config written by a
74
+ * deployment that knows a source this one does not falls off the end of every branch. Narrow
75
+ * with this before assigning a stored value anywhere the exhaustive switch will see it.
76
+ */
77
+ export declare function isKubernetesUrlSource(value: unknown): value is KubernetesUrlSource['source'];
78
+ /**
79
+ * What it takes to REACH a cluster's apiserver, split out of the full config below.
80
+ *
81
+ * Standing an environment up needs the whole config; reclaiming one needs only this. That
82
+ * split is load-bearing rather than cosmetic: a stored config is re-parsed on the way out
83
+ * ({@link parseStoredProviderConfig}), so a `manifestSource` or `url` block that stopped
84
+ * matching the contract would otherwise refuse the teardown too, and an environment nobody
85
+ * can reclaim goes on costing money until a human notices. Teardown validates what it uses
86
+ * and nothing else, so drift in the provisioning half can never strand a live namespace.
87
+ *
88
+ * `apiServerUrl` is not in that forgiving set, deliberately: it stays REQUIRED because there is
89
+ * no safe default for "which cluster", and a DELETE aimed at a guessed one is worse than a
90
+ * refusal.
91
+ */
92
+ export declare const kubernetesConnectionConfigSchema: v.ObjectSchema<{
93
+ /** kube-apiserver root URL, e.g. `https://my-cluster.example:6443`. */
94
+ readonly apiServerUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
95
+ /** PEM CA bundle to verify the apiserver TLS cert (omit only for a publicly-trusted CA). */
96
+ readonly caCertPem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
97
+ /** Skip apiserver TLS verification — strongly discouraged; kind/dev clusters only. */
98
+ readonly insecureSkipTlsVerify: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
99
+ }, undefined>;
100
+ export type KubernetesConnectionConfig = v.InferOutput<typeof kubernetesConnectionConfigSchema>;
101
+ export declare const kubernetesEnvironmentConfigSchema: v.ObjectSchema<{
102
+ /** kube-apiserver root URL, e.g. `https://my-cluster.example:6443`. */
103
+ readonly apiServerUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
104
+ /** PEM CA bundle to verify the apiserver TLS cert (omit only for a publicly-trusted CA). */
105
+ readonly caCertPem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
106
+ /** Skip apiserver TLS verification — strongly discouraged; kind/dev clusters only. */
107
+ readonly insecureSkipTlsVerify: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
108
+ /** Human label for the connection (shown in the UI). */
109
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
110
+ /**
111
+ * Namespace name template for the per-PR environment, e.g. `cf-env-{{pullNumber}}`.
112
+ * Rendered with the provision vars then sanitized to an RFC1123 label; absent ⇒ a
113
+ * default derived from the PR number / block id.
114
+ */
115
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
116
+ /** Where the manifests are read from (co-located in the PR repo, or a separate repo). */
117
+ readonly manifestSource: v.VariantSchema<"type", [v.ObjectSchema<{
118
+ readonly type: v.LiteralSchema<"colocated", undefined>;
119
+ /** File or directory path within the PR repo (read at the PR head branch). */
120
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
121
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
122
+ }, undefined>, v.ObjectSchema<{
123
+ readonly type: v.LiteralSchema<"separate", undefined>;
124
+ /** `owner/repo` of the manifests repo. */
125
+ readonly repo: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be \"owner/repo\"">]>;
126
+ /** Branch/tag/sha to read at; absent ⇒ that repo's default branch. */
127
+ readonly ref: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
128
+ /** File or directory path within the manifests repo. */
129
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
130
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
131
+ }, undefined>], undefined>;
132
+ /** How the environment URL is derived once applied. */
133
+ readonly url: v.VariantSchema<"source", [v.ObjectSchema<{
134
+ readonly source: v.LiteralSchema<"ingressTemplate", undefined>;
135
+ /** Host template, e.g. `{{branch}}.preview.example.com`; rendered with the provision vars. */
136
+ readonly hostTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
137
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
138
+ }, undefined>, v.ObjectSchema<{
139
+ readonly source: v.LiteralSchema<"ingressStatus", undefined>;
140
+ /** Ingress object to read `.status.loadBalancer` from; absent ⇒ the only Ingress applied. */
141
+ readonly ingressName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
142
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
143
+ }, undefined>, v.ObjectSchema<{
144
+ readonly source: v.LiteralSchema<"serviceStatus", undefined>;
145
+ /** Service object to read `.status.loadBalancer` (k3s ServiceLB) from. */
146
+ readonly serviceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
147
+ readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
148
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
149
+ }, undefined>, v.ObjectSchema<{
150
+ readonly source: v.LiteralSchema<"gatewayStatus", undefined>;
151
+ /** Gateway-API `Gateway` to read `.status.addresses[]` from; absent ⇒ the only one applied. */
152
+ readonly gatewayName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
153
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
154
+ }, undefined>, v.ObjectSchema<{
155
+ readonly source: v.LiteralSchema<"httpRouteStatus", undefined>;
156
+ /** `HTTPRoute` whose `parentRefs` resolve to the Gateway address; absent ⇒ the only one applied. */
157
+ readonly httpRouteName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
158
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
159
+ }, undefined>], undefined>;
160
+ /**
161
+ * Optional image reference made available to the manifests as `{{image}}` (e.g. a
162
+ * CI-built image tagged by branch/sha). Itself a template over the provision vars.
163
+ */
164
+ readonly imageTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
165
+ /** Fallback TTL (ms) after which the env is swept + torn down. */
166
+ readonly defaultTtlMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 60000, undefined>]>, undefined>;
167
+ /**
168
+ * How long (seconds) the container deploy adapter waits for each Deployment to roll out
169
+ * before reporting the env still `provisioning` (the backend keeps polling). Only the
170
+ * container-backed render path honors it; absent ⇒ the harness default (180s).
171
+ */
172
+ readonly rolloutTimeoutSeconds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
173
+ /** Extra labels stamped on the namespace + every applied resource. */
174
+ readonly labels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
175
+ /** Extra annotations stamped on the namespace. */
176
+ readonly annotations: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
177
+ }, undefined>;
178
+ export type KubernetesEnvironmentConfig = v.InferOutput<typeof kubernetesEnvironmentConfigSchema>;
179
+ /**
180
+ * A structured image override (the kustomize `images:` equivalent, generalizing the
181
+ * legacy `{{image}}` text substitution). Matches a container image by `name` and
182
+ * overrides its repo and/or tag/digest; the override values are templated over the
183
+ * provision vars (e.g. `newTagTemplate: '{{branch}}'`).
184
+ */
185
+ export declare const kubernetesImageOverrideSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
186
+ /** The image to match (the `name:` in a kustomization `images:` entry), e.g. `registry/app`. */
187
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
188
+ /** Optional replacement repo, templated; absent ⇒ keep the original repo. */
189
+ readonly newNameTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
190
+ /** Replacement tag, templated (e.g. `{{branch}}` / `{{sha}}`); mutually exclusive with digest. */
191
+ readonly newTagTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
192
+ /** Replacement digest, templated; alternative to a tag. */
193
+ readonly digestTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
194
+ }, undefined>, v.CheckAction<{
195
+ name: string;
196
+ newNameTemplate?: string | undefined;
197
+ newTagTemplate?: string | undefined;
198
+ digestTemplate?: string | undefined;
199
+ }, "an image override must set at least one of newNameTemplate, newTagTemplate, or digestTemplate.">, v.CheckAction<{
200
+ name: string;
201
+ newNameTemplate?: string | undefined;
202
+ newTagTemplate?: string | undefined;
203
+ digestTemplate?: string | undefined;
204
+ }, "newTagTemplate and digestTemplate are mutually exclusive on an image override.">]>;
205
+ export type KubernetesImageOverride = v.InferOutput<typeof kubernetesImageOverrideSchema>;
206
+ /** A single templated `--set path=value` for a helm release. */
207
+ export declare const kubernetesHelmSetSchema: v.ObjectSchema<{
208
+ /** Dotted `--set` path, e.g. `config.rateLimit.enabled`. */
209
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
210
+ /** The value, templated over the provision vars. */
211
+ readonly valueTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 2000, undefined>]>;
212
+ }, undefined>;
213
+ export type KubernetesHelmSet = v.InferOutput<typeof kubernetesHelmSetSchema>;
214
+ /**
215
+ * A helm release the deploy adapter installs/upgrades (`helm upgrade --install`).
216
+ * `scope: 'shared'` is a cluster singleton (installed once, never torn down per-PR —
217
+ * e.g. an ingress/gateway controller); `per-environment` (the default) re-installs in
218
+ * each per-PR namespace. The `version` pin is required so provisioning is deterministic.
219
+ */
220
+ export declare const kubernetesHelmReleaseSchema: v.ObjectSchema<{
221
+ /** Release name. */
222
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
223
+ /** Chart ref: an OCI ref (`oci://…`) or, with `repo`, a `repo/chart` name. */
224
+ readonly chart: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
225
+ /** Chart repo URL; absent ⇒ `chart` is an OCI ref. */
226
+ readonly repo: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
227
+ /** PINNED chart version, e.g. `1.2.3` / `v1.2.3` (floating tags like `latest`/`^1.0` rejected). */
228
+ readonly version: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "version must be a pinned semver (e.g. 1.2.3), not a floating tag like latest or ^1.0.">]>;
229
+ /** Namespace to install into, templated; absent ⇒ the environment namespace. */
230
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
231
+ /** Inline `--values` overrides. */
232
+ readonly values: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
233
+ /** Templated `--set` overrides. */
234
+ readonly set: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
235
+ /** Dotted `--set` path, e.g. `config.rateLimit.enabled`. */
236
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
237
+ /** The value, templated over the provision vars. */
238
+ readonly valueTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 2000, undefined>]>;
239
+ }, undefined>, undefined>, undefined>;
240
+ /** Secret-bundle-backed values folded in at provision time (`--set <path>=<secret>`). */
241
+ readonly valuesSecretRefs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
242
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
243
+ readonly secretRef: v.ObjectSchema<{
244
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
245
+ }, undefined>;
246
+ }, undefined>, undefined>, undefined>;
247
+ readonly scope: v.OptionalSchema<v.PicklistSchema<["per-environment", "shared"], undefined>, undefined>;
248
+ }, undefined>;
249
+ export type KubernetesHelmRelease = v.InferOutput<typeof kubernetesHelmReleaseSchema>;
250
+ /** One entry inside an injected Secret: a logical key mapped to a secret-bundle ref OR a templated value. */
251
+ export declare const kubernetesSecretEntrySchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
252
+ /** Key inside the rendered Secret / `.env`. */
253
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
254
+ /** Resolve the value from the workspace encrypted bundle by key. */
255
+ readonly secretRef: v.OptionalSchema<v.ObjectSchema<{
256
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
257
+ }, undefined>, undefined>;
258
+ /** OR a non-secret value, templated over the provision vars. */
259
+ readonly valueTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
260
+ }, undefined>, v.CheckAction<{
261
+ key: string;
262
+ secretRef?: {
263
+ key: string;
264
+ } | undefined;
265
+ valueTemplate?: string | undefined;
266
+ }, "a secret entry must set exactly one of secretRef or valueTemplate.">]>;
267
+ export type KubernetesSecretEntry = v.InferOutput<typeof kubernetesSecretEntrySchema>;
268
+ /**
269
+ * How the deploy adapter feeds resolved secret values in before apply, discriminated by
270
+ * `mode`. The mapping of logical keys is in-repo intent; the values resolve from the
271
+ * encrypted bundle at provision time (the config carries secret KEYS, never values).
272
+ *
273
+ * - `secret`: materialize a `Secret` resource named `secretName` directly in the namespace.
274
+ * - `generatorEnvFile`: write the entries as a `KEY=value` `.env` file at `envFilePath`
275
+ * (repo-relative, inside the overlay tree) BEFORE `kustomize build`, so the overlay's own
276
+ * existing `secretGenerator` consumes it. This is the common ephemeral-environment shape
277
+ * where a Component declares `secretGenerator: { envs: ['.env'] }`, the Secret is named by
278
+ * the overlay, and the real `.env` is supplied at deploy time (e.g. from a secrets manager).
279
+ * Use this instead of `secret` when the manifests already declare a `secretGenerator`, so
280
+ * the two don't collide.
281
+ */
282
+ export declare const kubernetesSecretInjectionSchema: v.VariantSchema<"mode", [v.ObjectSchema<{
283
+ readonly mode: v.LiteralSchema<"secret", undefined>;
284
+ /** Target Secret name in the namespace. */
285
+ readonly secretName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
286
+ /** Secret `type`; absent ⇒ `Opaque`. */
287
+ readonly secretType: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
288
+ readonly entries: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
289
+ /** Key inside the rendered Secret / `.env`. */
290
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
291
+ /** Resolve the value from the workspace encrypted bundle by key. */
292
+ readonly secretRef: v.OptionalSchema<v.ObjectSchema<{
293
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
294
+ }, undefined>, undefined>;
295
+ /** OR a non-secret value, templated over the provision vars. */
296
+ readonly valueTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
297
+ }, undefined>, v.CheckAction<{
298
+ key: string;
299
+ secretRef?: {
300
+ key: string;
301
+ } | undefined;
302
+ valueTemplate?: string | undefined;
303
+ }, "a secret entry must set exactly one of secretRef or valueTemplate.">]>, undefined>;
304
+ }, undefined>, v.ObjectSchema<{
305
+ readonly mode: v.LiteralSchema<"generatorEnvFile", undefined>;
306
+ /**
307
+ * Repo-relative path within the overlay tree to write the `KEY=value` env file the
308
+ * overlay's `secretGenerator` reads (e.g. `overlays/<env>/<component>/.env`). The
309
+ * overlay names the Secret.
310
+ */
311
+ readonly envFilePath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
312
+ readonly entries: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
313
+ /** Key inside the rendered Secret / `.env`. */
314
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
315
+ /** Resolve the value from the workspace encrypted bundle by key. */
316
+ readonly secretRef: v.OptionalSchema<v.ObjectSchema<{
317
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
318
+ }, undefined>, undefined>;
319
+ /** OR a non-secret value, templated over the provision vars. */
320
+ readonly valueTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
321
+ }, undefined>, v.CheckAction<{
322
+ key: string;
323
+ secretRef?: {
324
+ key: string;
325
+ } | undefined;
326
+ valueTemplate?: string | undefined;
327
+ }, "a secret entry must set exactly one of secretRef or valueTemplate.">]>, undefined>;
328
+ }, undefined>], undefined>;
329
+ export type KubernetesSecretInjection = v.InferOutput<typeof kubernetesSecretInjectionSchema>;
330
+ /**
331
+ * The full Kubernetes provision config the deploy adapter consumes: the combined cluster +
332
+ * URL + manifest-source config PLUS the kustomize/helm render inputs (image overrides, helm
333
+ * releases, secret injections). It is assembled at provision time by MERGING the workspace
334
+ * kube engine config (the "how": apiserver, sizing, shared helm releases) with the service's
335
+ * own provisioning (the "what/where": manifest source, per-environment helm releases, image
336
+ * overrides, secret injections) — so the provider reads everything it needs from one place.
337
+ * The native in-Worker REST adapter ignores the render fields (raw manifests only); the
338
+ * container-backed deploy adapter consumes them. Carries secret KEYS, never values.
339
+ */
340
+ export declare const kubernetesProvisionConfigSchema: v.ObjectSchema<{
341
+ /** kube-apiserver root URL, e.g. `https://my-cluster.example:6443`. */
342
+ readonly apiServerUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
343
+ /** PEM CA bundle to verify the apiserver TLS cert (omit only for a publicly-trusted CA). */
344
+ readonly caCertPem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
345
+ /** Skip apiserver TLS verification — strongly discouraged; kind/dev clusters only. */
346
+ readonly insecureSkipTlsVerify: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
347
+ /** Human label for the connection (shown in the UI). */
348
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
349
+ /**
350
+ * Namespace name template for the per-PR environment, e.g. `cf-env-{{pullNumber}}`.
351
+ * Rendered with the provision vars then sanitized to an RFC1123 label; absent ⇒ a
352
+ * default derived from the PR number / block id.
353
+ */
354
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
355
+ /** Where the manifests are read from (co-located in the PR repo, or a separate repo). */
356
+ readonly manifestSource: v.VariantSchema<"type", [v.ObjectSchema<{
357
+ readonly type: v.LiteralSchema<"colocated", undefined>;
358
+ /** File or directory path within the PR repo (read at the PR head branch). */
359
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
360
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
361
+ }, undefined>, v.ObjectSchema<{
362
+ readonly type: v.LiteralSchema<"separate", undefined>;
363
+ /** `owner/repo` of the manifests repo. */
364
+ readonly repo: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be \"owner/repo\"">]>;
365
+ /** Branch/tag/sha to read at; absent ⇒ that repo's default branch. */
366
+ readonly ref: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
367
+ /** File or directory path within the manifests repo. */
368
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
369
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
370
+ }, undefined>], undefined>;
371
+ /** How the environment URL is derived once applied. */
372
+ readonly url: v.VariantSchema<"source", [v.ObjectSchema<{
373
+ readonly source: v.LiteralSchema<"ingressTemplate", undefined>;
374
+ /** Host template, e.g. `{{branch}}.preview.example.com`; rendered with the provision vars. */
375
+ readonly hostTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
376
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
377
+ }, undefined>, v.ObjectSchema<{
378
+ readonly source: v.LiteralSchema<"ingressStatus", undefined>;
379
+ /** Ingress object to read `.status.loadBalancer` from; absent ⇒ the only Ingress applied. */
380
+ readonly ingressName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
381
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
382
+ }, undefined>, v.ObjectSchema<{
383
+ readonly source: v.LiteralSchema<"serviceStatus", undefined>;
384
+ /** Service object to read `.status.loadBalancer` (k3s ServiceLB) from. */
385
+ readonly serviceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
386
+ readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
387
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
388
+ }, undefined>, v.ObjectSchema<{
389
+ readonly source: v.LiteralSchema<"gatewayStatus", undefined>;
390
+ /** Gateway-API `Gateway` to read `.status.addresses[]` from; absent ⇒ the only one applied. */
391
+ readonly gatewayName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
392
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
393
+ }, undefined>, v.ObjectSchema<{
394
+ readonly source: v.LiteralSchema<"httpRouteStatus", undefined>;
395
+ /** `HTTPRoute` whose `parentRefs` resolve to the Gateway address; absent ⇒ the only one applied. */
396
+ readonly httpRouteName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
397
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
398
+ }, undefined>], undefined>;
399
+ /**
400
+ * Optional image reference made available to the manifests as `{{image}}` (e.g. a
401
+ * CI-built image tagged by branch/sha). Itself a template over the provision vars.
402
+ */
403
+ readonly imageTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
404
+ /** Fallback TTL (ms) after which the env is swept + torn down. */
405
+ readonly defaultTtlMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 60000, undefined>]>, undefined>;
406
+ /**
407
+ * How long (seconds) the container deploy adapter waits for each Deployment to roll out
408
+ * before reporting the env still `provisioning` (the backend keeps polling). Only the
409
+ * container-backed render path honors it; absent ⇒ the harness default (180s).
410
+ */
411
+ readonly rolloutTimeoutSeconds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
412
+ /** Extra labels stamped on the namespace + every applied resource. */
413
+ readonly labels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
414
+ /** Extra annotations stamped on the namespace. */
415
+ readonly annotations: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
416
+ /** Structured image overrides (the kustomize `images:` shape), templated over provision vars. */
417
+ readonly images: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
418
+ /** The image to match (the `name:` in a kustomization `images:` entry), e.g. `registry/app`. */
419
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
420
+ /** Optional replacement repo, templated; absent ⇒ keep the original repo. */
421
+ readonly newNameTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
422
+ /** Replacement tag, templated (e.g. `{{branch}}` / `{{sha}}`); mutually exclusive with digest. */
423
+ readonly newTagTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
424
+ /** Replacement digest, templated; alternative to a tag. */
425
+ readonly digestTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
426
+ }, undefined>, v.CheckAction<{
427
+ name: string;
428
+ newNameTemplate?: string | undefined;
429
+ newTagTemplate?: string | undefined;
430
+ digestTemplate?: string | undefined;
431
+ }, "an image override must set at least one of newNameTemplate, newTagTemplate, or digestTemplate.">, v.CheckAction<{
432
+ name: string;
433
+ newNameTemplate?: string | undefined;
434
+ newTagTemplate?: string | undefined;
435
+ digestTemplate?: string | undefined;
436
+ }, "newTagTemplate and digestTemplate are mutually exclusive on an image override.">]>, undefined>, undefined>;
437
+ /** Helm releases to install — workspace-shared singletons merged with the service's per-env ones. */
438
+ readonly helmReleases: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
439
+ /** Release name. */
440
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
441
+ /** Chart ref: an OCI ref (`oci://…`) or, with `repo`, a `repo/chart` name. */
442
+ readonly chart: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
443
+ /** Chart repo URL; absent ⇒ `chart` is an OCI ref. */
444
+ readonly repo: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
445
+ /** PINNED chart version, e.g. `1.2.3` / `v1.2.3` (floating tags like `latest`/`^1.0` rejected). */
446
+ readonly version: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "version must be a pinned semver (e.g. 1.2.3), not a floating tag like latest or ^1.0.">]>;
447
+ /** Namespace to install into, templated; absent ⇒ the environment namespace. */
448
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
449
+ /** Inline `--values` overrides. */
450
+ readonly values: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
451
+ /** Templated `--set` overrides. */
452
+ readonly set: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
453
+ /** Dotted `--set` path, e.g. `config.rateLimit.enabled`. */
454
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
455
+ /** The value, templated over the provision vars. */
456
+ readonly valueTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 2000, undefined>]>;
457
+ }, undefined>, undefined>, undefined>;
458
+ /** Secret-bundle-backed values folded in at provision time (`--set <path>=<secret>`). */
459
+ readonly valuesSecretRefs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
460
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
461
+ readonly secretRef: v.ObjectSchema<{
462
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
463
+ }, undefined>;
464
+ }, undefined>, undefined>, undefined>;
465
+ readonly scope: v.OptionalSchema<v.PicklistSchema<["per-environment", "shared"], undefined>, undefined>;
466
+ }, undefined>, undefined>, undefined>;
467
+ /** Secrets fed in before apply (a `Secret` resource or a `secretGenerator` `.env`). */
468
+ readonly secretInjections: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"mode", [v.ObjectSchema<{
469
+ readonly mode: v.LiteralSchema<"secret", undefined>;
470
+ /** Target Secret name in the namespace. */
471
+ readonly secretName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
472
+ /** Secret `type`; absent ⇒ `Opaque`. */
473
+ readonly secretType: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
474
+ readonly entries: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
475
+ /** Key inside the rendered Secret / `.env`. */
476
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
477
+ /** Resolve the value from the workspace encrypted bundle by key. */
478
+ readonly secretRef: v.OptionalSchema<v.ObjectSchema<{
479
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
480
+ }, undefined>, undefined>;
481
+ /** OR a non-secret value, templated over the provision vars. */
482
+ readonly valueTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
483
+ }, undefined>, v.CheckAction<{
484
+ key: string;
485
+ secretRef?: {
486
+ key: string;
487
+ } | undefined;
488
+ valueTemplate?: string | undefined;
489
+ }, "a secret entry must set exactly one of secretRef or valueTemplate.">]>, undefined>;
490
+ }, undefined>, v.ObjectSchema<{
491
+ readonly mode: v.LiteralSchema<"generatorEnvFile", undefined>;
492
+ /**
493
+ * Repo-relative path within the overlay tree to write the `KEY=value` env file the
494
+ * overlay's `secretGenerator` reads (e.g. `overlays/<env>/<component>/.env`). The
495
+ * overlay names the Secret.
496
+ */
497
+ readonly envFilePath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
498
+ readonly entries: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
499
+ /** Key inside the rendered Secret / `.env`. */
500
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
501
+ /** Resolve the value from the workspace encrypted bundle by key. */
502
+ readonly secretRef: v.OptionalSchema<v.ObjectSchema<{
503
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
504
+ }, undefined>, undefined>;
505
+ /** OR a non-secret value, templated over the provision vars. */
506
+ readonly valueTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
507
+ }, undefined>, v.CheckAction<{
508
+ key: string;
509
+ secretRef?: {
510
+ key: string;
511
+ } | undefined;
512
+ valueTemplate?: string | undefined;
513
+ }, "a secret entry must set exactly one of secretRef or valueTemplate.">]>, undefined>;
514
+ }, undefined>], undefined>, undefined>, undefined>;
515
+ }, undefined>;
516
+ export type KubernetesProvisionConfig = v.InferOutput<typeof kubernetesProvisionConfigSchema>;
517
+ /**
518
+ * The AWS EKS provision config: the full Kubernetes provision config (an EKS apiserver is a
519
+ * standard apiserver, so per-PR namespaces + manifest apply are identical) PLUS the AWS
520
+ * `region` + `clusterName` needed to mint the IAM apiserver token. The AWS credentials ride
521
+ * the secret bundle; the SigV4/STS minting lives in `@cat-factory/eks`.
522
+ */
523
+ export declare const eksProvisionConfigSchema: v.ObjectSchema<{
524
+ readonly region: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be an AWS region slug">, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
525
+ readonly clusterName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
526
+ readonly stsHost: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be a bare host or host:port">, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
527
+ /** kube-apiserver root URL, e.g. `https://my-cluster.example:6443`. */
528
+ readonly apiServerUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
529
+ /** PEM CA bundle to verify the apiserver TLS cert (omit only for a publicly-trusted CA). */
530
+ readonly caCertPem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
531
+ /** Skip apiserver TLS verification — strongly discouraged; kind/dev clusters only. */
532
+ readonly insecureSkipTlsVerify: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
533
+ /** Human label for the connection (shown in the UI). */
534
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
535
+ /**
536
+ * Namespace name template for the per-PR environment, e.g. `cf-env-{{pullNumber}}`.
537
+ * Rendered with the provision vars then sanitized to an RFC1123 label; absent ⇒ a
538
+ * default derived from the PR number / block id.
539
+ */
540
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
541
+ /** Where the manifests are read from (co-located in the PR repo, or a separate repo). */
542
+ readonly manifestSource: v.VariantSchema<"type", [v.ObjectSchema<{
543
+ readonly type: v.LiteralSchema<"colocated", undefined>;
544
+ /** File or directory path within the PR repo (read at the PR head branch). */
545
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
546
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
547
+ }, undefined>, v.ObjectSchema<{
548
+ readonly type: v.LiteralSchema<"separate", undefined>;
549
+ /** `owner/repo` of the manifests repo. */
550
+ readonly repo: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be \"owner/repo\"">]>;
551
+ /** Branch/tag/sha to read at; absent ⇒ that repo's default branch. */
552
+ readonly ref: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
553
+ /** File or directory path within the manifests repo. */
554
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
555
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
556
+ }, undefined>], undefined>;
557
+ /** How the environment URL is derived once applied. */
558
+ readonly url: v.VariantSchema<"source", [v.ObjectSchema<{
559
+ readonly source: v.LiteralSchema<"ingressTemplate", undefined>;
560
+ /** Host template, e.g. `{{branch}}.preview.example.com`; rendered with the provision vars. */
561
+ readonly hostTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
562
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
563
+ }, undefined>, v.ObjectSchema<{
564
+ readonly source: v.LiteralSchema<"ingressStatus", undefined>;
565
+ /** Ingress object to read `.status.loadBalancer` from; absent ⇒ the only Ingress applied. */
566
+ readonly ingressName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
567
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
568
+ }, undefined>, v.ObjectSchema<{
569
+ readonly source: v.LiteralSchema<"serviceStatus", undefined>;
570
+ /** Service object to read `.status.loadBalancer` (k3s ServiceLB) from. */
571
+ readonly serviceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
572
+ readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
573
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
574
+ }, undefined>, v.ObjectSchema<{
575
+ readonly source: v.LiteralSchema<"gatewayStatus", undefined>;
576
+ /** Gateway-API `Gateway` to read `.status.addresses[]` from; absent ⇒ the only one applied. */
577
+ readonly gatewayName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
578
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
579
+ }, undefined>, v.ObjectSchema<{
580
+ readonly source: v.LiteralSchema<"httpRouteStatus", undefined>;
581
+ /** `HTTPRoute` whose `parentRefs` resolve to the Gateway address; absent ⇒ the only one applied. */
582
+ readonly httpRouteName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
583
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
584
+ }, undefined>], undefined>;
585
+ /**
586
+ * Optional image reference made available to the manifests as `{{image}}` (e.g. a
587
+ * CI-built image tagged by branch/sha). Itself a template over the provision vars.
588
+ */
589
+ readonly imageTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
590
+ /** Fallback TTL (ms) after which the env is swept + torn down. */
591
+ readonly defaultTtlMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 60000, undefined>]>, undefined>;
592
+ /**
593
+ * How long (seconds) the container deploy adapter waits for each Deployment to roll out
594
+ * before reporting the env still `provisioning` (the backend keeps polling). Only the
595
+ * container-backed render path honors it; absent ⇒ the harness default (180s).
596
+ */
597
+ readonly rolloutTimeoutSeconds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
598
+ /** Extra labels stamped on the namespace + every applied resource. */
599
+ readonly labels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
600
+ /** Extra annotations stamped on the namespace. */
601
+ readonly annotations: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
602
+ /** Structured image overrides (the kustomize `images:` shape), templated over provision vars. */
603
+ readonly images: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
604
+ /** The image to match (the `name:` in a kustomization `images:` entry), e.g. `registry/app`. */
605
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
606
+ /** Optional replacement repo, templated; absent ⇒ keep the original repo. */
607
+ readonly newNameTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
608
+ /** Replacement tag, templated (e.g. `{{branch}}` / `{{sha}}`); mutually exclusive with digest. */
609
+ readonly newTagTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
610
+ /** Replacement digest, templated; alternative to a tag. */
611
+ readonly digestTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
612
+ }, undefined>, v.CheckAction<{
613
+ name: string;
614
+ newNameTemplate?: string | undefined;
615
+ newTagTemplate?: string | undefined;
616
+ digestTemplate?: string | undefined;
617
+ }, "an image override must set at least one of newNameTemplate, newTagTemplate, or digestTemplate.">, v.CheckAction<{
618
+ name: string;
619
+ newNameTemplate?: string | undefined;
620
+ newTagTemplate?: string | undefined;
621
+ digestTemplate?: string | undefined;
622
+ }, "newTagTemplate and digestTemplate are mutually exclusive on an image override.">]>, undefined>, undefined>;
623
+ /** Helm releases to install — workspace-shared singletons merged with the service's per-env ones. */
624
+ readonly helmReleases: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
625
+ /** Release name. */
626
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
627
+ /** Chart ref: an OCI ref (`oci://…`) or, with `repo`, a `repo/chart` name. */
628
+ readonly chart: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
629
+ /** Chart repo URL; absent ⇒ `chart` is an OCI ref. */
630
+ readonly repo: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
631
+ /** PINNED chart version, e.g. `1.2.3` / `v1.2.3` (floating tags like `latest`/`^1.0` rejected). */
632
+ readonly version: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "version must be a pinned semver (e.g. 1.2.3), not a floating tag like latest or ^1.0.">]>;
633
+ /** Namespace to install into, templated; absent ⇒ the environment namespace. */
634
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
635
+ /** Inline `--values` overrides. */
636
+ readonly values: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
637
+ /** Templated `--set` overrides. */
638
+ readonly set: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
639
+ /** Dotted `--set` path, e.g. `config.rateLimit.enabled`. */
640
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
641
+ /** The value, templated over the provision vars. */
642
+ readonly valueTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 2000, undefined>]>;
643
+ }, undefined>, undefined>, undefined>;
644
+ /** Secret-bundle-backed values folded in at provision time (`--set <path>=<secret>`). */
645
+ readonly valuesSecretRefs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
646
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
647
+ readonly secretRef: v.ObjectSchema<{
648
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
649
+ }, undefined>;
650
+ }, undefined>, undefined>, undefined>;
651
+ readonly scope: v.OptionalSchema<v.PicklistSchema<["per-environment", "shared"], undefined>, undefined>;
652
+ }, undefined>, undefined>, undefined>;
653
+ /** Secrets fed in before apply (a `Secret` resource or a `secretGenerator` `.env`). */
654
+ readonly secretInjections: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"mode", [v.ObjectSchema<{
655
+ readonly mode: v.LiteralSchema<"secret", undefined>;
656
+ /** Target Secret name in the namespace. */
657
+ readonly secretName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
658
+ /** Secret `type`; absent ⇒ `Opaque`. */
659
+ readonly secretType: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
660
+ readonly entries: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
661
+ /** Key inside the rendered Secret / `.env`. */
662
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
663
+ /** Resolve the value from the workspace encrypted bundle by key. */
664
+ readonly secretRef: v.OptionalSchema<v.ObjectSchema<{
665
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
666
+ }, undefined>, undefined>;
667
+ /** OR a non-secret value, templated over the provision vars. */
668
+ readonly valueTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
669
+ }, undefined>, v.CheckAction<{
670
+ key: string;
671
+ secretRef?: {
672
+ key: string;
673
+ } | undefined;
674
+ valueTemplate?: string | undefined;
675
+ }, "a secret entry must set exactly one of secretRef or valueTemplate.">]>, undefined>;
676
+ }, undefined>, v.ObjectSchema<{
677
+ readonly mode: v.LiteralSchema<"generatorEnvFile", undefined>;
678
+ /**
679
+ * Repo-relative path within the overlay tree to write the `KEY=value` env file the
680
+ * overlay's `secretGenerator` reads (e.g. `overlays/<env>/<component>/.env`). The
681
+ * overlay names the Secret.
682
+ */
683
+ readonly envFilePath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
684
+ readonly entries: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
685
+ /** Key inside the rendered Secret / `.env`. */
686
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
687
+ /** Resolve the value from the workspace encrypted bundle by key. */
688
+ readonly secretRef: v.OptionalSchema<v.ObjectSchema<{
689
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
690
+ }, undefined>, undefined>;
691
+ /** OR a non-secret value, templated over the provision vars. */
692
+ readonly valueTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
693
+ }, undefined>, v.CheckAction<{
694
+ key: string;
695
+ secretRef?: {
696
+ key: string;
697
+ } | undefined;
698
+ valueTemplate?: string | undefined;
699
+ }, "a secret entry must set exactly one of secretRef or valueTemplate.">]>, undefined>;
700
+ }, undefined>], undefined>, undefined>, undefined>;
701
+ }, undefined>;
702
+ export type EksProvisionConfig = v.InferOutput<typeof eksProvisionConfigSchema>;
703
+ /**
704
+ * The EKS counterpart of {@link kubernetesConnectionConfigSchema}: what it takes to reach the
705
+ * cluster, which on EKS includes the AWS coordinates the apiserver token is minted against.
706
+ * Same split, same reason — a reclaim validates the connection and not the provisioning recipe.
707
+ */
708
+ export declare const eksConnectionConfigSchema: v.ObjectSchema<{
709
+ readonly region: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be an AWS region slug">, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
710
+ readonly clusterName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
711
+ readonly stsHost: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be a bare host or host:port">, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
712
+ /** kube-apiserver root URL, e.g. `https://my-cluster.example:6443`. */
713
+ readonly apiServerUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
714
+ /** PEM CA bundle to verify the apiserver TLS cert (omit only for a publicly-trusted CA). */
715
+ readonly caCertPem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
716
+ /** Skip apiserver TLS verification — strongly discouraged; kind/dev clusters only. */
717
+ readonly insecureSkipTlsVerify: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
718
+ }, undefined>;
719
+ export type EksConnectionConfig = v.InferOutput<typeof eksConnectionConfigSchema>;
720
+ //# sourceMappingURL=environments-kubernetes.d.ts.map