Skip to main content

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 installed
  • buildLaunchCommand() - Build the command to start a new session
  • parseTerminalStatus() - Parse terminal output into session status

Optional methods (gated by capabilities):

  • parseUsage() - Fetch usage data (requires supportsUsage)
  • readSessionHistory() - Read past sessions (requires supportsSessionHistory)
  • buildResumeCommand() - Resume a session (requires supportedOperations.has('resume'))
  • buildForkCommand() - Fork a session (requires supportedOperations.has('fork'))
  • buildContinueCommand() - Continue latest session (requires supportedOperations.has('continue'))
  • getMcpConfig() - Provide MCP config (requires supportsMcp)
  • 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

abstract readonly aiMode: string

Defined in: base/BaseProviderPlugin.ts:60

The AI mode identifier this provider handles. Must be unique across all loaded providers.

Implementation of

AiProviderPlugin.aiMode


displayName

abstract readonly displayName: string

Defined in: base/BaseProviderPlugin.ts:54

Human-readable display name shown in the UI.

Implementation of

AiProviderPlugin.displayName


id

abstract readonly id: 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

AiProviderPlugin.id


type

readonly type: "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

AiProviderPlugin.type

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

PluginActivation[]

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

ProviderCapabilities

Declares what optional features this provider supports

Implementation of

AiProviderPlugin.capabilities

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

ParameterType
_contextPluginContext

Returns

Promise<void>

Implementation of

AiProviderPlugin.activate


buildLaunchCommand()

abstract buildLaunchCommand(context): CliCommandConfig

Defined in: base/BaseProviderPlugin.ts:113

Build the shell command to launch a new session.

Parameters

ParameterType
contextLaunchContext

Returns

CliCommandConfig

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

AiProviderPlugin.deactivate


detectCli()

abstract detectCli(): Promise<CliDetectionResult>

Defined in: base/BaseProviderPlugin.ts:108

Detect whether this provider's CLI tool is installed and configured.

Returns

Promise<CliDetectionResult>

Implementation of

AiProviderPlugin.detectCli


parseTerminalStatus()

abstract parseTerminalStatus(output): ProviderSessionStatus | null

Defined in: base/BaseProviderPlugin.ts:118

Parse terminal output to determine session status.

Parameters

ParameterType
outputstring

Returns

ProviderSessionStatus | null

Implementation of

AiProviderPlugin.parseTerminalStatus