import { WorkspaceIssueMentionMode } from '@tutti-os/workspace-issue-manager/core';

type WorkspaceLinkActionSource = "agent-markdown" | "agent-file-change" | string;
interface OpenWorkspaceFileLinkAction {
    type: "open-workspace-file";
    path: string;
    directoryPath: string;
    workspaceRoot: string;
    source: WorkspaceLinkActionSource;
    prefetchedDirectoryListing?: WorkspaceFileLinkDirectoryListing | null;
}
interface WorkspaceFileLinkDirectoryEntry {
    path: string;
    name: string;
    kind: "file" | "directory" | "unknown";
    hasChildren: boolean | null;
    sizeBytes: number | null;
    mtimeMs: number | null;
}
interface WorkspaceFileLinkDirectoryListing {
    workspaceId: string;
    root: string;
    directoryPath: string;
    entries: WorkspaceFileLinkDirectoryEntry[];
}
interface OpenWorkspaceUrlLinkAction {
    type: "open-url";
    url: string;
    source: WorkspaceLinkActionSource;
}
interface OpenAgentSessionLinkAction {
    type: "open-agent-session";
    workspaceId: string;
    agentSessionId: string;
    provider?: string | null;
    source: WorkspaceLinkActionSource;
}
interface OpenWorkspaceIssueLinkAction {
    type: "open-workspace-issue";
    workspaceId: string;
    issueId: string | null;
    mode?: WorkspaceIssueMentionMode;
    outputDir?: string | null;
    runId?: string | null;
    taskId?: string | null;
    topicId?: string | null;
    source: WorkspaceLinkActionSource;
}
type WorkspaceLinkAction = OpenWorkspaceFileLinkAction | OpenWorkspaceUrlLinkAction | OpenAgentSessionLinkAction | OpenWorkspaceIssueLinkAction;

export type { WorkspaceLinkAction as W };
