File size: 1,473 Bytes
68d7816 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | /* oxlint-disable typescript-eslint/no-unsafe-declaration-merging, eslint-plugin-import/namespace -- Event2 class+payload-interface declaration merging is the sanctioned event-declaration idiom. */
import { createDecorator, type ServiceIdentifier } from '#/_base/di/instantiation';
import { AgentEvent2 } from '#/app/event/event2';
export interface ActivatePluginCommandPayload {
readonly pluginId: string;
readonly commandName: string;
readonly args?: string | undefined;
}
export interface PluginCommandActivatedPayload {
readonly agentId: string;
readonly activationId: string;
readonly pluginId: string;
readonly commandName: string;
readonly commandArgs?: string;
readonly trigger: 'user-slash';
}
export class PluginCommandActivated extends AgentEvent2<PluginCommandActivatedPayload> {
static override readonly type = 'plugin_command.activated';
static override readonly observable = true;
}
export interface PluginCommandActivated extends PluginCommandActivatedPayload {}
export interface PluginCommandActivatedEvent extends Omit<PluginCommandActivatedPayload, 'agentId'> {
readonly type: 'plugin_command.activated';
}
export interface IAgentPluginCommandService {
readonly _serviceBrand: undefined;
activate(payload: ActivatePluginCommandPayload): Promise<void>;
}
export const IAgentPluginCommandService: ServiceIdentifier<IAgentPluginCommandService> =
createDecorator<IAgentPluginCommandService>('agentPluginCommandService');
|