Anchorage API reference
    Preparing search index...
    interface TenantContext {
        actor: ApprovalActor;
        principal: ExecutionPrincipal;
        tenantId: string;
        canSelfDecide(role: ApprovalRole): boolean;
        newResourceId(resourceKey: string): string;
        newRunId(): string;
        newThreadId(): string;
        ownsMemoryId(id: string): boolean;
        ownsRun(runId: string): boolean;
        service(): ApprovalService;
    }
    Index

    Properties

    Already authenticated; tenantId equals actor.tenantId and matches the tenant-ID pattern.

    WHO is executing. For an authenticated HTTP request this is the human in actor; trusted internal contexts (schedule ticks, provider delivery, cron maintenance) carry an automated principal instead of fabricating a role.

    tenantId: string

    Methods

    • Display hint only: whether THIS actor may decide its OWN request — true iff the actor holds a decider role AND the deployment's self-decision policy exempts that role. Enforcement stays in ApprovalService.decide(); the GET /workflows echo reads this so the SPA can drop its "the server will refuse your decision" hint for an exempt role.

      Parameters

      Returns boolean

    • Mint a tenant-salted agent-memory resourceId over the host's business key (a user id, a lead id): ${tenantId}_${resourceKey}. Same key, two tenants, disjoint ids — the memory-leak class the salting closes.

      Parameters

      • resourceKey: string

      Returns string

    • Mint a tenant-salted agent-memory threadId: ${tenantId}_${uuid} — extending the tenant-salted identifier scheme to Mastra memory (docs/agent-memory-tenancy.md). Hosts never accept a client-supplied threadId; this is the constructor.

      Returns string