(
stateDir: string,
input: {
taskId: string;
workspaceId?: string;
},
)
| 74 | } |
| 75 | |
| 76 | export function getDaemonRemoteTaskWorkDirPath( |
| 77 | stateDir: string, |
| 78 | input: { |
| 79 | taskId: string; |
| 80 | workspaceId?: string; |
| 81 | }, |
| 82 | ): string { |
| 83 | return join( |
| 84 | getDaemonWorkspaceExecutionRootDir(stateDir, input.workspaceId ?? DEFAULT_WORKSPACE_ID), |
| 85 | "remote-workdirs", |
| 86 | sanitizeStoragePathSegment(input.taskId, "task"), |
| 87 | ); |
| 88 | } |
| 89 | |
| 90 | export function sanitizeStoragePathSegment(value: string, fallback = "item"): string { |
| 91 | const normalized = value.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, ""); |
no test coverage detected