Skip to content

Commit 1b19027

Browse files
Copilotlpcox
andauthored
Remove internal-only interfaces and inline return types in src/cli.ts (#2435)
* Initial plan * Remove export keyword from internal interfaces in src/cli.ts Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/bc9df357-7482-49d1-a6ba-892014a7c40e Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> * refactor(cli): inline return types; remove named interfaces --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
1 parent 1a7b608 commit 1b19027

1 file changed

Lines changed: 8 additions & 31 deletions

File tree

src/cli.ts

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,39 +1092,14 @@ export function joinShellArgs(args: string[]): string {
10921092
return args.map(escapeShellArg).join(' ');
10931093
}
10941094

1095-
/**
1096-
* Result of parsing environment variables
1097-
*/
1098-
export interface ParseEnvResult {
1099-
success: true;
1100-
env: Record<string, string>;
1101-
}
1102-
1103-
export interface ParseEnvError {
1104-
success: false;
1105-
invalidVar: string;
1106-
}
1107-
1108-
/**
1109-
* Result of parsing volume mounts
1110-
*/
1111-
export interface ParseVolumeMountsResult {
1112-
success: true;
1113-
mounts: string[];
1114-
}
1115-
1116-
export interface ParseVolumeMountsError {
1117-
success: false;
1118-
invalidMount: string;
1119-
reason: string;
1120-
}
1121-
11221095
/**
11231096
* Parses environment variables from an array of KEY=VALUE strings
11241097
* @param envVars Array of environment variable strings in KEY=VALUE format
1125-
* @returns ParseEnvResult with parsed key-value pairs on success, or ParseEnvError with the invalid variable on failure
1098+
* @returns Object with parsed key-value pairs on success, or error details on failure
11261099
*/
1127-
export function parseEnvironmentVariables(envVars: string[]): ParseEnvResult | ParseEnvError {
1100+
export function parseEnvironmentVariables(
1101+
envVars: string[]
1102+
): { success: true; env: Record<string, string> } | { success: false; invalidVar: string } {
11281103
const result: Record<string, string> = {};
11291104

11301105
for (const envVar of envVars) {
@@ -1142,9 +1117,11 @@ export function parseEnvironmentVariables(envVars: string[]): ParseEnvResult | P
11421117
/**
11431118
* Parses and validates volume mount specifications
11441119
* @param mounts Array of volume mount strings in host_path:container_path[:mode] format
1145-
* @returns ParseVolumeMountsResult on success, or ParseVolumeMountsError with details on failure
1120+
* @returns Object with parsed mount strings on success, or error details on failure
11461121
*/
1147-
export function parseVolumeMounts(mounts: string[]): ParseVolumeMountsResult | ParseVolumeMountsError {
1122+
export function parseVolumeMounts(
1123+
mounts: string[]
1124+
): { success: true; mounts: string[] } | { success: false; invalidMount: string; reason: string } {
11481125
const result: string[] = [];
11491126

11501127
for (const mount of mounts) {

0 commit comments

Comments
 (0)