@uservane/copilotkit: AgentController
Class: AgentController
Section titled “Class: AgentController”Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:151
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AgentController(
deps?):AgentController
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:187
Parameters
Section titled “Parameters”Returns
Section titled “Returns”AgentController
Methods
Section titled “Methods”afterTurn()
Section titled “afterTurn()”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).
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
allowsModelRequestedFeedback()
Section titled “allowsModelRequestedFeedback()”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.
Parameters
Section titled “Parameters”surveyId?
Section titled “surveyId?”string
Returns
Section titled “Returns”boolean
bind()
Section titled “bind()”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).
Parameters
Section titled “Parameters”binding
Section titled “binding”Returns
Section titled “Returns”void
complete()
Section titled “complete()”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).
Parameters
Section titled “Parameters”result
Section titled “result”Returns
Section titled “Returns”void
deferAsk()
Section titled “deferAsk()”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.
Parameters
Section titled “Parameters”Omit<ResolveTaskOptions, "defer">
Returns
Section titled “Returns”void
dismiss()
Section titled “dismiss()”dismiss():
void
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:265
Returns
Section titled “Returns”void
getActive()
Section titled “getActive()”getActive():
ActiveAsk
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:189
Returns
Section titled “Returns”getDefaultSurveySlug()
Section titled “getDefaultSurveySlug()”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).
Returns
Section titled “Returns”string
getIdentityKind()
Section titled “getIdentityKind()”getIdentityKind():
IdentityKind
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:273
Returns
Section titled “Returns”getRespondentId()
Section titled “getRespondentId()”getRespondentId():
string
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:274
Returns
Section titled “Returns”string
getState()
Section titled “getState()”getState():
object
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:278
Inspect for tests.
Returns
Section titled “Returns”object
active
Section titled “active”active:
ActiveAsk
apiBase
Section titled “apiBase”apiBase:
string
blockingCapable
Section titled “blockingCapable”blockingCapable:
boolean
boundSurveyIds
Section titled “boundSurveyIds”boundSurveyIds:
string[]
debug:
boolean
defaultSurveySlug
Section titled “defaultSurveySlug”defaultSurveySlug:
string
identityKind
Section titled “identityKind”identityKind:
IdentityKind
key:
string
localSuppression
Section titled “localSuppression”localSuppression:
Set<string>
nonBlocking
Section titled “nonBlocking”nonBlocking:
boolean
pendingSurveys
Section titled “pendingSurveys”pendingSurveys:
string[]
rules:
BootstrapResponse
rulesFailed
Section titled “rulesFailed”rulesFailed:
boolean
rulesLoaded
Section titled “rulesLoaded”rulesLoaded:
boolean
sessionShown
Section titled “sessionShown”sessionShown:
Set<string>
taskOpen
Section titled “taskOpen”taskOpen:
boolean
traits
Section titled “traits”traits:
object
Index Signature
Section titled “Index Signature”[x: string]: unknown
turnCount
Section titled “turnCount”turnCount:
number
userId
Section titled “userId”userId:
string
hide()
Section titled “hide()”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).
Returns
Section titled “Returns”void
identify()
Section titled “identify()”identify(
opts?):void
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:222
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
init()
Section titled “init()”init(
opts):void
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:221
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
isTaskOpen()
Section titled “isTaskOpen()”isTaskOpen():
boolean
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:190
Returns
Section titled “Returns”boolean
noteUserTurn()
Section titled “noteUserTurn()”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.
Returns
Section titled “Returns”void
onSessionEnd()
Section titled “onSessionEnd()”onSessionEnd():
void
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:263
Session-end mechanical trigger. Only in nonBlocking mode.
Returns
Section titled “Returns”void
requestModelFeedback()
Section titled “requestModelFeedback()”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.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
resetForTests()
Section titled “resetForTests()”resetForTests():
void
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:301
Returns
Section titled “Returns”void
resolveTask()
Section titled “resolveTask()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
setCorrelationSource()
Section titled “setCorrelationSource()”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).
Parameters
Section titled “Parameters”source
Section titled “source”Returns
Section titled “Returns”void
setFetchImpl()
Section titled “setFetchImpl()”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.
Parameters
Section titled “Parameters”fetchImpl
Section titled “fetchImpl”(input, init?) => Promise<Response>
Returns
Section titled “Returns”void
setHeadlessContract()
Section titled “setHeadlessContract()”setHeadlessContract(
contract):void
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:220
Bind or clear the headless host contract.
Parameters
Section titled “Parameters”contract
Section titled “contract”Returns
Section titled “Returns”void
subscribe()
Section titled “subscribe()”subscribe(
listener): () =>void
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:188
Parameters
Section titled “Parameters”listener
Section titled “listener”Returns
Section titled “Returns”() => void
survey()
Section titled “survey()”survey(
slug):void
Defined in: @[email protected]/node_modules/@uservane/agent-core/dist/index.d.ts:264
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
unbind()
Section titled “unbind()”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.
Parameters
Section titled “Parameters”surveyId?
Section titled “surveyId?”string
Returns
Section titled “Returns”void