first commit
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
export type PluginPermission =
|
||||
| "server.create"
|
||||
| "server.read"
|
||||
| "server.lifecycle"
|
||||
| "server.files.read"
|
||||
| "server.files.write"
|
||||
| "server.logs.read"
|
||||
| "server.artifacts.read"
|
||||
| "server.artifacts.write"
|
||||
| "ai.invoke";
|
||||
|
||||
export type PluginBridgeAction =
|
||||
| "server.instances.read"
|
||||
| "jobs.dispatch"
|
||||
| "logs.query"
|
||||
| "artifacts.open"
|
||||
| "files.request"
|
||||
| "ai.invoke";
|
||||
|
||||
export interface PluginPageContract {
|
||||
key: string;
|
||||
title: string;
|
||||
path: string;
|
||||
permissions?: PluginPermission[];
|
||||
bridgeActions?: PluginBridgeAction[];
|
||||
}
|
||||
|
||||
export interface PluginBridgeManifestContract {
|
||||
id: string;
|
||||
declaredPermissions: PluginPermission[];
|
||||
bridgeActions: PluginBridgeAction[];
|
||||
pages: PluginPageContract[];
|
||||
aiPurposes?: string[];
|
||||
}
|
||||
|
||||
export interface PluginBridgeThemeTokens {
|
||||
colorScheme: "light" | "dark";
|
||||
accentColor: string;
|
||||
}
|
||||
|
||||
export interface PluginBridgeHostContext {
|
||||
pluginId: string;
|
||||
routeKey: string;
|
||||
serverInstanceId?: string;
|
||||
themeTokens: PluginBridgeThemeTokens;
|
||||
permissions: PluginPermission[];
|
||||
bridgeActions: PluginBridgeAction[];
|
||||
aiPurposes: string[];
|
||||
}
|
||||
|
||||
export interface PluginBridgeExecuteEnvelope {
|
||||
requestId: string;
|
||||
action: PluginBridgeAction;
|
||||
aiPurpose?: string;
|
||||
payload?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface PluginBridgeSafeError {
|
||||
code: string;
|
||||
message: string;
|
||||
details?: string[];
|
||||
}
|
||||
|
||||
export interface PluginBridgeExecutionResult {
|
||||
requestId: string;
|
||||
action: PluginBridgeAction;
|
||||
status: "ok" | "queued" | "denied" | "unsupported" | "cancelled" | "error" | string;
|
||||
result?: Record<string, string>;
|
||||
error?: PluginBridgeSafeError;
|
||||
}
|
||||
Reference in New Issue
Block a user