MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / buildWorkspaceUploadPath

Function buildWorkspaceUploadPath

src/api/workspace-upload-path.ts:42–50  ·  view source on GitHub ↗
(
  fileName: string,
  workingDir: string,
  overrides: AgentServerClientOverrides = {},
)

Source from the content-addressed store, hash-verified

40 * working-dir leg via {@link resolveAbsoluteWorkspacePath}.
41 */
42export async function buildWorkspaceUploadPath(
43 fileName: string,
44 workingDir: string,
45 overrides: AgentServerClientOverrides = {},
46): Promise<string> {
47 const safeName = getSafeUploadFileName(fileName);
48 const absoluteDir = await resolveAbsoluteWorkspacePath(workingDir, overrides);
49 return `${absoluteDir.replace(/[/\\]+$/, "")}/${safeName}`;
50}
51
52/**
53 * Resolve the working directory for a file upload into a conversation's

Callers 2

uploadFileFunction · 0.90

Calls 2

getSafeUploadFileNameFunction · 0.85

Tested by

no test coverage detected