CopilotHandler
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Isolated headless workflow owner backed by pure transitions and immutable snapshots.
export declare class CopilotHandler<TBuild extends string = CopilotBuildType>
Remarks
Create one instance per mounted editor/runtime and dispose it on teardown. Host callbacks run after subscribers observe the committed state; application callbacks require an explicit success or interruption acknowledgement. No application store or React setup is required.
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
(type: TBuild) => void | (ALPHA) Clear a matching foreground generation intent or build. | ||
(applicationId: string) => void | (ALPHA) Release an interrupted application without cancelling a still-running response. | ||
(source: ICopilotApplicationSource<TBuild>) => string | (ALPHA) Track a host-initiated application, including an explicit draft-link open. Returns its correlation ID, or an empty string after disposal. | ||
(applicationId: string, target: ICopilotTarget<TBuild>) => void | (ALPHA) Acknowledge installation, using the final applied object identifier. Stale IDs are ignored. | ||
() => void | (ALPHA) Permanently stop processing and release all listeners. Idempotent. | ||
(target: ICopilotTarget<TBuild>) => ICopilotSource | undefined | (ALPHA) Read the origin associated with the applied object, not the selected chat. | ||
() => string | undefined | (ALPHA) Read the foreground reasoning heading. | ||
() => ICopilotSnapshot<TBuild> | (ALPHA) Read the stable, recursively frozen snapshot. | ||
(scope: ICopilotScope<TBuild>) => CopilotStatus | (ALPHA) Query the same pure scoped progress selector used by headless consumers. | ||
(event: ChatEvent) => void | (ALPHA) Consume one existing chat event. Ignored after disposal. | ||
(type: TBuild) => boolean | (ALPHA) Whether a creation intent or skill-activated creation is still pending. | ||
() => void | (ALPHA) Clear foreground chat progress, preserving background requests and generation intent. | ||
(target: ICopilotTarget<TBuild>) => void | (ALPHA) Apply a host navigation/reset boundary, preserving applications in progress. | ||
(context: ICopilotContext<TBuild>) => void | (ALPHA) Update host facts without reading routes or application state. | ||
(type: TBuild) => void | (ALPHA) Record an explicit creation intent before seeding the chat. | ||
(listener: () => void) => (() => void) | (ALPHA) Subscribe directly to changes. The returned function removes this subscription. |
Property details
CopilotHandler.cancelGenerationpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Clear a matching foreground generation intent or build.
cancelGeneration: (type: TBuild) => void;
CopilotHandler.definitionApplicationInterruptedpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Release an interrupted application without cancelling a still-running response.
definitionApplicationInterrupted: (applicationId: string) => void;
CopilotHandler.definitionApplicationStartedpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Track a host-initiated application, including an explicit draft-link open. Returns its correlation ID, or an empty string after disposal.
definitionApplicationStarted: (source: ICopilotApplicationSource<TBuild>) => string;
CopilotHandler.definitionAppliedpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Acknowledge installation, using the final applied object identifier. Stale IDs are ignored.
definitionApplied: (applicationId: string, target: ICopilotTarget<TBuild>) => void;
CopilotHandler.disposepropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Permanently stop processing and release all listeners. Idempotent.
dispose: () => void;
CopilotHandler.getAppliedSourcepropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Read the origin associated with the applied object, not the selected chat.
getAppliedSource: (target: ICopilotTarget<TBuild>) => ICopilotSource | undefined;
CopilotHandler.getReasoningTitlepropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Read the foreground reasoning heading.
getReasoningTitle: () => string | undefined;
CopilotHandler.getSnapshotpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Read the stable, recursively frozen snapshot.
getSnapshot: () => ICopilotSnapshot<TBuild>;
CopilotHandler.getStatuspropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Query the same pure scoped progress selector used by headless consumers.
getStatus: (scope: ICopilotScope<TBuild>) => CopilotStatus;
CopilotHandler.handleEventpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Consume one existing chat event. Ignored after disposal.
handleEvent: (event: ChatEvent) => void;
CopilotHandler.isGenerationPendingpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Whether a creation intent or skill-activated creation is still pending.
isGenerationPending: (type: TBuild) => boolean;
CopilotHandler.resetInteractionpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Clear foreground chat progress, preserving background requests and generation intent.
resetInteraction: () => void;
CopilotHandler.resetTargetpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Apply a host navigation/reset boundary, preserving applications in progress.
resetTarget: (target: ICopilotTarget<TBuild>) => void;
CopilotHandler.setContextpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Update host facts without reading routes or application state.
setContext: (context: ICopilotContext<TBuild>) => void;
CopilotHandler.startGenerationpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Record an explicit creation intent before seeding the chat.
startGeneration: (type: TBuild) => void;
CopilotHandler.subscribepropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Subscribe directly to changes. The returned function removes this subscription.
subscribe: (listener: () => void) => (() => void);