Skip to content
1 min read · 165 words

Interface: PathTranslator

Defined in: src/batteries/sandbox/contracts/path_translator.ts:5

Model-path boundary: normalises ergonomic paths while refusing unambiguous host escapes.

Methods

assertNoSymlinkComponents()

ts
assertNoSymlinkComponents(relative: string): Promise<void>;

Defined in: src/batteries/sandbox/contracts/path_translator.ts:13

The translator always inspects the resolved path and every parent for symlink components.

Parameters

ParameterType
relativestring

Returns

Promise<void>


redact()

ts
redact(text: string): string;

Defined in: src/batteries/sandbox/contracts/path_translator.ts:11

Scrub root and common host identifiers from battery-generated text.

Parameters

ParameterType
textstring

Returns

string


toBackendPath()

ts
toBackendPath(relative: string): string;

Defined in: src/batteries/sandbox/contracts/path_translator.ts:9

Convert a validated relative path to an opaque backend locator.

Parameters

ParameterType
relativestring

Returns

string


toRelative()

ts
toRelative(modelPath: string): Promise<string>;

Defined in: src/batteries/sandbox/contracts/path_translator.ts:7

Validate and convert a model path; leading separators mean the sandbox root.

Parameters

ParameterType
modelPathstring

Returns

Promise<string>