Skip to content

@uservane/agent-core: AgentController

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:151

new AgentController(deps?): AgentController

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:187

AgentControllerDeps

AgentController

afterTurn(n): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:261

Arm afterTurn(n). Only fires in nonBlocking mode (mechanical trigger). Barred while a task is open (impossible in blocking mode by the state machine).

number

void


allowsModelRequestedFeedback(surveyId?): boolean

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:244

True when at least one bound show-token attests issuer opt-in (amr). The model cannot self-enable; only a server-minted allowModelRequested token satisfies this.

string

boolean


bind(binding): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:216

Install a server-minted bound show-token for a survey.

Call after the host server runs mintFeedbackToken (secret-key path) and threads the token + correlation ids to the client. When this survey is shown, the bound token is used and submit carries the bound ids so the response lands linked. Multiple surveys may each have one binding.

Pass sessionId for a conversation (session-level) score; pass traceId + observationId for a per-step observation score. Framework auto-read of those ids remains deferred (developer-provided only).

Without a bind for the survey, the unbound bootstrap token path still works (stored unlinked).

BoundTokenBinding

void


complete(result): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:270

Submit a response with the show-token, identity kind, and correlation snapshotted at show time (never re-read here).

CompleteOptions

void


deferAsk(opts?): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:236

Alias for resolveTask({ defer: true, … }). Out-of-band / async ask.

Omit<ResolveTaskOptions, "defer">

void


dismiss(): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:265

void


getActive(): ActiveAsk

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:189

ActiveAsk


getDefaultSurveySlug(): string

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:238

Default survey slug from init (used by the agent tool and resolveTask).

string


getIdentityKind(): IdentityKind

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:273

IdentityKind


getRespondentId(): string

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:274

string


getState(): object

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:278

Inspect for tests.

object

active: ActiveAsk

apiBase: string

blockingCapable: boolean

boundSurveyIds: string[]

debug: boolean

defaultSurveySlug: string

identityKind: IdentityKind

key: string

localSuppression: Set<string>

nonBlocking: boolean

pendingSurveys: string[]

rules: BootstrapResponse

rulesFailed: boolean

rulesLoaded: boolean

sessionShown: Set<string>

taskOpen: boolean

traits: object

[x: string]: unknown

turnCount: number

userId: string


hide(): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:272

Clear the active ask without submitting (after thanks, or host-driven hide).

void


identify(opts?): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:222

AgentIdentifyOptions

void


init(opts): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:221

AgentInitOptions

void


isTaskOpen(): boolean

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:190

boolean


noteUserTurn(): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:256

Record a user turn. In blocking mode, re-opens the task after a prior resolve so mechanical mid-task asks stay barred. In nonBlocking mode, advances afterTurn(n) evaluation.

void


onSessionEnd(): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:263

Session-end mechanical trigger. Only in nonBlocking mode.

void


requestModelFeedback(slug): boolean

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:250

Trigger a model-requested ask for the survey slug (agent tool path). Caller must have checked isTaskOpen and allowsModelRequestedFeedback. Returns true when an ask became active.

string

boolean


resetForTests(): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:301

void


resolveTask(opts?): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:232

Mark the current task resolved and run the onTaskResolved show-decision. Makes the agent blocking-capable (default-open thereafter on next turn).

When defer: true (deferAsk / off-platform async resolution): closes the task so in-session asks are barred for this resolution, but does NOT render InlineFeedback. Deliver the ask later via mintDeferredAskLink on the customer’s channel. UserVane does not send email/SMS.

ResolveTaskOptions

void


setCorrelationSource(source): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:200

Install a correlation reader. Snapshot is taken at show-decision time when no bound token is installed for the survey. Prefer bind() for the production linked path (server-minted token + developer-provided ids).

Observation-level scores are supported via developer-provided traceId+observationId on bind/mint; only framework auto-READ is deferred (NEEDS CEO VERIFICATION).

CorrelationSource

void


setFetchImpl(fetchImpl): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:276

Test hook: replace fetch implementation on a live controller.

(input, init?) => Promise<Response>

void


setHeadlessContract(contract): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:220

Bind or clear the headless host contract.

HeadlessContract

void


subscribe(listener): () => void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:188

AgentControllerListener

() => void


survey(slug): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:264

string

void


unbind(surveyId?): void

Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:218

Clear a single survey binding, or all bindings when surveyId is omitted.

string

void