# resolveWorkspace

<!-- https://uncage.vercel.app/docs/api/core/functions/resolveworkspace/ -->

```ts
function resolveWorkspace(requested, cfg): Promise<string>;
```

Defined in: core/src/workspace.ts:13

Canonicalises `requested` (default `cfg.default`) with realpath — so symlinks are followed —
and requires the result to be an existing directory inside one of the realpath'd roots.
Path checks are not a sandbox; they only keep sessions inside the configured roots.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `requested` | `string` \| `undefined` |
| `cfg` | \{ `allowedRoots`: `string`[]; `default`: `string`; \} |
| `cfg.allowedRoots` | `string`[] |
| `cfg.default` | `string` |

## Returns

`Promise`\<`string`\>
