TanStack

SandboxFileHookEvent

Interface: SandboxFileHookEvent

Defined in: packages/ai/src/activities/chat/middleware/types.ts:31

The file event a sandbox hook receives: the serializable SandboxFileEvent plus lazy, git-backed content accessors. Accessors compute on call, so a hook that only reads path/type pays nothing. Never present on the serialized sandbox.file CUSTOM chunk.

Extends

Properties

after

ts
after: () => Promise<string>;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:35

Current content ('' when the event is a delete).

Returns

Promise<string>


before

ts
before: () => Promise<string>;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:33

Content at the session baseline ('' for a new file or non-git workspace).

Returns

Promise<string>


diff

ts
diff: () => Promise<string>;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:37

Unified patch vs the session baseline (synthesized add-patch when non-git).

Returns

Promise<string>


path

ts
path: string;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:23

Absolute path inside the sandbox (under the workspace root).

Inherited from

SandboxFileEvent.path


timestamp

ts
timestamp: number;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:24

Inherited from

SandboxFileEvent.timestamp


type

ts
type: "create" | "change" | "delete";

Defined in: packages/ai/src/activities/chat/middleware/types.ts:21

Inherited from

SandboxFileEvent.type