@hunsu/config 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,157 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
13
+ owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other entities
16
+ that control, are controlled by, or are under common control with that entity.
17
+ For the purposes of this definition, "control" means (i) the power, direct or
18
+ indirect, to cause the direction or management of such entity, whether by
19
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
20
+ outstanding shares, or (iii) beneficial ownership of such entity.
21
+
22
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
23
+ permissions granted by this License.
24
+
25
+ "Source" form shall mean the preferred form for making modifications, including
26
+ but not limited to software source code, documentation source, and configuration
27
+ files.
28
+
29
+ "Object" form shall mean any form resulting from mechanical transformation or
30
+ translation of a Source form, including but not limited to compiled object code,
31
+ generated documentation, and conversions to other media types.
32
+
33
+ "Work" shall mean the work of authorship, whether in Source or Object form,
34
+ made available under the License, as indicated by a copyright notice that is
35
+ included in or attached to the work.
36
+
37
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
38
+ is based on (or derived from) the Work and for which the editorial revisions,
39
+ annotations, elaborations, or other modifications represent, as a whole, an
40
+ original work of authorship. For the purposes of this License, Derivative Works
41
+ shall not include works that remain separable from, or merely link (or bind by
42
+ name) to the interfaces of, the Work and Derivative Works thereof.
43
+
44
+ "Contribution" shall mean any work of authorship, including the original version
45
+ of the Work and any modifications or additions to that Work or Derivative Works
46
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work by
47
+ the copyright owner or by an individual or Legal Entity authorized to submit on
48
+ behalf of the copyright owner. For the purposes of this definition, "submitted"
49
+ means any form of electronic, verbal, or written communication sent to the
50
+ Licensor or its representatives, including but not limited to communication on
51
+ electronic mailing lists, source code control systems, and issue tracking systems
52
+ that are managed by, or on behalf of, the Licensor for the purpose of discussing
53
+ and improving the Work, but excluding communication that is conspicuously marked
54
+ or otherwise designated in writing by the copyright owner as "Not a Contribution."
55
+
56
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
57
+ of whom a Contribution has been received by Licensor and subsequently
58
+ incorporated within the Work.
59
+
60
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
61
+ License, each Contributor hereby grants to You a perpetual, worldwide,
62
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
63
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
64
+ sublicense, and distribute the Work and such Derivative Works in Source or
65
+ Object form.
66
+
67
+ 3. Grant of Patent License. Subject to the terms and conditions of this License,
68
+ each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
69
+ no-charge, royalty-free, irrevocable (except as stated in this section) patent
70
+ license to make, have made, use, offer to sell, sell, import, and otherwise
71
+ transfer the Work, where such license applies only to those patent claims
72
+ licensable by such Contributor that are necessarily infringed by their
73
+ Contribution(s) alone or by combination of their Contribution(s) with the Work
74
+ to which such Contribution(s) was submitted. If You institute patent litigation
75
+ against any entity (including a cross-claim or counterclaim in a lawsuit)
76
+ alleging that the Work or a Contribution incorporated within the Work
77
+ constitutes direct or contributory patent infringement, then any patent licenses
78
+ granted to You under this License for that Work shall terminate as of the date
79
+ such litigation is filed.
80
+
81
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
82
+ Derivative Works thereof in any medium, with or without modifications, and in
83
+ Source or Object form, provided that You meet the following conditions:
84
+
85
+ (a) You must give any other recipients of the Work or Derivative Works a copy of
86
+ this License; and
87
+
88
+ (b) You must cause any modified files to carry prominent notices stating that
89
+ You changed the files; and
90
+
91
+ (c) You must retain, in the Source form of any Derivative Works that You
92
+ distribute, all copyright, patent, trademark, and attribution notices from the
93
+ Source form of the Work, excluding those notices that do not pertain to any part
94
+ of the Derivative Works; and
95
+
96
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then
97
+ any Derivative Works that You distribute must include a readable copy of the
98
+ attribution notices contained within such NOTICE file, excluding those notices
99
+ that do not pertain to any part of the Derivative Works, in at least one of the
100
+ following places: within a NOTICE text file distributed as part of the Derivative
101
+ Works; within the Source form or documentation, if provided along with the
102
+ Derivative Works; or, within a display generated by the Derivative Works, if and
103
+ wherever such third-party notices normally appear. The contents of the NOTICE
104
+ file are for informational purposes only and do not modify the License. You may
105
+ add Your own attribution notices within Derivative Works that You distribute,
106
+ alongside or as an addendum to the NOTICE text from the Work, provided that such
107
+ additional attribution notices cannot be construed as modifying the License.
108
+
109
+ You may add Your own copyright statement to Your modifications and may provide
110
+ additional or different license terms and conditions for use, reproduction, or
111
+ distribution of Your modifications, or for any such Derivative Works as a whole,
112
+ provided Your use, reproduction, and distribution of the Work otherwise complies
113
+ with the conditions stated in this License.
114
+
115
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
116
+ Contribution intentionally submitted for inclusion in the Work by You to the
117
+ Licensor shall be under the terms and conditions of this License, without any
118
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
119
+ supersede or modify the terms of any separate license agreement you may have
120
+ executed with Licensor regarding such Contributions.
121
+
122
+ 6. Trademarks. This License does not grant permission to use the trade names,
123
+ trademarks, service marks, or product names of the Licensor, except as required
124
+ for reasonable and customary use in describing the origin of the Work and
125
+ reproducing the content of the NOTICE file.
126
+
127
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
128
+ writing, Licensor provides the Work (and each Contributor provides its
129
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
130
+ KIND, either express or implied, including, without limitation, any warranties or
131
+ conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
132
+ PARTICULAR PURPOSE. You are solely responsible for determining the
133
+ appropriateness of using or redistributing the Work and assume any risks
134
+ associated with Your exercise of permissions under this License.
135
+
136
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
137
+ tort (including negligence), contract, or otherwise, unless required by
138
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
139
+ writing, shall any Contributor be liable to You for damages, including any
140
+ direct, indirect, special, incidental, or consequential damages of any character
141
+ arising as a result of this License or out of the use or inability to use the
142
+ Work (including but not limited to damages for loss of goodwill, work stoppage,
143
+ computer failure or malfunction, or any and all other commercial damages or
144
+ losses), even if such Contributor has been advised of the possibility of such
145
+ damages.
146
+
147
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
148
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
149
+ acceptance of support, warranty, indemnity, or other liability obligations
150
+ and/or rights consistent with this License. However, in accepting such
151
+ obligations, You may act only on Your own behalf and on Your sole
152
+ responsibility, not on behalf of any other Contributor, and only if You agree to
153
+ indemnify, defend, and hold each Contributor harmless for any liability incurred
154
+ by, or claims asserted against, such Contributor by reason of your accepting any
155
+ such warranty or additional liability.
156
+
157
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,47 @@
1
+ export type ConfigResult<T> = {
2
+ ok: true;
3
+ value: T;
4
+ } | {
5
+ ok: false;
6
+ error: CloudflareConfigError;
7
+ };
8
+ export type CloudflareConfigError = {
9
+ code: "invalid_enum" | "invalid_url" | "missing_required_env";
10
+ message: string;
11
+ env?: string;
12
+ value?: string;
13
+ allowed?: readonly string[];
14
+ };
15
+ export type HunsuDeployTarget = "local" | "dev" | "production";
16
+ export type HubCloudflareConfig = {
17
+ target: HunsuDeployTarget;
18
+ workerName: string;
19
+ workerMain: string;
20
+ compatibilityDate: string;
21
+ compatibilityFlags: string[];
22
+ originName: string;
23
+ publicHubApiUrl: string;
24
+ d1DatabaseName: string;
25
+ d1DatabaseId: string;
26
+ r2BucketName: string;
27
+ publishQueueName?: string;
28
+ };
29
+ export type HubApiWorkerRuntimeConfig = {
30
+ originName: string;
31
+ publicHubApiUrl?: string;
32
+ adminToken?: string;
33
+ };
34
+ export type HubApiWorkerRuntimeEnv = {
35
+ HUNSU_HUB_ORIGIN_NAME?: string;
36
+ HUNSU_HUB_PUBLIC_API_URL?: string;
37
+ HUNSU_HUB_ADMIN_TOKEN?: string;
38
+ };
39
+ export type Env = Record<string, string | undefined>;
40
+ export declare const HUNSU_DEPLOY_TARGETS: readonly ["local", "dev", "production"];
41
+ export declare const HUB_WRANGLER_GENERATED_CONFIG_PATH = ".wrangler/generated.toml";
42
+ export declare const HUB_WORKER_MAIN = "../src/index.ts";
43
+ export declare const HUB_WORKER_COMPATIBILITY_DATE = "2026-06-25";
44
+ export declare const HUB_WORKER_COMPATIBILITY_FLAGS: readonly ["nodejs_compat"];
45
+ export declare function resolveHubCloudflareConfig(env: Env): ConfigResult<HubCloudflareConfig>;
46
+ export declare function resolveHubApiWorkerRuntimeConfig(env: HubApiWorkerRuntimeEnv): ConfigResult<HubApiWorkerRuntimeConfig>;
47
+ export declare function renderHubWranglerToml(config: HubCloudflareConfig): string;
@@ -0,0 +1,152 @@
1
+ export const HUNSU_DEPLOY_TARGETS = ["local", "dev", "production"];
2
+ export const HUB_WRANGLER_GENERATED_CONFIG_PATH = ".wrangler/generated.toml";
3
+ export const HUB_WORKER_MAIN = "../src/index.ts";
4
+ export const HUB_WORKER_COMPATIBILITY_DATE = "2026-06-25";
5
+ export const HUB_WORKER_COMPATIBILITY_FLAGS = ["nodejs_compat"];
6
+ const LOCAL_HUB_DEFAULTS = {
7
+ HUNSU_HUB_WORKER_NAME: "hunsu-hub-api-local",
8
+ HUNSU_HUB_ORIGIN_NAME: "hunsu-local",
9
+ HUNSU_HUB_PUBLIC_API_URL: "http://127.0.0.1:8787",
10
+ HUNSU_HUB_D1_DATABASE_NAME: "hunsu_hub_local",
11
+ HUNSU_HUB_D1_DATABASE_ID: "hunsu-hub-local",
12
+ HUNSU_HUB_R2_BUCKET_NAME: "hunsu-hub-packages-local"
13
+ };
14
+ export function resolveHubCloudflareConfig(env) {
15
+ return flatMapConfigResult(readDeployTarget(env), target => flatMapConfigResult(readRequiredString(env, "HUNSU_HUB_WORKER_NAME", target), workerName => flatMapConfigResult(readRequiredString(env, "HUNSU_HUB_ORIGIN_NAME", target), originName => flatMapConfigResult(readRequiredUrl(env, "HUNSU_HUB_PUBLIC_API_URL", target), publicHubApiUrl => flatMapConfigResult(readRequiredString(env, "HUNSU_HUB_D1_DATABASE_NAME", target), d1DatabaseName => flatMapConfigResult(readRequiredString(env, "HUNSU_HUB_D1_DATABASE_ID", target), d1DatabaseId => mapConfigResult(readRequiredString(env, "HUNSU_HUB_R2_BUCKET_NAME", target), r2BucketName => ({
16
+ target,
17
+ workerName,
18
+ workerMain: HUB_WORKER_MAIN,
19
+ compatibilityDate: HUB_WORKER_COMPATIBILITY_DATE,
20
+ compatibilityFlags: [...HUB_WORKER_COMPATIBILITY_FLAGS],
21
+ originName,
22
+ publicHubApiUrl,
23
+ d1DatabaseName,
24
+ d1DatabaseId,
25
+ r2BucketName,
26
+ publishQueueName: readOptionalString(env, "HUNSU_HUB_PUBLISH_QUEUE_NAME")
27
+ }))))))));
28
+ }
29
+ export function resolveHubApiWorkerRuntimeConfig(env) {
30
+ return flatMapConfigResult(readRequiredRuntimeString(env, "HUNSU_HUB_ORIGIN_NAME"), originName => mapConfigResult(readOptionalRuntimeUrl(env, "HUNSU_HUB_PUBLIC_API_URL"), publicHubApiUrl => ({
31
+ originName,
32
+ publicHubApiUrl,
33
+ adminToken: readOptionalRuntimeString(env, "HUNSU_HUB_ADMIN_TOKEN")
34
+ })));
35
+ }
36
+ export function renderHubWranglerToml(config) {
37
+ const lines = [
38
+ "# Generated by @hunsu/config/cloudflare. Do not edit by hand.",
39
+ `name = ${tomlString(config.workerName)}`,
40
+ `main = ${tomlString(config.workerMain)}`,
41
+ `compatibility_date = ${tomlString(config.compatibilityDate)}`,
42
+ `compatibility_flags = [${config.compatibilityFlags.map(tomlString).join(", ")}]`,
43
+ "",
44
+ "[vars]",
45
+ `HUNSU_HUB_ORIGIN_NAME = ${tomlString(config.originName)}`,
46
+ `HUNSU_HUB_PUBLIC_API_URL = ${tomlString(config.publicHubApiUrl)}`,
47
+ "",
48
+ "[[d1_databases]]",
49
+ `binding = ${tomlString("HUB_DB")}`,
50
+ `database_name = ${tomlString(config.d1DatabaseName)}`,
51
+ `database_id = ${tomlString(config.d1DatabaseId)}`,
52
+ `migrations_dir = ${tomlString("../migrations")}`,
53
+ "",
54
+ "[[r2_buckets]]",
55
+ `binding = ${tomlString("HUB_PACKAGES")}`,
56
+ `bucket_name = ${tomlString(config.r2BucketName)}`
57
+ ];
58
+ if (config.publishQueueName) {
59
+ lines.push("", "[[queues.producers]]", `binding = ${tomlString("HUB_PUBLISH_QUEUE")}`, `queue = ${tomlString(config.publishQueueName)}`);
60
+ }
61
+ return `${lines.join("\n")}\n`;
62
+ }
63
+ function ok(value) {
64
+ return { ok: true, value };
65
+ }
66
+ function err(error) {
67
+ return { ok: false, error };
68
+ }
69
+ function mapConfigResult(result, transform) {
70
+ return result.ok ? ok(transform(result.value)) : result;
71
+ }
72
+ function flatMapConfigResult(result, transform) {
73
+ return result.ok ? transform(result.value) : result;
74
+ }
75
+ function readDeployTarget(env) {
76
+ const raw = readOptionalString(env, "HUNSU_DEPLOY_TARGET") ?? "local";
77
+ if (isDeployTarget(raw)) {
78
+ return ok(raw);
79
+ }
80
+ return err({
81
+ code: "invalid_enum",
82
+ env: "HUNSU_DEPLOY_TARGET",
83
+ value: raw,
84
+ allowed: HUNSU_DEPLOY_TARGETS,
85
+ message: `Invalid HUNSU_DEPLOY_TARGET: ${raw}. Expected one of: ${HUNSU_DEPLOY_TARGETS.join(", ")}.`
86
+ });
87
+ }
88
+ function isDeployTarget(value) {
89
+ return HUNSU_DEPLOY_TARGETS.includes(value);
90
+ }
91
+ function readRequiredString(env, envName, target) {
92
+ const raw = readOptionalString(env, envName) ?? (target === "local" ? LOCAL_HUB_DEFAULTS[envName] : undefined);
93
+ if (raw) {
94
+ return ok(raw);
95
+ }
96
+ return missing(envName);
97
+ }
98
+ function readRequiredUrl(env, envName, target) {
99
+ const raw = readOptionalString(env, envName) ?? (target === "local" ? LOCAL_HUB_DEFAULTS[envName] : undefined);
100
+ if (!raw) {
101
+ return missing(envName);
102
+ }
103
+ return validateUrl(raw, envName);
104
+ }
105
+ function readRequiredRuntimeString(env, envName) {
106
+ const raw = readOptionalRuntimeString(env, envName);
107
+ if (raw) {
108
+ return ok(raw);
109
+ }
110
+ return missing(envName);
111
+ }
112
+ function readOptionalRuntimeUrl(env, envName) {
113
+ const raw = readOptionalRuntimeString(env, envName);
114
+ return raw === undefined ? ok(undefined) : validateUrl(raw, envName);
115
+ }
116
+ function readOptionalString(env, envName) {
117
+ const raw = env[envName];
118
+ const trimmed = raw?.trim();
119
+ return trimmed ? trimmed : undefined;
120
+ }
121
+ function readOptionalRuntimeString(env, envName) {
122
+ const raw = env[envName];
123
+ const trimmed = raw?.trim();
124
+ return trimmed ? trimmed : undefined;
125
+ }
126
+ function validateUrl(value, envName) {
127
+ try {
128
+ const url = new URL(value);
129
+ if (url.protocol !== "http:" && url.protocol !== "https:") {
130
+ throw new Error("Unsupported protocol");
131
+ }
132
+ return ok(url.toString().replace(/\/$/, ""));
133
+ }
134
+ catch {
135
+ return err({
136
+ code: "invalid_url",
137
+ env: envName,
138
+ value,
139
+ message: `Invalid ${envName}: ${value}. Expected an http or https URL.`
140
+ });
141
+ }
142
+ }
143
+ function missing(envName) {
144
+ return err({
145
+ code: "missing_required_env",
146
+ env: envName,
147
+ message: `Missing required ${envName}.`
148
+ });
149
+ }
150
+ function tomlString(value) {
151
+ return JSON.stringify(value);
152
+ }
@@ -0,0 +1,127 @@
1
+ export type ConfigResult<T> = {
2
+ ok: true;
3
+ value: T;
4
+ } | {
5
+ ok: false;
6
+ error: HunsuConfigError;
7
+ };
8
+ export type HunsuConfigError = {
9
+ code: "invalid_port" | "invalid_boolean" | "invalid_url" | "invalid_path" | "invalid_enum" | "invalid_json" | "missing_required_env" | "port_conflict";
10
+ message: string;
11
+ env?: string;
12
+ portName?: HunsuPortName;
13
+ port?: number;
14
+ value?: string;
15
+ path?: string;
16
+ allowed?: readonly string[];
17
+ };
18
+ export type HunsuPortName = "localApi" | "studioWeb" | "agentPreview";
19
+ export type HunsuEndpoint = {
20
+ name: HunsuPortName;
21
+ host: string;
22
+ hostSource: ConfigValueSource;
23
+ hostEnv?: string;
24
+ port: number;
25
+ portSource: ConfigValueSource;
26
+ portEnv?: string;
27
+ reserved: boolean;
28
+ };
29
+ export type ConfigValueSource = "default" | "env" | "override";
30
+ export type Env = Record<string, string | undefined>;
31
+ export type HunsuPortConfig = Record<HunsuPortName, HunsuEndpoint>;
32
+ export type HunsuPortOverrides = Partial<Record<HunsuPortName, {
33
+ host?: string;
34
+ port?: number;
35
+ }>>;
36
+ export type HunsuPortResolveOptions = {
37
+ overrides?: HunsuPortOverrides;
38
+ };
39
+ export type HunsuPortValidationOptions = {
40
+ activePortNames: readonly HunsuPortName[];
41
+ };
42
+ export type StudioWebServerConfig = {
43
+ web: HunsuEndpoint;
44
+ localApi: HunsuEndpoint;
45
+ strictPort: boolean;
46
+ apiProxyTarget: string;
47
+ browserLocalUrl?: string;
48
+ browserHubApiUrl?: string;
49
+ };
50
+ export type StudioLauncherConfig = {
51
+ webUrl: string;
52
+ };
53
+ export type LocalApiServerConfig = {
54
+ localApi: HunsuEndpoint;
55
+ };
56
+ export type CodexSandboxMode = "read-only" | "workspace-write" | "danger-full-access";
57
+ export type CodexApprovalPolicy = "never" | "on-request" | "on-failure" | "untrusted";
58
+ export type CodexApprovalsReviewer = "user" | "auto_review";
59
+ export type CodexThreadOptionsConfig = {
60
+ sandboxMode?: CodexSandboxMode;
61
+ approvalPolicy?: CodexApprovalPolicy;
62
+ approvalsReviewer?: CodexApprovalsReviewer;
63
+ networkAccessEnabled?: boolean;
64
+ additionalDirectories?: string[];
65
+ };
66
+ export type CodexAppServerConfig = {
67
+ command: string;
68
+ args: string[];
69
+ environment: Record<string, string>;
70
+ };
71
+ export type LocalRuntimeConfig = {
72
+ localApi: HunsuEndpoint;
73
+ processEnv: Record<string, string>;
74
+ roadmapRegistryPath: string;
75
+ routeWorktreeRoot?: string;
76
+ actionWorktreeRoot?: string;
77
+ testRunner?: "deterministic";
78
+ codexAppServer: CodexAppServerConfig;
79
+ codexThreadOptions: CodexThreadOptionsConfig;
80
+ };
81
+ export type LocalRuntimeConfigOptions = {
82
+ cwd?: string;
83
+ homeDir?: string;
84
+ processEnv?: Env;
85
+ roadmapRegistryPath?: string;
86
+ routeWorktreeRoot?: string;
87
+ actionWorktreeRoot?: string;
88
+ codexAppServer?: Partial<Omit<CodexAppServerConfig, "environment">> & {
89
+ environment?: Env;
90
+ };
91
+ codexThreadOptions?: CodexThreadOptionsConfig;
92
+ };
93
+ type PortSpec = {
94
+ name: HunsuPortName;
95
+ defaultHost: string;
96
+ hostEnv: readonly string[];
97
+ defaultPort: number;
98
+ portEnv: readonly string[];
99
+ reserved: boolean;
100
+ allowPortZero: boolean;
101
+ };
102
+ export declare const HUNSU_PORT_SPECS: Record<HunsuPortName, PortSpec>;
103
+ export declare const HUNSU_ACTIVE_SERVICE_PORTS: readonly ["localApi", "studioWeb"];
104
+ export declare const HUNSU_STUDIO_WEB_ACTIVE_PORTS: readonly ["localApi", "studioWeb"];
105
+ export declare function ok<T>(value: T): ConfigResult<T>;
106
+ export declare function err(error: HunsuConfigError): ConfigResult<never>;
107
+ export declare function mapConfigResult<T, U>(result: ConfigResult<T>, transform: (value: T) => U): ConfigResult<U>;
108
+ export declare function flatMapConfigResult<T, U>(result: ConfigResult<T>, transform: (value: T) => ConfigResult<U>): ConfigResult<U>;
109
+ export declare function unwrapConfigResult<T>(result: ConfigResult<T>): T;
110
+ export declare function resolveHunsuPorts(env: Env, options?: HunsuPortResolveOptions): ConfigResult<HunsuPortConfig>;
111
+ export declare function resolveValidatedHunsuPorts(env: Env, options: HunsuPortResolveOptions & HunsuPortValidationOptions): ConfigResult<HunsuPortConfig>;
112
+ export declare function resolveStudioWebServerConfig(env: Env): ConfigResult<StudioWebServerConfig>;
113
+ export declare function resolveStudioLauncherConfig(env: Env): ConfigResult<StudioLauncherConfig>;
114
+ export declare function currentProcessEnv(): Env;
115
+ export declare function resolveLocalApiServerConfig(env: Env): ConfigResult<LocalApiServerConfig>;
116
+ export declare function resolveLocalRuntimeConfig(env: Env, options?: LocalRuntimeConfigOptions): ConfigResult<LocalRuntimeConfig>;
117
+ export declare function validateNoPortConflicts(config: HunsuPortConfig, activePortNames: readonly HunsuPortName[]): ConfigResult<HunsuPortConfig>;
118
+ export declare function endpointUrl(endpoint: Pick<HunsuEndpoint, "host" | "port">): string;
119
+ export declare function readConfigBoolean(env: Env, envName: string, fallback: boolean): ConfigResult<boolean>;
120
+ export declare function readConfigEnum<const T extends string>(env: Env, envName: string, allowed: readonly T[], fallback: T): ConfigResult<T>;
121
+ export declare function readConfigOptionalString(env: Env, envName: string): ConfigResult<string | undefined>;
122
+ export declare function readConfigUrl(env: Env, envName: string, fallback: string): ConfigResult<string>;
123
+ export declare function readConfigJsonStringArray(env: Env, envName: string, fallback?: readonly string[]): ConfigResult<string[]>;
124
+ export declare function readConfigPath(env: Env, envName: string, fallback: string, cwd?: string): ConfigResult<string>;
125
+ export declare function resolveCodexAppServerConfig(env: Env, overrides?: LocalRuntimeConfigOptions["codexAppServer"]): ConfigResult<CodexAppServerConfig>;
126
+ export declare function resolveCodexThreadOptions(env: Env, overrides?: CodexThreadOptionsConfig): ConfigResult<CodexThreadOptionsConfig>;
127
+ export {};