Abstract Class: BaseProviderPlugin
Defined in: base/BaseProviderPlugin.ts:44
AI Provider Plugin interface.
Extends the base OmniscribePlugin with provider-specific concerns:
capabilities, CLI detection, command building, and status parsing.
Required methods (minimum viable provider):
detectCli()- Check if the CLI tool is installedbuildLaunchCommand()- Build the command to start a new sessionparseTerminalStatus()- Parse terminal output into session status
Optional methods (gated by capabilities):
parseUsage()- Fetch usage data (requiressupportsUsage)readSessionHistory()- Read past sessions (requiressupportsSessionHistory)buildResumeCommand()- Resume a session (requiressupportedOperations.has('resume'))buildForkCommand()- Fork a session (requiressupportedOperations.has('fork'))buildContinueCommand()- Continue latest session (requiressupportedOperations.has('continue'))getMcpConfig()- Provide MCP config (requiressupportsMcp)getSystemPromptAdditions()- Append to system prompt
Example
class MyProvider extends BaseProviderPlugin {
readonly id = 'my-provider';
readonly displayName = 'My AI Tool';
readonly aiMode = 'my-tool';
async detectCli(): Promise<CliDetectionResult> {
// Check if 'my-tool' CLI is installed
}
buildLaunchCommand(context: LaunchContext): CliCommandConfig {
return { command: 'my-tool', args: ['chat', '--project', context.projectPath] };
}
parseTerminalStatus(output: string): ProviderSessionStatus | null {
if (output.includes('> ')) return 'idle';
if (output.includes('Thinking...')) return 'working';
return null;
}
}
Extended by
Implements
Constructors
Constructor
new BaseProviderPlugin():
BaseProviderPlugin
Returns
BaseProviderPlugin
Properties
aiMode
abstractreadonlyaiMode:string
Defined in: base/BaseProviderPlugin.ts:60
The AI mode identifier this provider handles. Must be unique across all loaded providers.
Implementation of
displayName
abstractreadonlydisplayName:string
Defined in: base/BaseProviderPlugin.ts:54
Human-readable display name shown in the UI.
Implementation of
id
abstractreadonlyid:string
Defined in: base/BaseProviderPlugin.ts:49
Unique plugin identifier.
Must match the id field in the plugin's package.json omniscribe manifest.
Implementation of
type
readonlytype:"provider"|"both"='provider'
Defined in: base/BaseProviderPlugin.ts:66
Plugin type. Base provider plugins are always 'provider'. Override to 'both' in a subclass that also implements frontend contributions.
Implementation of
Accessors
activationEvents
Get Signature
get activationEvents():
PluginActivation[]
Defined in: base/BaseProviderPlugin.ts:72
Default activation events: activate when a session with this provider's AI mode is created. Override to customize activation behavior.
Returns
Events that trigger this plugin's activation.
Provider plugins typically use onSessionCreateWithMode to activate
only when a session with their AI mode is created.
Implementation of
AiProviderPlugin.activationEvents
capabilities
Get Signature
get capabilities():
ProviderCapabilities
Defined in: base/BaseProviderPlugin.ts:92
Default capabilities: all optional features disabled. Override this getter to declare supported capabilities.
Example
get capabilities(): ProviderCapabilities {
return {
supportsMcp: true,
supportsUsage: true,
supportsSessionHistory: true,
supportedOperations: new Set(['resume', 'fork', 'continue']),
};
}
Returns
Declares what optional features this provider supports
Implementation of
Methods
activate()
activate(
_context):Promise<void>
Defined in: base/BaseProviderPlugin.ts:128
Called when the plugin is activated. No-op by default. Override to initialize resources, register event listeners, etc.
Parameters
| Parameter | Type |
|---|---|
_context | PluginContext |
Returns
Promise<void>
Implementation of
buildLaunchCommand()
abstractbuildLaunchCommand(context):CliCommandConfig
Defined in: base/BaseProviderPlugin.ts:113
Build the shell command to launch a new session.
Parameters
| Parameter | Type |
|---|---|
context | LaunchContext |
Returns
Implementation of
AiProviderPlugin.buildLaunchCommand
deactivate()
deactivate():
Promise<void>
Defined in: base/BaseProviderPlugin.ts:136
Called when the plugin is deactivated. No-op by default. Override to clean up resources not tracked via context.subscriptions.
Returns
Promise<void>
Implementation of
detectCli()
abstractdetectCli():Promise<CliDetectionResult>
Defined in: base/BaseProviderPlugin.ts:108
Detect whether this provider's CLI tool is installed and configured.
Returns
Promise<CliDetectionResult>
Implementation of
parseTerminalStatus()
abstractparseTerminalStatus(output):ProviderSessionStatus|null
Defined in: base/BaseProviderPlugin.ts:118
Parse terminal output to determine session status.
Parameters
| Parameter | Type |
|---|---|
output | string |
Returns
ProviderSessionStatus | null