Skip to main content

Interface: ToolContext

Defined in: src/server/ai/assistant/tool.ts:19

Built server-side from the verified session by the route. Never derived from model input.

Properties

actor

readonly actor: object

Defined in: src/server/ai/assistant/tool.ts:25

Always the REAL human (the owner even when "viewing as"), for audit attribution.

email

readonly email: string

id

readonly id: string


companyId

readonly companyId: string

Defined in: src/server/ai/assistant/tool.ts:22


contractorId?

readonly optional contractorId?: string

Defined in: src/server/ai/assistant/tool.ts:29

Contractor surface only — the self-scope identity, injected from the session.


permittedDomains

readonly permittedDomains: ReadonlySet<"billing" | "overview" | "business_dev" | "recruiting" | "onboarding" | "team" | "time" | "payroll" | "insights" | "settings">

Defined in: src/server/ai/assistant/tool.ts:27

Admin lens: the domains this caller may access (impersonation-aware). Empty for the contractor surface.


surface

readonly surface: AssistantSurface

Defined in: src/server/ai/assistant/tool.ts:23


svc

readonly svc: SupabaseClient<Database>

Defined in: src/server/ai/assistant/tool.ts:21

Service-role client for tools whose underlying query takes one (others scope by companyId alone).


viewingAs

readonly viewingAs: boolean

Defined in: src/server/ai/assistant/tool.ts:30