feat(plugins): add workspace file helpers to labels

This commit is contained in:
Federico Jaramillo Martinez
2026-06-05 10:11:07 +02:00
parent 0e64b812dd
commit 4bc00102eb
7 changed files with 199 additions and 54 deletions
+21 -12
View File
@@ -108,10 +108,26 @@ export interface Workspace {
isGitWorktree: boolean;
}
export interface WorkspacePanelFiles {
export interface WorkspaceFiles {
readFile(path: string): Promise<FileContentResponse>;
}
export type WorkspacePanelFiles = WorkspaceFiles;
export interface WorkspaceHost {
requestRender(): void;
}
export type WorkspacePanelHost = WorkspaceHost;
export interface WorkspaceContext {
machine: PluginMachine;
workspace: Workspace;
state?: PluginRuntimeState;
files: WorkspaceFiles;
host: WorkspaceHost;
}
export interface WorkspaceTerminalCommandInput {
title: string;
command: string;
@@ -124,17 +140,8 @@ export interface WorkspacePanelTerminal {
runCommand(input: WorkspaceTerminalCommandInput): Promise<TerminalCommandRunHandle>;
}
export interface WorkspacePanelHost {
requestRender(): void;
}
export interface WorkspacePanelContext {
machine: PluginMachine;
workspace: Workspace;
state?: PluginRuntimeState;
files: WorkspacePanelFiles;
export interface WorkspacePanelContext extends WorkspaceContext {
terminal: WorkspacePanelTerminal;
host: WorkspacePanelHost;
}
export type WorkspacePanelIcon = TemplateResult;
@@ -149,10 +156,12 @@ export interface WorkspacePanelContribution {
render: (context: WorkspacePanelContext) => TemplateResult;
}
export interface WorkspaceLabelContext {
export interface WorkspaceLabelContext extends WorkspaceContext {
machine: PluginMachine;
workspace: Workspace;
state?: PluginRuntimeState;
files: WorkspaceFiles;
host: WorkspaceHost;
}
export type WorkspaceLabelItem = WorkspaceLabelTextItem | WorkspaceLabelLinkItem | WorkspaceLabelRenderItem;