/**
 * Graph Management Tools for Pi-Mono Agent
 *
 * These tools allow the agent to interact with the knowledge graph:
 * - Create, read, update, delete entities
 * - Search and filter
 * - Manage wikilinks
 * - Upload assets
 */
import { Type as T } from 'typebox';
import { WorkspaceManager } from '../../core/workspace-manager.js';
import { type AuthUser } from '../../services/auth-service.js';
import type { AuthService } from '../../services/auth-service.js';
import type { CommentService } from '../../services/comment-service.js';
import type { ChatSessionService } from '../../services/chat-session-service.js';
/**
 * Helper to wrap tool results in AgentToolResult format
 */
export declare function wrapToolResult(result: any): {
    content: {
        type: "text";
        text: string;
    }[];
    details: any;
};
/**
 * Create graph tools for the agent
 */
export interface MutationEvent {
    action: 'created' | 'updated' | 'deleted';
    repo: string;
    entityType: string;
    entityId: string;
    /**
     * The mutation changed free-standing ASSETS in `repo` (not just an entry) —
     * e.g. promoting a chat image into the library. The transport should emit a
     * `repo_sync` so asset-only views (the asset manager) refresh; the default
     * `entity_change` broadcast doesn't cover assets (they aren't entities).
     */
    repoSync?: boolean;
}
export declare function createGraphTools(workspaceManager: WorkspaceManager, gitUser: {
    id: string;
    name: string;
    email: string;
}, workspacePath?: string, onHighlight?: (ids: string[]) => void, onMutation?: (m: MutationEvent) => void, getCurrentUser?: () => AuthUser | null, authService?: AuthService | null, 
/**
 * Called at the start (`enter`) and end (`leave`) of any mutation tool
 * call. Surfaces the active-agent chip in the sidebar via the WS hub. The
 * orchestrator wires this through to wsHub.handleAgentActivity.
 */
onAgentActivity?: (action: 'enter' | 'leave' | 'heartbeat', repo: string) => void, 
/**
 * Optional CommentService. When supplied, the generic read tools
 * (`get_entity`, `list_entities`, `get_related`) dispatch the virtual
 * `comment` entity type through the shared adapter — exactly as the MCP
 * surface does. A graceful no-op when absent (stdio / tests), so comments
 * simply don't appear rather than erroring.
 */
commentService?: CommentService | null, 
/**
 * Optional ChatSessionService. When supplied (web chat), enables
 * `save_file_to_assets` to promote a conversation-scratch image into the
 * curated asset library. A graceful no-op when absent (stdio / tests).
 */
chatSessionService?: ChatSessionService | null, 
/**
 * Resolves the active turn's RAW client session id. Lets `save_file_to_assets`
 * scope "this image" to the current conversation's scratch images rather than
 * the user's other chats. Returns null outside a web chat turn.
 */
getActiveSessionId?: () => string | null | undefined): ({
    name: string;
    label: string;
    description: string;
    parameters: T.TObject<{}>;
    execute: (toolCallId: string, params: any) => Promise<{
        content: {
            type: "text";
            text: string;
        }[];
        details: any;
    }>;
} | {
    name: string;
    label: string;
    description: string;
    parameters: T.TObject<{
        name: T.TString;
        description: T.TOptional<T.TString>;
    }>;
    execute: (toolCallId: string, params: {
        name: string;
        description?: string;
    }) => Promise<{
        content: {
            type: "text";
            text: string;
        }[];
        details: any;
    }>;
} | {
    name: string;
    label: string;
    description: string;
    parameters: T.TObject<{
        repo: T.TOptional<T.TString>;
        entityType: T.TOptional<T.TString>;
    }>;
    execute: (toolCallId: string, params: {
        repo?: string;
        entityType?: string;
    }) => Promise<{
        content: {
            type: "text";
            text: string;
        }[];
        details: any;
    }>;
} | {
    name: string;
    label: string;
    description: string;
    parameters: T.TObject<{
        entityIds: T.TArray<T.TString>;
    }>;
    execute: (_toolCallId: string, params: {
        entityIds: string[];
    }) => Promise<{
        content: {
            type: "text";
            text: string;
        }[];
        details: any;
    }>;
} | {
    name: string;
    label: string;
    description: string;
    parameters: T.TObject<{
        content: T.TString;
    }>;
    execute: (_toolCallId: string, params: {
        content: string;
    }) => Promise<{
        content: {
            type: "text";
            text: string;
        }[];
        details: any;
    }>;
})[];
