@cat-factory/contracts 0.70.0 → 0.71.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.
@@ -1952,6 +1952,13 @@ export declare const environmentHandlerViewSchema: v.ObjectSchema<{
1952
1952
  readonly secretKeys: v.ArraySchema<v.StringSchema<undefined>, undefined>;
1953
1953
  /** For `remote-custom`: the manifest id this provider accepts; `null` otherwise. */
1954
1954
  readonly acceptsManifestId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1955
+ /**
1956
+ * The registry backend kind that builds this handler's provider (`manifest`, `kubernetes`,
1957
+ * or a deployment-registered custom kind). Lets the connect form pre-select the right backend
1958
+ * when editing a saved handler — distinct from `providerId`, which is the connection's own
1959
+ * identifier, not the registry slug.
1960
+ */
1961
+ readonly backendKind: v.StringSchema<undefined>;
1955
1962
  /** The stored handler config, sans secrets, for connect-form prefill on edit. */
1956
1963
  readonly config: v.OptionalSchema<v.VariantSchema<"engine", [v.ObjectSchema<{
1957
1964
  readonly engine: v.LiteralSchema<"local-docker", undefined>;
@@ -2882,6 +2889,474 @@ export declare const registerEnvironmentHandlerSchema: v.ObjectSchema<{
2882
2889
  readonly secrets: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
2883
2890
  }, undefined>;
2884
2891
  export type RegisterEnvironmentHandlerInput = v.InferOutput<typeof registerEnvironmentHandlerSchema>;
2892
+ /**
2893
+ * Probe a per-type infra handler connection before saving (nothing persisted). Carries the
2894
+ * engine connection config + its (write-only) secret bundle, optionally pinning the registry
2895
+ * backend that builds the provider (else resolved from the engine). The same shape as
2896
+ * {@link registerEnvironmentHandlerSchema} minus the persistence-only `provisionType`/`manifestId`.
2897
+ */
2898
+ export declare const testEnvironmentHandlerSchema: v.ObjectSchema<{
2899
+ readonly config: v.VariantSchema<"engine", [v.ObjectSchema<{
2900
+ readonly engine: v.LiteralSchema<"local-docker", undefined>;
2901
+ readonly manifest: v.ObjectSchema<{
2902
+ readonly providerId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
2903
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
2904
+ /** Management API root; provision/status/teardown paths are appended to it. */
2905
+ readonly baseUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
2906
+ readonly auth: v.VariantSchema<"type", [v.ObjectSchema<{
2907
+ readonly type: v.LiteralSchema<"none", undefined>;
2908
+ }, undefined>, v.ObjectSchema<{
2909
+ readonly type: v.LiteralSchema<"api_key", undefined>;
2910
+ readonly headerName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2911
+ readonly secretRef: v.ObjectSchema<{
2912
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
2913
+ }, undefined>;
2914
+ /** Optional prefix prepended to the secret value, e.g. `Token `. */
2915
+ readonly valuePrefix: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2916
+ }, undefined>, v.ObjectSchema<{
2917
+ readonly type: v.LiteralSchema<"bearer", undefined>;
2918
+ readonly secretRef: v.ObjectSchema<{
2919
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
2920
+ }, undefined>;
2921
+ }, undefined>, v.ObjectSchema<{
2922
+ readonly type: v.LiteralSchema<"basic", undefined>;
2923
+ readonly usernameSecretRef: v.ObjectSchema<{
2924
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
2925
+ }, undefined>;
2926
+ readonly passwordSecretRef: v.ObjectSchema<{
2927
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
2928
+ }, undefined>;
2929
+ }, undefined>, v.ObjectSchema<{
2930
+ readonly type: v.LiteralSchema<"oauth2_client_credentials", undefined>;
2931
+ readonly tokenUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
2932
+ readonly clientIdSecretRef: v.ObjectSchema<{
2933
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
2934
+ }, undefined>;
2935
+ readonly clientSecretSecretRef: v.ObjectSchema<{
2936
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
2937
+ }, undefined>;
2938
+ readonly scope: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2939
+ readonly audience: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2940
+ }, undefined>, v.ObjectSchema<{
2941
+ readonly type: v.LiteralSchema<"custom_headers", undefined>;
2942
+ readonly headers: v.ArraySchema<v.ObjectSchema<{
2943
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2944
+ readonly secretRef: v.ObjectSchema<{
2945
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
2946
+ }, undefined>;
2947
+ }, undefined>, undefined>;
2948
+ }, undefined>], undefined>;
2949
+ readonly provision: v.ObjectSchema<{
2950
+ readonly method: v.PicklistSchema<["GET", "POST", "PUT", "PATCH", "DELETE"], undefined>;
2951
+ readonly pathTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
2952
+ readonly query: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2953
+ readonly key: v.StringSchema<undefined>;
2954
+ readonly value: v.StringSchema<undefined>;
2955
+ }, undefined>, undefined>, undefined>;
2956
+ readonly headers: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2957
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2958
+ readonly value: v.StringSchema<undefined>;
2959
+ }, undefined>, undefined>, undefined>;
2960
+ readonly bodyTemplate: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2961
+ /** Per-call timeout (ms). Bounded; defaults applied by the adapter. */
2962
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
2963
+ }, undefined>;
2964
+ /** Optional: polled to observe async provisioning progress. */
2965
+ readonly status: v.OptionalSchema<v.ObjectSchema<{
2966
+ readonly method: v.PicklistSchema<["GET", "POST", "PUT", "PATCH", "DELETE"], undefined>;
2967
+ readonly pathTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
2968
+ readonly query: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2969
+ readonly key: v.StringSchema<undefined>;
2970
+ readonly value: v.StringSchema<undefined>;
2971
+ }, undefined>, undefined>, undefined>;
2972
+ readonly headers: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2973
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2974
+ readonly value: v.StringSchema<undefined>;
2975
+ }, undefined>, undefined>, undefined>;
2976
+ readonly bodyTemplate: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2977
+ /** Per-call timeout (ms). Bounded; defaults applied by the adapter. */
2978
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
2979
+ }, undefined>, undefined>;
2980
+ /** Optional: called to destroy the environment (manual or on TTL expiry). */
2981
+ readonly teardown: v.OptionalSchema<v.ObjectSchema<{
2982
+ readonly method: v.PicklistSchema<["GET", "POST", "PUT", "PATCH", "DELETE"], undefined>;
2983
+ readonly pathTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
2984
+ readonly query: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2985
+ readonly key: v.StringSchema<undefined>;
2986
+ readonly value: v.StringSchema<undefined>;
2987
+ }, undefined>, undefined>, undefined>;
2988
+ readonly headers: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2989
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2990
+ readonly value: v.StringSchema<undefined>;
2991
+ }, undefined>, undefined>, undefined>;
2992
+ readonly bodyTemplate: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2993
+ /** Per-call timeout (ms). Bounded; defaults applied by the adapter. */
2994
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
2995
+ }, undefined>, undefined>;
2996
+ readonly response: v.ObjectSchema<{
2997
+ readonly urlPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2998
+ readonly statusPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2999
+ readonly statusMap: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3000
+ readonly from: v.StringSchema<undefined>;
3001
+ readonly to: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
3002
+ }, undefined>, undefined>, undefined>;
3003
+ readonly expiresAtPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3004
+ readonly externalIdPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3005
+ readonly access: v.OptionalSchema<v.ObjectSchema<{
3006
+ readonly scheme: v.PicklistSchema<["none", "bearer", "basic", "custom_header"], undefined>;
3007
+ readonly tokenPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3008
+ readonly usernamePath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3009
+ readonly passwordPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3010
+ readonly headerName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3011
+ readonly headerValuePath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3012
+ }, undefined>, undefined>;
3013
+ }, undefined>;
3014
+ /** Fallback TTL (ms) when the response carries no explicit expiry. */
3015
+ readonly defaultTtlMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 60000, undefined>]>, undefined>;
3016
+ /**
3017
+ * Opaque, provider-specific configuration for a CUSTOM backend (e.g. a Kargo project,
3018
+ * link-selection key, status map). The generic HttpEnvironmentProvider ignores it
3019
+ * entirely; a custom backend — registered by reference into the app-owned
3020
+ * `EnvironmentBackendRegistry` (see `backend/docs/native-environment-adapter.md`) — reads
3021
+ * + validates it off the per-call
3022
+ * `manifest`. This is the per-WORKSPACE config carrier: a custom backend rides the generic
3023
+ * manifest member of `environmentBackendConfigSchema`, so its bespoke settings live here and
3024
+ * its credentials in the secret bundle. NOT covered by the manifest URL/SSRF checks (which
3025
+ * only guard `baseUrl`/`tokenUrl`); a backend that puts a URL here must guard it itself
3026
+ * (reuse the exported `UrlSafetyPolicy`).
3027
+ */
3028
+ readonly providerConfig: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
3029
+ }, undefined>;
3030
+ }, undefined>, v.ObjectSchema<{
3031
+ readonly engine: v.LiteralSchema<"local-k3s", undefined>;
3032
+ readonly kubernetes: v.ObjectSchema<{
3033
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3034
+ /** kube-apiserver root URL, e.g. `https://my-cluster.example:6443`. */
3035
+ readonly apiServerUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
3036
+ /** PEM CA bundle to verify the apiserver TLS cert (omit only for a publicly-trusted CA). */
3037
+ readonly caCertPem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3038
+ /** Skip apiserver TLS verification — strongly discouraged; kind/dev clusters only. */
3039
+ readonly insecureSkipTlsVerify: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3040
+ /**
3041
+ * Namespace name template for the per-PR environment, e.g. `cf-env-{{pullNumber}}`. With
3042
+ * `renderer: 'kustomize'`, ABSENT ⇒ honor the overlay's own `namespace:` when it pins one
3043
+ * (the shared-namespace ephemeral-env shape, where base + overlay name a fixed namespace);
3044
+ * SET ⇒ override it (the adapter sets the namespace at build time) for true per-PR
3045
+ * isolation. For raw manifests, absent ⇒ a default derived from the PR number / block id.
3046
+ */
3047
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
3048
+ /** How the environment URL is derived once applied. */
3049
+ readonly url: v.VariantSchema<"source", [v.ObjectSchema<{
3050
+ readonly source: v.LiteralSchema<"ingressTemplate", undefined>;
3051
+ /** Host template, e.g. `{{branch}}.preview.example.com`; rendered with the provision vars. */
3052
+ readonly hostTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3053
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
3054
+ }, undefined>, v.ObjectSchema<{
3055
+ readonly source: v.LiteralSchema<"ingressStatus", undefined>;
3056
+ /** Ingress object to read `.status.loadBalancer` from; absent ⇒ the only Ingress applied. */
3057
+ readonly ingressName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
3058
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
3059
+ }, undefined>, v.ObjectSchema<{
3060
+ readonly source: v.LiteralSchema<"serviceStatus", undefined>;
3061
+ /** Service object to read `.status.loadBalancer` (k3s ServiceLB) from. */
3062
+ readonly serviceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
3063
+ 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>;
3064
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
3065
+ }, undefined>, v.ObjectSchema<{
3066
+ readonly source: v.LiteralSchema<"gatewayStatus", undefined>;
3067
+ /** Gateway-API `Gateway` to read `.status.addresses[]` from; absent ⇒ the only one applied. */
3068
+ readonly gatewayName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
3069
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
3070
+ }, undefined>, v.ObjectSchema<{
3071
+ readonly source: v.LiteralSchema<"httpRouteStatus", undefined>;
3072
+ /** `HTTPRoute` whose `parentRefs` resolve to the Gateway address; absent ⇒ the only one applied. */
3073
+ readonly httpRouteName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
3074
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
3075
+ }, undefined>], undefined>;
3076
+ /** Optional image reference made available to the manifests as `{{image}}`. */
3077
+ readonly imageTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3078
+ /** Fallback TTL (ms) after which the env is swept + torn down. */
3079
+ readonly defaultTtlMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 60000, undefined>]>, undefined>;
3080
+ /**
3081
+ * How long (seconds) the container deploy adapter waits for each Deployment to roll out
3082
+ * before reporting the env still `provisioning` (the backend keeps polling). Absent ⇒ the
3083
+ * harness default (180s). Merged into the provision config via `...kube` at provision time.
3084
+ */
3085
+ readonly rolloutTimeoutSeconds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
3086
+ /** Extra labels stamped on the namespace + every applied resource. */
3087
+ readonly labels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
3088
+ /** Extra annotations stamped on the namespace. */
3089
+ readonly annotations: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
3090
+ /**
3091
+ * Workspace-level (cluster-singleton) helm releases the deploy adapter ensures before
3092
+ * applying a service's manifests — e.g. an ingress/gateway controller shared by every
3093
+ * per-PR env. Use `scope: 'shared'`; installed once, never torn down per-PR. Merged
3094
+ * with the service's own (per-environment) `helmReleases` at provision time.
3095
+ */
3096
+ readonly helmReleases: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3097
+ /** Release name. */
3098
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3099
+ /** Chart ref: an OCI ref (`oci://…`) or, with `repo`, a `repo/chart` name. */
3100
+ readonly chart: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3101
+ /** Chart repo URL; absent ⇒ `chart` is an OCI ref. */
3102
+ readonly repo: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
3103
+ /** PINNED chart version, e.g. `1.2.3` / `v1.2.3` (floating tags like `latest`/`^1.0` rejected). */
3104
+ 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.">]>;
3105
+ /** Namespace to install into, templated; absent ⇒ the environment namespace. */
3106
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3107
+ /** Inline `--values` overrides. */
3108
+ readonly values: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
3109
+ /** Templated `--set` overrides. */
3110
+ readonly set: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3111
+ /** Dotted `--set` path, e.g. `config.rateLimit.enabled`. */
3112
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3113
+ /** The value, templated over the provision vars. */
3114
+ readonly valueTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 2000, undefined>]>;
3115
+ }, undefined>, undefined>, undefined>;
3116
+ /** Secret-bundle-backed values folded in at provision time (`--set <path>=<secret>`). */
3117
+ readonly valuesSecretRefs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3118
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3119
+ readonly secretRef: v.ObjectSchema<{
3120
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3121
+ }, undefined>;
3122
+ }, undefined>, undefined>, undefined>;
3123
+ readonly scope: v.OptionalSchema<v.PicklistSchema<["per-environment", "shared"], undefined>, undefined>;
3124
+ }, undefined>, undefined>, undefined>;
3125
+ }, undefined>;
3126
+ }, undefined>, v.ObjectSchema<{
3127
+ readonly engine: v.LiteralSchema<"remote-kubernetes", undefined>;
3128
+ readonly kubernetes: v.ObjectSchema<{
3129
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3130
+ /** kube-apiserver root URL, e.g. `https://my-cluster.example:6443`. */
3131
+ readonly apiServerUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
3132
+ /** PEM CA bundle to verify the apiserver TLS cert (omit only for a publicly-trusted CA). */
3133
+ readonly caCertPem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3134
+ /** Skip apiserver TLS verification — strongly discouraged; kind/dev clusters only. */
3135
+ readonly insecureSkipTlsVerify: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3136
+ /**
3137
+ * Namespace name template for the per-PR environment, e.g. `cf-env-{{pullNumber}}`. With
3138
+ * `renderer: 'kustomize'`, ABSENT ⇒ honor the overlay's own `namespace:` when it pins one
3139
+ * (the shared-namespace ephemeral-env shape, where base + overlay name a fixed namespace);
3140
+ * SET ⇒ override it (the adapter sets the namespace at build time) for true per-PR
3141
+ * isolation. For raw manifests, absent ⇒ a default derived from the PR number / block id.
3142
+ */
3143
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
3144
+ /** How the environment URL is derived once applied. */
3145
+ readonly url: v.VariantSchema<"source", [v.ObjectSchema<{
3146
+ readonly source: v.LiteralSchema<"ingressTemplate", undefined>;
3147
+ /** Host template, e.g. `{{branch}}.preview.example.com`; rendered with the provision vars. */
3148
+ readonly hostTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3149
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
3150
+ }, undefined>, v.ObjectSchema<{
3151
+ readonly source: v.LiteralSchema<"ingressStatus", undefined>;
3152
+ /** Ingress object to read `.status.loadBalancer` from; absent ⇒ the only Ingress applied. */
3153
+ readonly ingressName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
3154
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
3155
+ }, undefined>, v.ObjectSchema<{
3156
+ readonly source: v.LiteralSchema<"serviceStatus", undefined>;
3157
+ /** Service object to read `.status.loadBalancer` (k3s ServiceLB) from. */
3158
+ readonly serviceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
3159
+ 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>;
3160
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
3161
+ }, undefined>, v.ObjectSchema<{
3162
+ readonly source: v.LiteralSchema<"gatewayStatus", undefined>;
3163
+ /** Gateway-API `Gateway` to read `.status.addresses[]` from; absent ⇒ the only one applied. */
3164
+ readonly gatewayName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
3165
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
3166
+ }, undefined>, v.ObjectSchema<{
3167
+ readonly source: v.LiteralSchema<"httpRouteStatus", undefined>;
3168
+ /** `HTTPRoute` whose `parentRefs` resolve to the Gateway address; absent ⇒ the only one applied. */
3169
+ readonly httpRouteName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
3170
+ readonly scheme: v.OptionalSchema<v.PicklistSchema<["http", "https"], undefined>, undefined>;
3171
+ }, undefined>], undefined>;
3172
+ /** Optional image reference made available to the manifests as `{{image}}`. */
3173
+ readonly imageTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3174
+ /** Fallback TTL (ms) after which the env is swept + torn down. */
3175
+ readonly defaultTtlMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 60000, undefined>]>, undefined>;
3176
+ /**
3177
+ * How long (seconds) the container deploy adapter waits for each Deployment to roll out
3178
+ * before reporting the env still `provisioning` (the backend keeps polling). Absent ⇒ the
3179
+ * harness default (180s). Merged into the provision config via `...kube` at provision time.
3180
+ */
3181
+ readonly rolloutTimeoutSeconds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
3182
+ /** Extra labels stamped on the namespace + every applied resource. */
3183
+ readonly labels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
3184
+ /** Extra annotations stamped on the namespace. */
3185
+ readonly annotations: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
3186
+ /**
3187
+ * Workspace-level (cluster-singleton) helm releases the deploy adapter ensures before
3188
+ * applying a service's manifests — e.g. an ingress/gateway controller shared by every
3189
+ * per-PR env. Use `scope: 'shared'`; installed once, never torn down per-PR. Merged
3190
+ * with the service's own (per-environment) `helmReleases` at provision time.
3191
+ */
3192
+ readonly helmReleases: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3193
+ /** Release name. */
3194
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3195
+ /** Chart ref: an OCI ref (`oci://…`) or, with `repo`, a `repo/chart` name. */
3196
+ readonly chart: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3197
+ /** Chart repo URL; absent ⇒ `chart` is an OCI ref. */
3198
+ readonly repo: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
3199
+ /** PINNED chart version, e.g. `1.2.3` / `v1.2.3` (floating tags like `latest`/`^1.0` rejected). */
3200
+ 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.">]>;
3201
+ /** Namespace to install into, templated; absent ⇒ the environment namespace. */
3202
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3203
+ /** Inline `--values` overrides. */
3204
+ readonly values: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
3205
+ /** Templated `--set` overrides. */
3206
+ readonly set: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3207
+ /** Dotted `--set` path, e.g. `config.rateLimit.enabled`. */
3208
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3209
+ /** The value, templated over the provision vars. */
3210
+ readonly valueTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 2000, undefined>]>;
3211
+ }, undefined>, undefined>, undefined>;
3212
+ /** Secret-bundle-backed values folded in at provision time (`--set <path>=<secret>`). */
3213
+ readonly valuesSecretRefs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3214
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3215
+ readonly secretRef: v.ObjectSchema<{
3216
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3217
+ }, undefined>;
3218
+ }, undefined>, undefined>, undefined>;
3219
+ readonly scope: v.OptionalSchema<v.PicklistSchema<["per-environment", "shared"], undefined>, undefined>;
3220
+ }, undefined>, undefined>, undefined>;
3221
+ }, undefined>;
3222
+ }, undefined>, v.ObjectSchema<{
3223
+ readonly engine: v.LiteralSchema<"remote-custom", undefined>;
3224
+ readonly manifest: v.ObjectSchema<{
3225
+ readonly providerId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3226
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3227
+ /** Management API root; provision/status/teardown paths are appended to it. */
3228
+ readonly baseUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
3229
+ readonly auth: v.VariantSchema<"type", [v.ObjectSchema<{
3230
+ readonly type: v.LiteralSchema<"none", undefined>;
3231
+ }, undefined>, v.ObjectSchema<{
3232
+ readonly type: v.LiteralSchema<"api_key", undefined>;
3233
+ readonly headerName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3234
+ readonly secretRef: v.ObjectSchema<{
3235
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3236
+ }, undefined>;
3237
+ /** Optional prefix prepended to the secret value, e.g. `Token `. */
3238
+ readonly valuePrefix: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3239
+ }, undefined>, v.ObjectSchema<{
3240
+ readonly type: v.LiteralSchema<"bearer", undefined>;
3241
+ readonly secretRef: v.ObjectSchema<{
3242
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3243
+ }, undefined>;
3244
+ }, undefined>, v.ObjectSchema<{
3245
+ readonly type: v.LiteralSchema<"basic", undefined>;
3246
+ readonly usernameSecretRef: v.ObjectSchema<{
3247
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3248
+ }, undefined>;
3249
+ readonly passwordSecretRef: v.ObjectSchema<{
3250
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3251
+ }, undefined>;
3252
+ }, undefined>, v.ObjectSchema<{
3253
+ readonly type: v.LiteralSchema<"oauth2_client_credentials", undefined>;
3254
+ readonly tokenUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
3255
+ readonly clientIdSecretRef: v.ObjectSchema<{
3256
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3257
+ }, undefined>;
3258
+ readonly clientSecretSecretRef: v.ObjectSchema<{
3259
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3260
+ }, undefined>;
3261
+ readonly scope: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3262
+ readonly audience: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3263
+ }, undefined>, v.ObjectSchema<{
3264
+ readonly type: v.LiteralSchema<"custom_headers", undefined>;
3265
+ readonly headers: v.ArraySchema<v.ObjectSchema<{
3266
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3267
+ readonly secretRef: v.ObjectSchema<{
3268
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3269
+ }, undefined>;
3270
+ }, undefined>, undefined>;
3271
+ }, undefined>], undefined>;
3272
+ readonly provision: v.ObjectSchema<{
3273
+ readonly method: v.PicklistSchema<["GET", "POST", "PUT", "PATCH", "DELETE"], undefined>;
3274
+ readonly pathTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
3275
+ readonly query: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3276
+ readonly key: v.StringSchema<undefined>;
3277
+ readonly value: v.StringSchema<undefined>;
3278
+ }, undefined>, undefined>, undefined>;
3279
+ readonly headers: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3280
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3281
+ readonly value: v.StringSchema<undefined>;
3282
+ }, undefined>, undefined>, undefined>;
3283
+ readonly bodyTemplate: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3284
+ /** Per-call timeout (ms). Bounded; defaults applied by the adapter. */
3285
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
3286
+ }, undefined>;
3287
+ /** Optional: polled to observe async provisioning progress. */
3288
+ readonly status: v.OptionalSchema<v.ObjectSchema<{
3289
+ readonly method: v.PicklistSchema<["GET", "POST", "PUT", "PATCH", "DELETE"], undefined>;
3290
+ readonly pathTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
3291
+ readonly query: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3292
+ readonly key: v.StringSchema<undefined>;
3293
+ readonly value: v.StringSchema<undefined>;
3294
+ }, undefined>, undefined>, undefined>;
3295
+ readonly headers: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3296
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3297
+ readonly value: v.StringSchema<undefined>;
3298
+ }, undefined>, undefined>, undefined>;
3299
+ readonly bodyTemplate: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3300
+ /** Per-call timeout (ms). Bounded; defaults applied by the adapter. */
3301
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
3302
+ }, undefined>, undefined>;
3303
+ /** Optional: called to destroy the environment (manual or on TTL expiry). */
3304
+ readonly teardown: v.OptionalSchema<v.ObjectSchema<{
3305
+ readonly method: v.PicklistSchema<["GET", "POST", "PUT", "PATCH", "DELETE"], undefined>;
3306
+ readonly pathTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
3307
+ readonly query: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3308
+ readonly key: v.StringSchema<undefined>;
3309
+ readonly value: v.StringSchema<undefined>;
3310
+ }, undefined>, undefined>, undefined>;
3311
+ readonly headers: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3312
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3313
+ readonly value: v.StringSchema<undefined>;
3314
+ }, undefined>, undefined>, undefined>;
3315
+ readonly bodyTemplate: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3316
+ /** Per-call timeout (ms). Bounded; defaults applied by the adapter. */
3317
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
3318
+ }, undefined>, undefined>;
3319
+ readonly response: v.ObjectSchema<{
3320
+ readonly urlPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3321
+ readonly statusPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3322
+ readonly statusMap: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3323
+ readonly from: v.StringSchema<undefined>;
3324
+ readonly to: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
3325
+ }, undefined>, undefined>, undefined>;
3326
+ readonly expiresAtPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3327
+ readonly externalIdPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3328
+ readonly access: v.OptionalSchema<v.ObjectSchema<{
3329
+ readonly scheme: v.PicklistSchema<["none", "bearer", "basic", "custom_header"], undefined>;
3330
+ readonly tokenPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3331
+ readonly usernamePath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3332
+ readonly passwordPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3333
+ readonly headerName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3334
+ readonly headerValuePath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3335
+ }, undefined>, undefined>;
3336
+ }, undefined>;
3337
+ /** Fallback TTL (ms) when the response carries no explicit expiry. */
3338
+ readonly defaultTtlMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 60000, undefined>]>, undefined>;
3339
+ /**
3340
+ * Opaque, provider-specific configuration for a CUSTOM backend (e.g. a Kargo project,
3341
+ * link-selection key, status map). The generic HttpEnvironmentProvider ignores it
3342
+ * entirely; a custom backend — registered by reference into the app-owned
3343
+ * `EnvironmentBackendRegistry` (see `backend/docs/native-environment-adapter.md`) — reads
3344
+ * + validates it off the per-call
3345
+ * `manifest`. This is the per-WORKSPACE config carrier: a custom backend rides the generic
3346
+ * manifest member of `environmentBackendConfigSchema`, so its bespoke settings live here and
3347
+ * its credentials in the secret bundle. NOT covered by the manifest URL/SSRF checks (which
3348
+ * only guard `baseUrl`/`tokenUrl`); a backend that puts a URL here must guard it itself
3349
+ * (reuse the exported `UrlSafetyPolicy`).
3350
+ */
3351
+ readonly providerConfig: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
3352
+ }, undefined>;
3353
+ /** Which custom manifest shape this remote provider consumes — matched to a service's `manifestId`. */
3354
+ readonly acceptsManifestId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3355
+ }, undefined>], undefined>;
3356
+ readonly backendKind: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3357
+ readonly secrets: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
3358
+ }, undefined>;
3359
+ export type TestEnvironmentHandlerInput = v.InferOutput<typeof testEnvironmentHandlerSchema>;
2885
3360
  /**
2886
3361
  * The body for a per-USER handler override PUT, where the provision type is taken from the
2887
3362
  * path (`/me/environment-handlers/:workspaceId/:provisionType`) — so the body carries only
@@ -3366,6 +3841,13 @@ export declare const environmentHandlersBundleSchema: v.ObjectSchema<{
3366
3841
  readonly secretKeys: v.ArraySchema<v.StringSchema<undefined>, undefined>;
3367
3842
  /** For `remote-custom`: the manifest id this provider accepts; `null` otherwise. */
