feat(sdk,plugins): APIs publiques lancement commandes + outillage + événements + config (#125,#126,#127,#130)
This commit is contained in:
@ -43,11 +43,26 @@ import type {
|
||||
PairingCode,
|
||||
PermissionSet,
|
||||
PluginAdmin,
|
||||
PluginCommandTask,
|
||||
PluginConfigDocument,
|
||||
PluginConfigDocumentFormat,
|
||||
PluginConfigDocumentWriteResult,
|
||||
PluginConfigUpdateMode,
|
||||
PluginEventBatch,
|
||||
PluginEventSubscription,
|
||||
PluginPublicEventType,
|
||||
PluginExpectedFileKind,
|
||||
PluginInstallResult,
|
||||
PluginToolchainDiagnostic,
|
||||
PluginProjectStructure,
|
||||
PluginReview,
|
||||
PluginRuntimeContributionCatalog,
|
||||
PluginSourceKind,
|
||||
PluginUninstallResult,
|
||||
PluginWorkspaceBinaryFile,
|
||||
PluginWorkspaceDirectoryListing,
|
||||
PluginWorkspaceStat,
|
||||
PluginWorkspaceTextFile,
|
||||
ProjectMcpToolPermissions,
|
||||
PageDirection,
|
||||
Project,
|
||||
@ -1361,6 +1376,126 @@ export interface PluginGateway {
|
||||
openPluginsFolder(pluginId?: string): Promise<void>;
|
||||
}
|
||||
|
||||
export interface PluginWorkspacePathInput {
|
||||
projectId: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface PluginWorkspaceWriteTextInput extends PluginWorkspacePathInput {
|
||||
content: string;
|
||||
}
|
||||
|
||||
export interface PluginWorkspaceWriteBinaryInput extends PluginWorkspacePathInput {
|
||||
bytes: Uint8Array;
|
||||
}
|
||||
|
||||
export interface PluginProjectStructureQuery {
|
||||
projectId: string;
|
||||
path?: string;
|
||||
maxDepth?: number;
|
||||
maxEntries?: number;
|
||||
}
|
||||
|
||||
export interface PluginWorkspaceGateway {
|
||||
readText(input: PluginWorkspacePathInput): Promise<PluginWorkspaceTextFile>;
|
||||
readBinary(input: PluginWorkspacePathInput): Promise<PluginWorkspaceBinaryFile>;
|
||||
writeText(input: PluginWorkspaceWriteTextInput): Promise<void>;
|
||||
writeBinary(input: PluginWorkspaceWriteBinaryInput): Promise<void>;
|
||||
listDir(input: PluginWorkspacePathInput): Promise<PluginWorkspaceDirectoryListing>;
|
||||
stat(input: PluginWorkspacePathInput): Promise<PluginWorkspaceStat>;
|
||||
queryProjectStructure(input: PluginProjectStructureQuery): Promise<PluginProjectStructure>;
|
||||
}
|
||||
|
||||
export interface PluginRunCommandInput {
|
||||
projectId: string;
|
||||
ownerAgentId: string;
|
||||
label: string;
|
||||
command: string;
|
||||
args?: string[];
|
||||
cwd?: string;
|
||||
env?: Array<[string, string]>;
|
||||
recordOnly?: boolean;
|
||||
deadlineMs?: number;
|
||||
}
|
||||
|
||||
export interface PluginTaskStatusInput {
|
||||
taskId: string;
|
||||
}
|
||||
|
||||
export interface PluginTaskGateway {
|
||||
runCommand(input: PluginRunCommandInput): Promise<PluginCommandTask>;
|
||||
getStatus(input: PluginTaskStatusInput): Promise<PluginCommandTask | null>;
|
||||
}
|
||||
|
||||
export interface PluginToolRequirementInput {
|
||||
id: string;
|
||||
executable: string;
|
||||
versionArgs?: string[];
|
||||
required?: boolean;
|
||||
env?: Array<[string, string]>;
|
||||
}
|
||||
|
||||
export interface PluginEnvRequirementInput {
|
||||
name: string;
|
||||
required?: boolean;
|
||||
equals?: string;
|
||||
}
|
||||
|
||||
export interface PluginFileRequirementInput {
|
||||
path: string;
|
||||
required?: boolean;
|
||||
kind?: PluginExpectedFileKind;
|
||||
}
|
||||
|
||||
export interface PluginToolchainDiagnosticRequest {
|
||||
projectId: string;
|
||||
cwd?: string;
|
||||
tools?: PluginToolRequirementInput[];
|
||||
env?: PluginEnvRequirementInput[];
|
||||
files?: PluginFileRequirementInput[];
|
||||
}
|
||||
|
||||
export interface PluginToolchainGateway {
|
||||
diagnose(input: PluginToolchainDiagnosticRequest): Promise<PluginToolchainDiagnostic>;
|
||||
}
|
||||
|
||||
export interface PluginEventSubscribeInput {
|
||||
projectId: string;
|
||||
eventTypes?: PluginPublicEventType[];
|
||||
capacity?: number;
|
||||
}
|
||||
|
||||
export interface PluginEventPollInput {
|
||||
subscriptionId: string;
|
||||
maxEvents?: number;
|
||||
}
|
||||
|
||||
export interface PluginEventUnsubscribeInput {
|
||||
subscriptionId: string;
|
||||
}
|
||||
|
||||
export interface PluginEventGateway {
|
||||
subscribe(input: PluginEventSubscribeInput): Promise<PluginEventSubscription>;
|
||||
poll(input: PluginEventPollInput): Promise<PluginEventBatch>;
|
||||
unsubscribe(input: PluginEventUnsubscribeInput): Promise<PluginEventSubscription>;
|
||||
}
|
||||
|
||||
export interface PluginConfigDocumentReadInput {
|
||||
projectId: string;
|
||||
path: string;
|
||||
format?: PluginConfigDocumentFormat;
|
||||
}
|
||||
|
||||
export interface PluginConfigDocumentUpdateInput extends PluginConfigDocumentReadInput {
|
||||
mode?: PluginConfigUpdateMode;
|
||||
value: PluginConfigDocument["value"];
|
||||
}
|
||||
|
||||
export interface PluginConfigGateway {
|
||||
readDocument(input: PluginConfigDocumentReadInput): Promise<PluginConfigDocument>;
|
||||
updateDocument(input: PluginConfigDocumentUpdateInput): Promise<PluginConfigDocumentWriteResult>;
|
||||
}
|
||||
|
||||
export interface Gateways {
|
||||
system: SystemGateway;
|
||||
agent: AgentGateway;
|
||||
@ -1386,4 +1521,9 @@ export interface Gateways {
|
||||
focusedProject: FocusedProjectGateway;
|
||||
uiPreferences: UiPreferencesGateway;
|
||||
plugin: PluginGateway;
|
||||
pluginWorkspace: PluginWorkspaceGateway;
|
||||
pluginTask: PluginTaskGateway;
|
||||
pluginToolchain: PluginToolchainGateway;
|
||||
pluginEvents: PluginEventGateway;
|
||||
pluginConfig: PluginConfigGateway;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user