3368
3843
  readonly acceptsManifestId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3844
+ /**
3845
+ * The registry backend kind that builds this handler's provider (`manifest`, `kubernetes`,
3846
+ * or a deployment-registered custom kind). Lets the connect form pre-select the right backend
3847
+ * when editing a saved handler — distinct from `providerId`, which is the connection's own
3848
+ * identifier, not the registry slug.
3849
+ */
3850
+ readonly backendKind: v.StringSchema<undefined>;
3369
3851
  /** The stored handler config, sans secrets, for connect-form prefill on edit. */
3370
3852
  readonly config: v.OptionalSchema<v.VariantSchema<"engine", [v.ObjectSchema<{
3371
3853
  readonly engine: v.LiteralSchema<"local-docker", undefined>;
@@ -5290,7 +5772,7 @@ export declare const provisioningDetectionConfidenceSchema: v.PicklistSchema<["h
5290
5772
  export type ProvisioningDetectionConfidence = v.InferOutput<typeof provisioningDetectionConfidenceSchema>;
5291
5773
  /** One inferred aspect of the recommendation, with its confidence + a human-readable rationale. */
5292
5774
  export declare const provisioningDetectionNoteSchema: v.ObjectSchema<{
5293
- /** Which field this note explains: `provisionType` | `renderer` | `url` | `namespace` | `secretInjections` | `images` | `overlay` | `helmReleases` | `compose`. */
5775
+ /** Which field this note explains: `provisionType` | `renderer` | `url` | `namespace` | `secretInjections` | `images` | `overlay` | `helmReleases` | `compose` | `serviceDir` | `manifestRoot` | `composeService`. */
5294
5776
  readonly field: v.StringSchema<undefined>;
5295
5777
  readonly confidence: v.PicklistSchema<["high", "low"], undefined>;
5296
5778
  /** Rationale for the SPA to surface next to the field (e.g. "kustomization.yaml present ⇒ kustomize"). */
@@ -5311,12 +5793,67 @@ export declare const provisioningOverlayCandidateSchema: v.ObjectSchema<{
5311
5793
  readonly recommended: v.BooleanSchema<undefined>;
5312
5794
  }, undefined>;
5313
5795
  export type ProvisioningOverlayCandidate = v.InferOutput<typeof provisioningOverlayCandidateSchema>;
5796
+ /**
5797
+ * A per-service slice found inside a ROOT SHARED deploy directory of a monorepo — the common
5798
+ * layout where a service's manifests live under `deploy/<svc>` / `k8s/<svc>` / `manifests/services/<svc>`
5799
+ * (keyed by the service name) rather than colocated under `services/<svc>/k8s`. The detector
5800
+ * matches the slice whose basename equals the service directory's basename and pre-selects it,
5801
+ * but every candidate is surfaced so the user can pick a different one.
5802
+ */
5803
+ export declare const provisioningServiceDirCandidateSchema: v.ObjectSchema<{
5804
+ /** Repo-relative directory of the slice (the value `manifestSource.path` would take), e.g. `deploy/api`. */
5805
+ readonly path: v.StringSchema<undefined>;
5806
+ /** The slice's subfolder basename (e.g. `api`). */
5807
+ readonly name: v.StringSchema<undefined>;
5808
+ /** The candidate matching the service directory's basename (the pre-selected one). */
5809
+ readonly recommended: v.BooleanSchema<undefined>;
5810
+ }, undefined>;
5811
+ export type ProvisioningServiceDirCandidate = v.InferOutput<typeof provisioningServiceDirCandidateSchema>;
5812
+ /**
5813
+ * A `services:` key when a discovered Docker Compose file declares MORE THAN ONE service — the
5814
+ * user picks which service corresponds to this board block. Advisory only: the chosen key is NOT
5815
+ * persisted on the service (the compose backend targets the file, not a single service), so the
5816
+ * chip sets `composePath` and the key rides a note.
5817
+ */
5818
+ export declare const provisioningComposeServiceCandidateSchema: v.ObjectSchema<{
5819
+ /** The compose file the service is declared in (the `-f` target — the value `composePath` would take). */
5820
+ readonly composePath: v.StringSchema<undefined>;
5821
+ /** The `services:` key (e.g. `api`). */
5822
+ readonly service: v.StringSchema<undefined>;
5823
+ /** The heuristic top pick (basename match, else the first declared service). */
5824
+ readonly recommended: v.BooleanSchema<undefined>;
5825
+ }, undefined>;
5826
+ export type ProvisioningComposeServiceCandidate = v.InferOutput<typeof provisioningComposeServiceCandidateSchema>;
5827
+ /**
5828
+ * A candidate Kubernetes manifest ROOT when several resolve (e.g. both `k8s/` and `manifests/`
5829
+ * hold real manifests). Generalizes `overlayCandidates` from "which overlay within one root" to
5830
+ * "which root": each carries its own `renderer`. Complementary to `overlayCandidates` — both may
5831
+ * appear (pick the root, then the overlay within it).
5832
+ */
5833
+ export declare const provisioningManifestRootCandidateSchema: v.ObjectSchema<{
5834
+ /** Repo-relative manifest directory (the value `manifestSource.path` would take). */
5835
+ readonly path: v.StringSchema<undefined>;
5836
+ /** A human label (the directory's last path segment). */
5837
+ readonly name: v.StringSchema<undefined>;
5838
+ /** The renderer for this root (`kustomization.yaml` present ⇒ `kustomize`, else `raw`). */
5839
+ readonly renderer: v.PicklistSchema<["raw", "kustomize"], undefined>;
5840
+ /** The pre-selected root (the one reflected in `provisioning.manifestSource`). */
5841
+ readonly recommended: v.BooleanSchema<undefined>;
5842
+ }, undefined>;
5843
+ export type ProvisioningManifestRootCandidate = v.InferOutput<typeof provisioningManifestRootCandidateSchema>;
5314
5844
  /**
5315
5845
  * A non-binding provisioning recommendation detected from a service's repo. `provisioning`
5316
5846
  * carries the service-owned config to prefill (the "what + where"); `urlSource`/`namespace`
5317
5847
  * are engine-level suggestions the workspace handler owns (the detector can READ them from
5318
- * the manifests but they aren't stored on the service); `overlayCandidates` + `notes` drive
5848
+ * the manifests but they aren't stored on the service); the candidate arrays + `notes` drive
5319
5849
  * the confirm UI. `detected: false` ⇒ nothing inferable (`provisioning.type` is `infraless`).
5850
+ *
5851
+ * The candidate arrays let the user CHOOSE instead of accepting a silent auto-pick:
5852
+ * `overlayCandidates` (which overlay within a kustomize root), `manifestRootCandidates` (which
5853
+ * k8s root when several resolve), `serviceDirCandidates` (which root-shared monorepo slice), and
5854
+ * `composeServiceCandidates` (which compose service). Each note's `field` is one of
5855
+ * `provisionType` | `renderer` | `url` | `namespace` | `secretInjections` | `images` | `overlay` |
5856
+ * `helmReleases` | `compose` | `serviceDir` | `manifestRoot` | `composeService`.
5320
5857
  */
5321
5858
  export declare const provisioningRecommendationSchema: v.ObjectSchema<{
5322
5859
  readonly detected: v.BooleanSchema<undefined>;
@@ -5488,9 +6025,38 @@ export declare const provisioningRecommendationSchema: v.ObjectSchema<{
5488
6025
  /** The highest-ranked candidate (the one pre-selected in `provisioning.manifestSource`). */
5489
6026
  readonly recommended: v.BooleanSchema<undefined>;
5490
6027
  }, undefined>, undefined>, undefined>;
6028
+ /** Candidate k8s manifest roots to choose among when several resolve (complements `overlayCandidates`). */
6029
+ readonly manifestRootCandidates: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
6030
+ /** Repo-relative manifest directory (the value `manifestSource.path` would take). */
6031
+ readonly path: v.StringSchema<undefined>;
6032
+ /** A human label (the directory's last path segment). */
6033
+ readonly name: v.StringSchema<undefined>;
6034
+ /** The renderer for this root (`kustomization.yaml` present ⇒ `kustomize`, else `raw`). */
6035
+ readonly renderer: v.PicklistSchema<["raw", "kustomize"], undefined>;
6036
+ /** The pre-selected root (the one reflected in `provisioning.manifestSource`). */
6037
+ readonly recommended: v.BooleanSchema<undefined>;
6038
+ }, undefined>, undefined>, undefined>;
6039
+ /** Candidate root-shared monorepo deploy slices to choose among (keyed by service name). */
6040
+ readonly serviceDirCandidates: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
6041
+ /** Repo-relative directory of the slice (the value `manifestSource.path` would take), e.g. `deploy/api`. */
6042
+ readonly path: v.StringSchema<undefined>;
6043
+ /** The slice's subfolder basename (e.g. `api`). */
6044
+ readonly name: v.StringSchema<undefined>;
6045
+ /** The candidate matching the service directory's basename (the pre-selected one). */
6046
+ readonly recommended: v.BooleanSchema<undefined>;
6047
+ }, undefined>, undefined>, undefined>;
6048
+ /** Candidate compose services to pick from when the compose file declares several (advisory). */
6049
+ readonly composeServiceCandidates: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
6050
+ /** The compose file the service is declared in (the `-f` target — the value `composePath` would take). */
6051
+ readonly composePath: v.StringSchema<undefined>;
6052
+ /** The `services:` key (e.g. `api`). */
6053
+ readonly service: v.StringSchema<undefined>;
6054
+ /** The heuristic top pick (basename match, else the first declared service). */
6055
+ readonly recommended: v.BooleanSchema<undefined>;
6056
+ }, undefined>, undefined>, undefined>;
5491
6057
  /** Per-field confidence + hints for the SPA. */
5492
6058
  readonly notes: v.ArraySchema<v.ObjectSchema<{
5493
- /** Which field this note explains: `provisionType` | `renderer` | `url` | `namespace` | `secretInjections` | `images` | `overlay` | `helmReleases` | `compose`. */
6059
+ /** Which field this note explains: `provisionType` | `renderer` | `url` | `namespace` | `secretInjections` | `images` | `overlay` | `helmReleases` | `compose` | `serviceDir` | `manifestRoot` | `composeService`. */
5494
6060
  readonly field: v.StringSchema<undefined>;
5495
6061
  readonly confidence: v.PicklistSchema<["high", "low"], undefined>;
5496
6062
  /** Rationale for the SPA to surface next to the field (e.g. "kustomization.yaml present ⇒ kustomize"). */