import { Document } from '@langchain/core/documents';
import { NextRequest, NextResponse } from 'next/server';
import LightningFS from '@isomorphic-git/lightning-fs';
import { ClassValue } from 'clsx';

/**
 * Actor v3 API型定義
 * プロセス代数とLangChain.js互換性
 * https://actor.gftd.ai/api/v3/actor
 */
type ActorID = string;
interface Message {
    id: string;
    label: string;
    payload: Record<string, any>;
    timestamp: string;
    sender?: ActorID;
}
interface State {
    [key: string]: any;
}
interface OutAction {
    type: 'send' | 'spawn' | 'terminate';
    target?: ActorID;
    message?: Message;
    behavior?: Behavior;
}
interface BehaviorResult {
    new_state: State;
    actions: OutAction[];
    error?: string;
}
interface Behavior {
    id: string;
    name: string;
    description: string;
    version: string;
    handler: (message: Message, state: State) => Promise<BehaviorResult>;
    metadata: {
        created_at: string;
        updated_at: string;
        author: string;
        tags: string[];
        capabilities: string[];
    };
    process_algebra: {
        notation: 'CCS' | 'π-calculus' | 'ACP';
        expression: string;
        channels: string[];
    };
}
interface CreateActorRequest {
    behavior: Behavior;
    organization_id: string;
    initial_state?: State;
}
interface CreateActorResponse {
    actor_id: ActorID;
    status: 'created';
    timestamp: string;
}
interface SendMessageRequest {
    target: ActorID;
    message: Omit<Message, 'id' | 'timestamp'>;
}
interface SendMessageResponse {
    message_id: string;
    status: 'sent';
    timestamp: string;
}
interface ReceiveMessagesRequest {
    max_messages?: number;
    timeout?: number;
    filter?: {
        labels?: string[];
        sender?: ActorID;
    };
}
interface ReceiveMessagesResponse {
    messages: Message[];
    behavior_results: BehaviorResult[];
    timestamp: string;
}
interface ListActorsResponse {
    actors: {
        actor_id: ActorID;
        behavior_name: string;
        status: 'active' | 'inactive' | 'terminated';
        created_at: string;
    }[];
    total_count: number;
}
interface ActorSystemConfig {
    process_algebra_analysis: {
        deadlock_free: boolean;
        livelock_free: boolean;
        deadlock_actors?: ActorID[];
        livelock_patterns?: string[];
    };
    communication_topology: {
        edges: {
            from: ActorID;
            to: ActorID;
            channel: string;
            weight: number;
        }[];
    };
}
interface SystemStatsResponse {
    stats: {
        active_actors: number;
        total_messages: number;
        average_latency_ms: number;
    };
    detailed_metrics: {
        performance_metrics: {
            throughput: number;
            latency_p95: number;
        };
    };
}
interface LangChainMessage {
    role: "user" | "assistant" | "system";
    content: string;
    name?: string;
    function_call?: any;
}
interface RunnableConfig$1 {
    timeout?: number;
    maxMessages?: number;
}
interface ActorV3RunnableInterface {
    invoke(input: any, config?: RunnableConfig$1): Promise<any>;
    stream(input: any, config?: RunnableConfig$1): AsyncGenerator<any, any, unknown>;
    batch(inputs: any[], config?: RunnableConfig$1): Promise<any[]>;
    pipe<T>(next: T): T;
    withFallbacks(fallbacks: any[]): any;
}
declare function createMessage(label: string, payload: Record<string, any>, sender?: ActorID): Message;
declare function langChainToActorV3(lcMsg: LangChainMessage): Message;
declare function actorV3ToLangChain(actorMsg: Message): LangChainMessage;
interface ActorV3Error {
    code: string;
    message: string;
    details?: Record<string, any>;
}
interface ApiV3Response<T> {
    success: boolean;
    data?: T;
    error?: ActorV3Error;
}

/**
 * LangChain.js互換の型定義
 * OpenAPI仕様に基づくMessageLike、RunnableConfig等
 */
/**
 * LangChain.js MessageLike型定義
 */
type MessageLike = HumanMessage | AIMessage | SystemMessage | ToolMessage;
interface HumanMessage {
    type: "human";
    content: string;
    additional_kwargs?: Record<string, any>;
    name?: string;
    id?: string;
}
interface AIMessage {
    type: "ai";
    content: string;
    tool_calls?: ToolCall[];
    additional_kwargs?: Record<string, any>;
    response_metadata?: Record<string, any>;
    name?: string;
    id?: string;
}
interface SystemMessage {
    type: "system";
    content: string;
    additional_kwargs?: Record<string, any>;
    name?: string;
    id?: string;
}
interface ToolMessage {
    type: "tool";
    content: string;
    tool_call_id: string;
    artifact?: Record<string, any>;
    additional_kwargs?: Record<string, any>;
    name?: string;
    id?: string;
}
interface ToolCall {
    id: string;
    name: string;
    args: Record<string, any>;
    type: "tool_call";
}
interface StructuredTool {
    name: string;
    description: string;
    schema: Record<string, any>;
}
/**
 * LangChain.js RunnableConfig型定義
 */
interface RunnableConfig {
    tags?: string[];
    metadata?: Record<string, any>;
    callbacks?: any[];
    recursion_limit?: number;
    max_concurrency?: number;
    run_name?: string;
    run_id?: string;
    configurable?: Record<string, any>;
}
/**
 * Runnable実行リクエスト型定義
 */
type RunnableInput = string | MessageLike | MessageLike[];
interface InvokeRequest {
    input: RunnableInput;
    config?: RunnableConfig;
}
interface StreamRequest {
    input: RunnableInput;
    config?: RunnableConfig;
}
interface BatchRequest {
    inputs: RunnableInput[];
    config?: RunnableConfig;
    max_concurrency?: number;
}
/**
 * Runnable実行レスポンス型定義
 */
interface InvokeResponse {
    output: MessageLike;
    metadata: {
        run_id: string;
        session_id?: string;
        usage?: {
            prompt_tokens?: number;
            completion_tokens?: number;
            total_tokens?: number;
        };
        execution_time: number;
    };
}
interface BatchResponse {
    outputs: InvokeResponse[];
    metadata: {
        batch_id: string;
        total_executions: number;
        successful_executions: number;
        failed_executions: number;
        execution_time: number;
    };
}
/**
 * エラーレスポンス型定義
 */
interface ErrorResponse {
    error: {
        code: string;
        message: string;
        type: "invalid_request_error" | "authentication_error" | "permission_error" | "not_found_error" | "rate_limit_error" | "api_error";
        param?: string;
        details?: Record<string, any>;
    };
}

/**
 * Actor セッション管理の型定義
 * OpenAPI仕様に基づくLangChain.js互換のSessionRunnable
 */

/**
 * LangChain.js互換のSessionRunnable型定義
 */
interface SessionRunnable {
    /** Session ID */
    id: string;
    /** Actor ID */
    actor_id: string;
    /** Session name */
    name: string;
    /** Session type - 固定値 "session" */
    type: "session";
    /** LangChain.js namespace */
    lc_namespace: string[];
    /** LangChain.js serializable flag */
    lc_serializable: boolean;
    /** Session configuration */
    config: SessionConfig;
    /** Session messages */
    messages: MessageLike[];
    /** Session state */
    state: Record<string, any>;
    /** Creation timestamp */
    created_at: string;
    /** Update timestamp */
    updated_at: string;
    /** Session metadata */
    metadata?: Record<string, any>;
}
interface ActorSession {
    /** Session ID (Git branch name) */
    id: string;
    /** Actor ID (repository_name with UUID) */
    actor_id: string;
    created_at: string;
    updated_at: string;
    status: "active" | "completed" | "failed" | "paused";
    metadata?: Record<string, any>;
    last_message_id?: string;
    message_count: number;
}
interface ActorMessage {
    id: string;
    session_id: string;
    role: "user" | "assistant" | "system";
    content: string | Record<string, any>;
    created_at: string;
    metadata?: Record<string, any>;
    tool_calls?: ActorToolCall[];
    function_call?: ActorFunctionCall;
}
interface ActorToolCall {
    id: string;
    type: "function";
    function: {
        name: string;
        arguments: string;
    };
}
interface ActorFunctionCall {
    name: string;
    arguments: string;
}
/**
 * OpenAPI仕様に基づくCreateSessionRequest
 */
interface CreateSessionRequest {
    name: string;
    branch?: string;
    parent_branch?: string;
    description?: string;
    config?: SessionConfig;
}
interface SessionCreateRequest {
    /** Actor ID (repository_name with UUID) */
    actor_id: string;
    metadata?: Record<string, any>;
    initial_message?: {
        content: string | Record<string, any>;
        metadata?: Record<string, any>;
    };
}
interface SessionContinueRequest {
    /** Session ID (Git branch name) */
    session_id: string;
    message: {
        content: string | Record<string, any>;
        metadata?: Record<string, any>;
    };
}
interface SessionResponse {
    session: ActorSession;
    messages: ActorMessage[];
    has_more: boolean;
}
interface MessageResponse {
    message: ActorMessage;
    session: ActorSession;
    next_messages?: ActorMessage[];
}
interface SessionListResponse {
    sessions: ActorSession[];
    total: number;
    page: number;
    limit: number;
    has_next: boolean;
    has_previous: boolean;
}
interface SessionStreamEvent {
    type: "message" | "message_delta" | "session_update" | "error" | "done";
    data: any;
}
interface SessionStreamResponse {
    event: SessionStreamEvent;
    session_id: string;
    message_id?: string;
}
/**
 * OpenAPI仕様に基づくSessionConfig
 */
interface SessionConfig {
    max_iterations?: number;
    memory_window?: number;
    auto_save?: boolean;
    branch?: string;
    parent_session?: string;
}
interface SessionError {
    code: string;
    message: string;
    session_id?: string;
    details?: Record<string, any>;
}

/**
 * @file lib/git/git-fs.ts
 * @description isomorphic-gitを使用したGitファイルシステム
 * @author GFTD Co., Ltd.
 */
/**
 * Git設定インターフェース
 */
interface GitConfig {
    /** リポジトリURL */
    url: string;
    /** Personal Access Token */
    token: string;
    /** 作成者情報 */
    author: {
        name: string;
        email: string;
    };
    /** ブランチ名 */
    branch?: string;
    /** ローカルディレクトリ名 */
    dir?: string;
}
/**
 * GitFileSystemクラス
 * isomorphic-gitを使用してGitリポジトリをファイルシステムとして操作
 */
declare class GitFileSystem {
    private fs;
    private config;
    private dir;
    private currentBranch;
    private isInitialized;
    constructor(config: GitConfig);
    /**
     * ディレクトリを再帰的に作成
     */
    private ensureDir;
    /**
     * リポジトリを初期化またはクローン
     */
    initialize(): Promise<void>;
    /**
     * リポジトリをクローン
     */
    private clone;
    /**
     * 新しいリポジトリを初期化
     */
    private init;
    /**
     * ブランチを切り替え
     * @param branchName ブランチ名
     * @param createIfNotExists 存在しない場合は作成
     */
    switchBranch(branchName: string, createIfNotExists?: boolean): Promise<void>;
    /**
     * ファイルを書き込み
     * @param filePath ファイルパス
     * @param content ファイル内容
     */
    writeFile(filePath: string, content: string): Promise<void>;
    /**
     * ファイルを読み込み
     * @param filePath ファイルパス
     * @returns ファイル内容
     */
    readFile(filePath: string): Promise<string>;
    /**
     * ファイルを削除
     * @param filePath ファイルパス
     */
    deleteFile(filePath: string): Promise<void>;
    /**
     * ディレクトリの内容を一覧取得
     * @param dirPath ディレクトリパス
     * @returns ファイル・ディレクトリ一覧
     */
    readDir(dirPath?: string): Promise<string[]>;
    /**
     * ファイルが存在するかチェック
     * @param filePath ファイルパス
     * @returns 存在するかどうか
     */
    exists(filePath: string): Promise<boolean>;
    /**
     * 変更をコミット
     * @param message コミットメッセージ
     * @param filePaths コミットするファイルパス（空の場合は全て）
     */
    commit(message: string, filePaths?: string[]): Promise<string>;
    /**
     * リモートにプッシュ
     */
    push(): Promise<void>;
    /**
     * リモートからプル
     */
    pull(): Promise<void>;
    /**
     * ブランチ一覧を取得
     * @returns ブランチ一覧
     */
    listBranches(): Promise<string[]>;
    /**
     * 現在のブランチを取得
     * @returns 現在のブランチ名
     */
    getCurrentBranch(): string;
    /**
     * コミット履歴を取得
     * @param depth 取得する履歴の深さ
     * @returns コミット履歴
     */
    getCommitHistory(depth?: number): Promise<any[]>;
    /**
     * 作業ディレクトリの状態を取得
     * @returns ファイルの状態一覧
     */
    getStatus(): Promise<any[]>;
    /**
     * ファイルの状態を判定
     */
    private getFileStatus;
    /**
     * リソースのクリーンアップ
     */
    cleanup(): Promise<void>;
}

/**
 * @file lib/types/chat-git.ts
 * @description チャット履歴のGit保存機能に関する型定義
 * @author GFTD Co., Ltd.
 */

/**
 * チャット履歴のGit保存設定
 */
interface ChatGitConfig {
    /** Git設定 */
    git: GitConfig;
    /** 保存形式 */
    format: 'markdown' | 'json' | 'both';
    /** 自動コミット */
    autoCommit: boolean;
    /** コミットメッセージのテンプレート */
    commitMessageTemplate?: string;
    /** ファイル保存のディレクトリ */
    baseDirectory?: string;
}
/**
 * チャット履歴ファイルのメタデータ
 */
interface ChatHistoryMetadata {
    /** セッションID */
    sessionId: string;
    /** アクターID */
    actorId: string;
    /** セッション作成日時 */
    createdAt: string;
    /** 最終更新日時 */
    updatedAt: string;
    /** メッセージ数 */
    messageCount: number;
    /** ファイル形式 */
    format: 'markdown' | 'json' | 'both';
    /** Gitコミットハッシュ */
    commitSha?: string;
    /** ブランチ名 */
    branch: string;
}
/**
 * チャット履歴のファイル構造
 */
interface ChatHistoryFile {
    /** メタデータ */
    metadata: ChatHistoryMetadata;
    /** セッション情報 */
    session: ActorSession;
    /** メッセージ履歴 */
    messages: ActorMessage[];
    /** 追加情報 */
    additionalInfo?: Record<string, any>;
}
/**
 * Git保存結果
 */
interface ChatGitSaveResult {
    /** 成功フラグ */
    success: boolean;
    /** コミットハッシュ */
    commitSha?: string;
    /** 保存されたファイルパス */
    filePaths: string[];
    /** エラーメッセージ */
    error?: string;
}
/**
 * チャット履歴検索条件
 */
interface ChatHistorySearchQuery {
    /** セッションID */
    sessionId?: string;
    /** アクターID */
    actorId?: string;
    /** 日付範囲（開始） */
    dateFrom?: string;
    /** 日付範囲（終了） */
    dateTo?: string;
    /** メッセージ内容のキーワード */
    keyword?: string;
    /** ブランチ名 */
    branch?: string;
    /** 最大結果数 */
    limit?: number;
}
/**
 * チャット履歴検索結果
 */
interface ChatHistorySearchResult {
    /** 履歴ファイル */
    historyFile: ChatHistoryFile;
    /** マッチしたメッセージのインデックス */
    matchedMessageIndices?: number[];
    /** スコア（検索の関連度） */
    score?: number;
    /** ファイルパス */
    filePath: string;
}
/**
 * チャット履歴のGit操作インターフェース
 */
interface IChatGitManager {
    /**
     * チャット履歴を保存
     * @param session セッション情報
     * @param messages メッセージ履歴
     * @param commitMessage コミットメッセージ
     */
    saveHistory(session: ActorSession, messages: ActorMessage[], commitMessage?: string): Promise<ChatGitSaveResult>;
    /**
     * チャット履歴を読み込み
     * @param sessionId セッションID
     * @param branch ブランチ名
     */
    loadHistory(sessionId: string, branch?: string): Promise<ChatHistoryFile | null>;
    /**
     * チャット履歴を検索
     * @param query 検索条件
     */
    searchHistory(query: ChatHistorySearchQuery): Promise<ChatHistorySearchResult[]>;
    /**
     * メッセージを追加保存
     * @param sessionId セッションID
     * @param newMessages 新しいメッセージ
     * @param commitMessage コミットメッセージ
     */
    appendMessages(sessionId: string, newMessages: ActorMessage[], commitMessage?: string): Promise<ChatGitSaveResult>;
    /**
     * セッションのブランチを作成
     * @param sessionId セッションID
     * @param branchName ブランチ名
     * @param baseBranch ベースブランチ
     */
    createSessionBranch(sessionId: string, branchName: string, baseBranch?: string): Promise<boolean>;
    /**
     * 履歴のGitステータス取得
     * @param sessionId セッションID
     */
    getHistoryStatus(sessionId: string): Promise<{
        hasChanges: boolean;
        lastCommitSha?: string;
        lastCommitMessage?: string;
        branch: string;
    }>;
    /**
     * コミット履歴取得
     * @param sessionId セッションID
     * @param limit 件数制限
     */
    getCommitHistory(sessionId: string, limit?: number): Promise<{
        commitSha: string;
        message: string;
        author: string;
        date: string;
        messageCount: number;
    }[]>;
}
/**
 * チャット履歴のファイル命名規則
 */
interface ChatHistoryFileNaming {
    /** セッションディレクトリのパターン */
    sessionDirPattern: string;
    /** Markdownファイル名のパターン */
    markdownFilePattern: string;
    /** JSONファイル名のパターン */
    jsonFilePattern: string;
    /** メタデータファイル名のパターン */
    metadataFilePattern: string;
}
/**
 * Markdownエクスポート設定
 */
interface MarkdownExportOptions {
    /** タイトル形式 */
    titleFormat: string;
    /** メッセージ形式 */
    messageFormat: string;
    /** タイムスタンプ形式 */
    timestampFormat: string;
    /** 目次を含める */
    includeToc: boolean;
    /** メタデータを含める */
    includeMetadata: boolean;
}

/**
 * @file lib/types/config.ts
 * @description Actor SDK Config 設定システム
 * @author GFTD Co., Ltd.
 */

/**
 * GFTD認証設定
 */
interface GFTDAuthConfig {
    /** 認証必須かどうか */
    required?: boolean;
    /** 認証サーバーURL */
    authUrl?: string;
    /** 認証APIキー */
    apiKey?: string;
    /** 認証トークンの有効期限 (秒) */
    tokenExpiry?: number;
    /** 認証プロバイダー */
    provider?: 'gftd' | 'custom';
    /** 認証スコープ */
    scopes?: string[];
    /** 自動リフレッシュ設定 */
    autoRefresh?: boolean;
    /** リダイレクトURL */
    redirectUrl?: string;
}
/**
 * ツール機能設定
 */
interface ToolsConfig {
    /** Actor管理機能 */
    actorManagement: boolean;
    /** セッション管理機能 */
    sessionManagement: boolean;
    /** ストリーミング機能 */
    streaming: boolean;
    /** Embedding & Vector Search機能 */
    embedding: boolean;
    /** Git統合機能 */
    gitIntegration: boolean;
    /** チャット履歴Git管理 */
    chatGitManagement: boolean;
    /** モニタリング & アナリティクス */
    monitoring: boolean;
    /** React UI コンポーネント */
    uiComponents: boolean;
}
/**
 * Actor API設定
 */
interface ActorApiConfig {
    /** API ベース URL */
    baseUrl: string;
    /** API キー */
    apiKey?: string;
    /** タイムアウト設定 (秒) */
    timeout?: number;
    /** リトライ回数 */
    retryCount?: number;
    /** リクエストヘッダー */
    headers?: Record<string, string>;
}
/**
 * Embedding設定
 */
interface EmbeddingConfig$1 {
    /** モデル名 */
    modelName?: string;
    /** ベクトル次元数 */
    dimensions?: number;
    /** キャッシュディレクトリ */
    cacheDir?: string;
    /** バッチサイズ */
    batchSize?: number;
}
/**
 * Git統合設定
 */
interface GitIntegrationConfig {
    /** GitLab設定 */
    gitlab?: {
        url: string;
        token: string;
        defaultVisibility?: 'private' | 'internal' | 'public';
    };
    /** Git作成者情報 */
    author?: {
        name: string;
        email: string;
    };
    /** 自動コミット設定 */
    autoCommit?: boolean;
    /** 自動プッシュ設定 */
    autoPush?: boolean;
    /** デフォルトブランチ名 */
    defaultBranch?: string;
}
/**
 * ストリーミング設定
 */
interface StreamingConfig {
    /** ストリーミング有効化 */
    enabled: boolean;
    /** チャンクサイズ */
    chunkSize?: number;
    /** タイムアウト設定 (秒) */
    timeout?: number;
    /** 再接続設定 */
    reconnect?: {
        enabled: boolean;
        maxAttempts?: number;
        interval?: number;
    };
}
/**
 * モニタリング設定
 */
interface MonitoringConfig {
    /** メトリクス収集 */
    metricsEnabled: boolean;
    /** ログレベル */
    logLevel?: 'debug' | 'info' | 'warn' | 'error';
    /** パフォーマンス追跡 */
    performanceTracking?: boolean;
    /** エラー自動レポート */
    errorReporting?: boolean;
}
/**
 * UI設定
 */
interface UIConfig {
    /** テーマ */
    theme?: 'light' | 'dark' | 'auto';
    /** 言語設定 */
    locale?: string;
    /** デフォルトページサイズ */
    defaultPageSize?: number;
    /** アニメーション有効化 */
    animations?: boolean;
    /** カスタムCSS */
    customStyles?: string;
}
/**
 * デバッグ設定
 */
interface DebugConfig {
    /** デバッグモード */
    enabled: boolean;
    /** 詳細ログ */
    verboseLogging?: boolean;
    /** API呼び出しログ */
    logApiCalls?: boolean;
    /** Git操作ログ */
    logGitOperations?: boolean;
    /** パフォーマンス計測 */
    measurePerformance?: boolean;
}
/**
 * Actor SDK 包括的設定
 */
interface ActorSDKConfig {
    /** 有効化するtools */
    tools: ToolsConfig;
    /** Actor API設定 */
    api: ActorApiConfig;
    /** GFTD認証設定 */
    auth?: GFTDAuthConfig;
    /** セッション管理のデフォルト設定 */
    session?: SessionConfig;
    /** Embedding設定 */
    embedding?: EmbeddingConfig$1;
    /** Git統合設定 */
    git?: GitIntegrationConfig;
    /** チャット履歴Git管理設定 */
    chatGit?: ChatGitConfig;
    /** ストリーミング設定 */
    streaming?: StreamingConfig;
    /** モニタリング設定 */
    monitoring?: MonitoringConfig;
    /** UI設定 */
    ui?: UIConfig;
    /** デバッグ設定 */
    debug?: DebugConfig;
    /** カスタム設定 */
    custom?: Record<string, any>;
}
/**
 * デフォルト設定を生成
 */
declare function createDefaultConfig(): ActorSDKConfig;
/**
 * 開発環境用設定を生成
 */
declare function createDevelopmentConfig(): ActorSDKConfig;
/**
 * プロダクション環境用設定を生成
 */
declare function createProductionConfig(): ActorSDKConfig;
/**
 * 設定をマージ
 */
declare function mergeConfig(...configs: Partial<ActorSDKConfig>[]): ActorSDKConfig;
/**
 * 設定の検証
 */
declare function validateConfig(config: ActorSDKConfig): {
    valid: boolean;
    errors: string[];
};
/**
 * 設定が有効かチェック
 */
declare function isToolEnabled(config: ActorSDKConfig, tool: keyof ToolsConfig): boolean;
/**
 * 環境変数から設定を生成
 */
declare function createConfigFromEnv(): Partial<ActorSDKConfig>;
/**
 * 開発環境設定を生成（統一されたAPIエンドポイント使用）
 */
declare function createLocalDevelopmentConfig(organizationId?: string): ActorSDKConfig;
/**
 * 環境判定: 開発環境かどうか
 */
declare function isLocalDevelopment(): boolean;
/**
 * GitLabデフォルト設定付きSDK設定を生成
 */
declare function createConfigWithDefaultGitLab(overrides?: Partial<ActorSDKConfig>): ActorSDKConfig;

/**
 * Actor v3 APIクライアント
 * プロセス代数とLangChain.js互換性対応
 * https://actor.gftd.ai/api/v3/actor
 */

/**
 * Actor v3 メインクライアント
 */
declare class ActorV3Client {
    private baseUrl;
    private apiKey?;
    constructor(config?: {
        apiKey?: string;
        baseUrl?: string;
    });
    private request;
    /**
     * アクター管理API
     */
    actors: {
        /**
         * 新しいアクターを作成
         */
        create: (request: CreateActorRequest) => Promise<ApiV3Response<CreateActorResponse>>;
        /**
         * アクター一覧を取得
         */
        list: (organizationId?: string) => Promise<ApiV3Response<ListActorsResponse>>;
        /**
         * アクターにメッセージを送信
         */
        send: (actorId: ActorID, request: SendMessageRequest) => Promise<ApiV3Response<SendMessageResponse>>;
        /**
         * アクターからメッセージを受信
         */
        receive: (actorId: ActorID, request?: ReceiveMessagesRequest) => Promise<ApiV3Response<ReceiveMessagesResponse>>;
        /**
         * アクターを削除
         */
        delete: (actorId: ActorID) => Promise<ApiV3Response<{
            status: "deleted";
        }>>;
    };
    /**
     * システム管理API
     */
    system: {
        /**
         * システム設定を取得（プロセス代数分析含む）
         */
        getConfig: () => Promise<ApiV3Response<ActorSystemConfig>>;
        /**
         * システム統計を取得
         */
        getStats: () => Promise<ApiV3Response<SystemStatsResponse>>;
    };
}
/**
 * LangChain.js互換性ラッパー
 */
declare class ActorV3Runnable {
    private actorId;
    private client;
    constructor(actorId: ActorID, client: ActorV3Client);
    /**
     * LangChain.js invoke() 互換メソッド
     */
    invoke(input: any, config?: RunnableConfig$1): Promise<any>;
    /**
     * LangChain.js stream() 互換メソッド
     */
    stream(input: any, config?: RunnableConfig$1): AsyncGenerator<any, any, unknown>;
    /**
     * LangChain.js batch() 互換メソッド
     */
    batch(inputs: any[], config?: RunnableConfig$1): Promise<any[]>;
    /**
     * LangChain.js pipe() 互換メソッド
     */
    pipe<T>(next: T): T;
    /**
     * LangChain.js withFallbacks() 互換メソッド
     */
    withFallbacks(fallbacks: any[]): ActorV3Runnable;
}
/**
 * デフォルトクライアントインスタンス
 */
declare const actorV3Api: ActorV3Client;
/**
 * サンプルBehavior作成ヘルパー
 */
declare function createSampleBehavior(name: string, description: string): Behavior;

/**
 * Actor v3 LangChain Chat API クライアント
 * https://api.actor.gftd.ai/v3/langchain/actor を使用したチャット機能を提供
 */
interface ChatMessage {
    id: string;
    role: "user" | "assistant" | "system";
    content: string;
    timestamp: Date;
}
interface LangChainActorConfig {
    name: string;
    description?: string;
    model?: "gpt-4o" | "gpt-4o-mini" | "gpt-4-turbo" | "gpt-4" | "gpt-3.5-turbo";
    temperature?: number;
    max_tokens?: number;
    system_prompt?: string;
    organization_id: string;
    openai_api_key?: string;
    max_history_length?: number;
    actor_id?: string;
}
interface LangChainActorResponse {
    actor_id: string;
    actor: any;
    config: LangChainActorConfig;
    endpoints: {
        chat: string;
        system_prompt: string;
        config_update: string;
        stats: string;
    };
}
interface ChatRequest {
    message: string;
    conversation_id?: string;
    timeout?: number;
    stream?: boolean;
}
interface ChatResponse {
    content: string;
    usage: {
        total_tokens: number;
        prompt_tokens: number;
        completion_tokens: number;
    };
    model: string;
    conversation_id: string;
    execution_time_ms: number;
    timestamp: string;
}
/**
 * Actor v3 LangChain Chat API クライアントクラス
 * Actor v3のLangChain統合機能を使用したチャット機能を提供
 */
declare class ActorV3ChatClient {
    private baseUrl;
    private headers;
    private organizationId;
    private currentActorId;
    constructor(baseUrl?: string, organizationId?: string, apiKey?: string);
    /**
     * LangChain Actor を作成
     * @param config LangChain Actor設定
     * @returns LangChain Actor作成レスポンス
     */
    createLangChainActor(config: Partial<LangChainActorConfig>): Promise<LangChainActorResponse>;
    /**
     * チャットメッセージを送信
     * @param actorId Actor ID
     * @param request チャットリクエスト
     * @returns チャットレスポンス
     */
    sendChatMessage(actorId: string, request: ChatRequest): Promise<ChatResponse>;
    /**
     * 現在のActorでチャット（簡易版）
     * @param message メッセージ内容
     * @param conversationId 会話ID（オプション）
     * @returns チャットレスポンス
     */
    chat(message: string, conversationId?: string): Promise<ChatResponse>;
    /**
     * システムプロンプトを更新
     * @param actorId Actor ID
     * @param systemPrompt 新しいシステムプロンプト
     */
    updateSystemPrompt(actorId: string, systemPrompt: string): Promise<void>;
    /**
     * APIの健全性をチェック
     * @returns APIが利用可能かどうか
     */
    healthCheck(): Promise<boolean>;
    /**
     * 現在のActor IDを取得
     * @returns 現在のActor ID
     */
    getCurrentActorId(): string | null;
    /**
     * Actor IDを手動設定
     * @param actorId 設定するActor ID
     */
    setCurrentActorId(actorId: string): void;
}
/**
 * デフォルトのActor v3 Chat APIクライアントインスタンス
 */
declare const actorV3ChatClient: ActorV3ChatClient;

/**
 * Actor v3 一覧管理Hook
 */
declare function useActorV3List(organizationId?: string): {
    actors: {
        actor_id: ActorID;
        behavior_name: string;
        status: "active" | "inactive" | "terminated";
        created_at: string;
    }[];
    loading: boolean;
    error: string | null;
    totalCount: number;
    refetch: () => void;
};
/**
 * Actor v3 作成Hook
 */
declare function useActorV3Creation(): {
    createActor: (behavior: Behavior, organizationId: string, initialState?: State) => Promise<CreateActorResponse | null>;
    createSampleActor: (name: string, description: string, organizationId: string) => Promise<CreateActorResponse | null>;
    loading: boolean;
    error: string | null;
};
/**
 * Actor v3 メッセージング Hook
 */
declare function useActorV3Messaging(actorId: ActorID): {
    sendMessage: (label: string, payload: Record<string, any>, target?: ActorID) => Promise<SendMessageResponse | null | undefined>;
    receiveMessages: (request?: ReceiveMessagesRequest) => Promise<ReceiveMessagesResponse | null>;
    clearMessages: () => void;
    messages: Message[];
    loading: boolean;
    error: string | null;
};
/**
 * LangChain.js互換 Actor v3 Hook
 */
declare function useActorV3Runnable(actorId: ActorID): {
    runnable: ActorV3Runnable;
    invoke: (input: any, config?: any) => Promise<any>;
    batch: (inputs: any[], config?: any) => Promise<any[]>;
    loading: boolean;
    error: string | null;
};
/**
 * Actor v3 システム管理Hook
 */
declare function useActorV3System(): {
    config: ActorSystemConfig | null;
    stats: SystemStatsResponse | null;
    loading: boolean;
    error: string | null;
    fetchConfig: () => Promise<void>;
    fetchStats: () => Promise<void>;
    refreshAll: () => Promise<void>;
};
/**
 * Actor v3 ヘルスチェック Hook
 */
declare function useActorV3Health(): {
    status: "unknown" | "checking" | "healthy" | "unhealthy";
    lastChecked: string | null;
    error: string | null;
    checkHealth: () => Promise<void>;
};

/**
 * Actor v3 LangChain Chat API用Reactフック
 * Actor v3のLangChain統合を使用したチャット機能の状態管理とAPI呼び出しを提供
 */

interface UseGftdChatOptions {
    initialMessages?: ChatMessage[];
    model?: string;
    temperature?: number;
    maxTokens?: number;
}
interface UseGftdChatReturn {
    messages: ChatMessage[];
    isLoading: boolean;
    error: string | null;
    isConnected: boolean;
    sendMessage: (content: string) => Promise<void>;
    clearMessages: () => void;
    retryLastMessage: () => Promise<void>;
    setMessages: (messages: ChatMessage[]) => void;
}
/**
 * GFTD Chat APIを使用するためのカスタムフック
 * @param options チャット設定オプション
 * @returns チャット機能のインターフェース
 */
declare function useGftdChat(options?: UseGftdChatOptions): UseGftdChatReturn;

/**
 * @file lib/config/sdk-config-manager.ts
 * @description SDK起動時のconfigファイル管理
 * @author GFTD Co., Ltd.
 */
interface SDKConfig {
    version: string;
    initialized: boolean;
    defaultActorId?: string;
    actors: {
        [key: string]: {
            id: string;
            name: string;
            type: string;
            repositoryType: 'local' | 'online';
            repositoryPath: string;
            repositoryUrl?: string;
            gitConfig?: any;
            lastAccessed: string;
            isDefault?: boolean;
        };
    };
    settings: {
        theme: 'light' | 'dark';
        autoSave: boolean;
        showWelcome: boolean;
        defaultView: 'actors' | 'code' | 'preview';
    };
    created: string;
    lastModified: string;
}
/**
 * デフォルトアクター設定テンプレート
 */
interface DefaultActorTemplate {
    name: string;
    description: string;
    type: string;
    repositoryType: 'local';
    gitConfig: {
        user: {
            name: string;
            email: string;
        };
        remoteUrl?: string;
        defaultBranch: string;
        autoCommit: boolean;
        autoSync: boolean;
    };
}
/**
 * 利用可能なデフォルトアクタータイプ
 */
declare const DEFAULT_ACTOR_TEMPLATES: Record<string, DefaultActorTemplate>;
/**
 * デフォルトのSDK設定
 */
declare function createDefaultSDKConfig(): SDKConfig;
/**
 * SDK設定管理クラス
 */
declare class SDKConfigManager {
    private static readonly CONFIG_FILE_PATH;
    private static readonly LOCAL_STORAGE_KEY;
    /**
     * 実行環境がブラウザかチェック
     */
    private static isBrowser;
    /**
     * 実行環境がNode.jsかチェック
     */
    private static isNode;
    /**
     * configファイルが存在するかチェック
     */
    static hasConfig(): Promise<boolean>;
    /**
     * configファイルを読み込み
     */
    static loadConfig(): Promise<SDKConfig | null>;
    /**
     * configファイルを保存
     */
    static saveConfig(config: SDKConfig): Promise<boolean>;
    /**
     * configにアクターを追加
     */
    static addActor(actorData: {
        id: string;
        name: string;
        type: string;
        repositoryType: 'local' | 'online';
        repositoryPath: string;
        repositoryUrl?: string;
        gitConfig?: any;
    }): Promise<boolean>;
    /**
     * デフォルトアクターを設定
     */
    static setDefaultActor(actorId: string): Promise<boolean>;
    /**
     * アクターのアクセス時刻を更新
     */
    static updateActorAccess(actorId: string): Promise<boolean>;
    /**
     * 設定を更新
     */
    static updateSettings(settings: Partial<SDKConfig['settings']>): Promise<boolean>;
    /**
     * configを初期化済みにマーク
     */
    static markAsInitialized(): Promise<boolean>;
    /**
     * configを検証・マイグレーション
     */
    private static validateAndMigrateConfig;
    /**
     * configをリセット（開発用）
     */
    static resetConfig(): Promise<boolean>;
    /**
     * デバッグ情報を出力（ブラウザのコンソールに表示）
     */
    static debugConfig(): Promise<void>;
    /**
     * デフォルトアクターを作成
     */
    static createDefaultActor(template?: keyof typeof DEFAULT_ACTOR_TEMPLATES): Promise<{
        success: boolean;
        actorId?: string;
        error?: string;
    }>;
    /**
     * 初期セットアップ - デフォルトアクターと設定を作成
     */
    static performInitialSetup(actorTemplate?: keyof typeof DEFAULT_ACTOR_TEMPLATES): Promise<{
        success: boolean;
        config?: SDKConfig;
        error?: string;
    }>;
    /**
     * 利用可能なデフォルトアクタータイプのリストを取得
     */
    static getAvailableTemplates(): Array<{
        key: string;
        template: DefaultActorTemplate;
    }>;
}

/**
 * @file lib/git/gitlab-client.ts
 * @description GitLab API クライアント
 * @author GFTD Co., Ltd.
 */
/**
 * GitLab設定インターフェース
 */
interface GitLabConfig {
    /** GitLabのURL */
    url: string;
    /** Personal Access Token */
    token: string;
    /** デフォルトプロジェクトの可視性 */
    defaultVisibility?: 'private' | 'internal' | 'public';
}
/**
 * プロジェクト作成設定
 */
interface CreateProjectConfig {
    /** プロジェクト名 */
    name: string;
    /** 説明 */
    description?: string;
    /** 可視性 */
    visibility?: 'private' | 'internal' | 'public';
    /** 初期化設定 */
    initialize_with_readme?: boolean;
    /** デフォルトブランチ */
    default_branch?: string;
}
/**
 * ブランチ作成設定
 */
interface CreateBranchConfig {
    /** ブランチ名 */
    name: string;
    /** 基点となるブランチまたはコミット */
    ref: string;
}
/**
 * GitLab APIクライアント
 */
declare class GitLabClient {
    private client;
    private config;
    constructor(config: GitLabConfig);
    /**
     * 新しいプロジェクト（Actor）を作成
     * @param config プロジェクト作成設定
     * @returns プロジェクト情報
     */
    createActor(config: CreateProjectConfig): Promise<{
        id: number;
        name: string;
        description: string | undefined;
        clone_url: string;
        ssh_url: string;
        web_url: string;
        default_branch: string | undefined;
        created_at: string;
    }>;
    /**
     * プロジェクトを取得
     * @param projectId プロジェクトID
     * @returns プロジェクト情報
     */
    getActor(projectId: number | string): Promise<{
        id: number;
        name: string;
        description: string | undefined;
        clone_url: string;
        ssh_url: string;
        web_url: string;
        default_branch: string | undefined;
        created_at: string;
        updated_at: string;
    }>;
    /**
     * 新しいブランチ（Session）を作成
     * 概念: new session -> new_branch
     * @param projectId プロジェクトID
     * @param config ブランチ作成設定
     * @returns ブランチ情報
     */
    createSession(projectId: number | string, config: CreateBranchConfig): Promise<{
        name: string;
        commit: {
            id: unknown;
            message: unknown;
            author_name: unknown;
            author_email: unknown;
            created_at: unknown;
        };
        protected: boolean;
        can_push: boolean;
        web_url: string;
    }>;
    /**
     * ブランチ（Session）を取得
     * 概念: session = Git branch
     * @param projectId プロジェクトID
     * @param branchName ブランチ名（Session ID）
     * @returns ブランチ情報
     */
    getSession(projectId: number | string, branchName: string): Promise<{
        name: string;
        commit: {
            id: unknown;
            message: unknown;
            author_name: unknown;
            author_email: unknown;
            created_at: unknown;
        };
        protected: boolean;
        can_push: boolean;
        web_url: string;
    }>;
    /**
     * プロジェクトの全ブランチ（Sessions）を取得
     * 概念: sessions = Git branches
     * @param projectId プロジェクトID
     * @returns ブランチ一覧（Session一覧）
     */
    listSessions(projectId: number | string): Promise<{
        name: string;
        commit: {
            id: unknown;
            message: unknown;
            author_name: unknown;
            author_email: unknown;
            created_at: unknown;
        };
        protected: boolean;
        can_push: boolean;
        web_url: string;
    }[]>;
    /**
     * ブランチを削除
     * @param projectId プロジェクトID
     * @param branchName ブランチ名
     */
    deleteSession(projectId: number | string, branchName: string): Promise<boolean>;
    /**
     * プロジェクトを削除
     * @param projectId プロジェクトID
     */
    deleteActor(projectId: number | string): Promise<boolean>;
    /**
     * ファイルを作成または更新
     * @param projectId プロジェクトID
     * @param filePath ファイルパス
     * @param content ファイル内容
     * @param commitMessage コミットメッセージ
     * @param branch ブランチ名
     */
    createOrUpdateFile(projectId: number | string, filePath: string, content: string, commitMessage: string, branch?: string): Promise<any>;
    /**
     * ファイルを取得
     * @param projectId プロジェクトID
     * @param filePath ファイルパス
     * @param branch ブランチ名
     */
    getFile(projectId: number | string, filePath: string, branch?: string): Promise<any>;
    /**
     * ファイルを削除
     * @param projectId プロジェクトID
     * @param filePath ファイルパス
     * @param commitMessage コミットメッセージ
     * @param branch ブランチ名
     */
    deleteFile(projectId: number | string, filePath: string, commitMessage: string, branch?: string): Promise<any>;
    /**
     * リポジトリのファイル一覧を取得
     * @param projectId プロジェクトID
     * @param path パス（オプション）
     * @param branch ブランチ名
     */
    listFiles(projectId: number | string, path?: string, branch?: string): Promise<any[]>;
}

/**
 * @file lib/git/git-vector-store.ts
 * @description Git対応のベクトルストア
 * @author GFTD Co., Ltd.
 */

/**
 * Git対応ベクトルストアエントリー
 */
interface GitVectorStoreEntry {
    id: string;
    vector: number[];
    document: Document;
    timestamp: number;
    commitSha?: string;
}
/**
 * Git検索結果
 */
interface GitSearchResult {
    document: Document;
    score: number;
    id: string;
    commitSha?: string;
}
/**
 * Git対応のベクトルストアクラス
 * usearchとGitを組み合わせて、ベクトル検索データをGitリポジトリで管理
 */
declare class GitVectorStore {
    private index;
    private gitFs;
    private entries;
    private dimensions;
    private isInitialized;
    private vectorsDir;
    private metadataDir;
    private indexFile;
    constructor(gitFs: GitFileSystem, dimensions?: number);
    /**
     * ベクトルストアの初期化
     */
    initialize(): Promise<void>;
    /**
     * 必要なディレクトリを初期化
     */
    private initializeDirectories;
    /**
     * 既存のインデックスを読み込み
     */
    private loadExistingIndex;
    /**
     * ベクトルとドキュメントを追加
     * @param vector ベクトル
     * @param document ドキュメント
     * @returns エントリーID
     */
    add(vector: number[], document: Document): Promise<string>;
    /**
     * ベクトル検索
     * @param query クエリベクトル
     * @param k 返す結果数
     * @returns 検索結果
     */
    search(query: number[], k?: number): Promise<GitSearchResult[]>;
    /**
     * エントリーをファイルシステムに保存
     */
    private saveEntry;
    /**
     * インデックスファイルを保存
     */
    private saveIndexFile;
    /**
     * 変更をGitにコミット
     */
    private commitChanges;
    /**
     * リモートにプッシュ
     */
    push(): Promise<void>;
    /**
     * リモートからプル
     */
    pull(): Promise<void>;
    /**
     * インデックスサイズを取得
     */
    size(): number;
    /**
     * エントリーをIDで取得
     */
    getEntry(id: string): GitVectorStoreEntry | undefined;
    /**
     * エントリーをIDで削除
     */
    remove(id: string): Promise<boolean>;
    /**
     * インデックスを再構築
     */
    private rebuildIndex;
    /**
     * すべてのエントリーをクリア
     */
    clear(): Promise<void>;
    /**
     * ブランチを切り替え
     * @param branchName ブランチ名
     * @param createIfNotExists 存在しない場合は作成
     */
    switchBranch(branchName: string, createIfNotExists?: boolean): Promise<void>;
    /**
     * 現在のブランチを取得
     */
    getCurrentBranch(): string;
    /**
     * ブランチ一覧を取得
     */
    listBranches(): Promise<string[]>;
    /**
     * コミット履歴を取得
     */
    getCommitHistory(depth?: number): Promise<any[]>;
    /**
     * リソースのクリーンアップ
     */
    cleanup(): Promise<void>;
}

/**
 * @file lib/git/git-embedding-sdk.ts
 * @description Git対応のEmbeddingSDK
 * @author GFTD Co., Ltd.
 */

/**
 * Git対応Embedding設定インターフェース
 */
interface GitEmbeddingConfig {
    /** Git設定 */
    git: GitConfig;
    /** モデル名 (デフォルト: 'Xenova/all-MiniLM-L6-v2') */
    modelName?: string;
    /** ベクトル次元数 */
    dimensions?: number;
}
/**
 * Git対応EmbeddingSDKクラス
 * HuggingFaceTransformersEmbeddingsとGitを使用してテキストをベクトル化し、
 * Gitリポジトリで管理
 */
declare class GitEmbeddingSDK {
    private embeddings;
    private gitFs;
    private vectorStore;
    private config;
    private isInitialized;
    constructor(config: GitEmbeddingConfig);
    /**
     * SDKの初期化
     */
    initialize(): Promise<void>;
    /**
     * テキストをembeddingに変換
     * @param text テキスト
     * @returns embedding vector
     */
    embedText(text: string): Promise<number[]>;
    /**
     * 複数のテキストをembeddingに変換
     * @param texts テキスト配列
     * @returns embedding vectors
     */
    embedTexts(texts: string[]): Promise<number[][]>;
    /**
     * ドキュメントをembeddingに変換してVectorStoreに追加
     * @param documents ドキュメント配列
     * @returns 追加されたドキュメントのID配列
     */
    addDocuments(documents: Document[]): Promise<string[]>;
    /**
     * 類似検索
     * @param query 検索クエリ
     * @param k 返す結果数
     * @returns 類似ドキュメント配列
     */
    search(query: string, k?: number): Promise<{
        document: Document;
        score: number;
        id: string;
        commitSha?: string;
    }[]>;
    /**
     * 新しいセッション（ブランチ）を作成
     * @param sessionName セッション名
     * @param baseBranch 基点となるブランチ（デフォルト: 現在のブランチ）
     */
    createSession(sessionName: string, baseBranch?: string): Promise<void>;
    /**
     * セッション（ブランチ）を切り替え
     * @param sessionName セッション名
     */
    switchSession(sessionName: string): Promise<void>;
    /**
     * 現在のセッション（ブランチ）を取得
     */
    getCurrentSession(): string;
    /**
     * セッション（ブランチ）一覧を取得
     */
    listSessions(): Promise<string[]>;
    /**
     * リモートにプッシュ
     */
    push(): Promise<void>;
    /**
     * リモートからプル
     */
    pull(): Promise<void>;
    /**
     * ファイルをGitリポジトリに保存
     * @param filePath ファイルパス
     * @param content ファイル内容
     * @param commitMessage コミットメッセージ
     */
    saveFile(filePath: string, content: string, commitMessage?: string): Promise<string>;
    /**
     * ファイルをGitリポジトリから読み込み
     * @param filePath ファイルパス
     * @returns ファイル内容
     */
    loadFile(filePath: string): Promise<string>;
    /**
     * ファイルが存在するかチェック
     * @param filePath ファイルパス
     */
    fileExists(filePath: string): Promise<boolean>;
    /**
     * ディレクトリの内容を一覧取得
     * @param dirPath ディレクトリパス
     */
    listFiles(dirPath?: string): Promise<string[]>;
    /**
     * インデックスサイズを取得
     */
    getIndexSize(): Promise<number>;
    /**
     * コミット履歴を取得
     * @param depth 取得する履歴の深さ
     */
    getCommitHistory(depth?: number): Promise<any[]>;
    /**
     * Gitリポジトリの状態を取得
     */
    getStatus(): Promise<any[]>;
    /**
     * 構造化データをJSONとして保存
     * @param filePath ファイルパス
     * @param data データオブジェクト
     * @param commitMessage コミットメッセージ
     */
    saveJSON(filePath: string, data: any, commitMessage?: string): Promise<string>;
    /**
     * JSONファイルを読み込み
     * @param filePath ファイルパス
     * @returns パースされたデータ
     */
    loadJSON(filePath: string): Promise<any>;
    /**
     * セッション設定を保存
     * @param config セッション設定
     */
    saveSessionConfig(config: any): Promise<string>;
    /**
     * セッション設定を読み込み
     * @param sessionName セッション名（省略時は現在のセッション）
     */
    loadSessionConfig(sessionName?: string): Promise<any>;
    /**
     * ベクトルストアを直接取得（高度な操作用）
     */
    getVectorStore(): GitVectorStore;
    /**
     * GitFileSystemを直接取得（高度な操作用）
     */
    getGitFileSystem(): GitFileSystem;
    /**
     * リソースのクリーンアップ
     */
    cleanup(): Promise<void>;
}

/**
 * @file lib/git/actor-git-manager.ts
 * @description Actor/Session管理のGitマネージャー
 * @author GFTD Co., Ltd.
 */

/**
 * Actor情報インターフェース
 * GitLabプロジェクトとしてのActor表現
 */
interface ActorInfo {
    /** GitLab Project ID (数値) - 内部的にはproject_idだが、actor_id概念ではrepository_name(UUID)を使用 */
    id: number;
    /** Repository name with UUID (actor_id概念での実際の識別子) */
    name: string;
    description?: string;
    clone_url: string;
    web_url: string;
    default_branch: string;
    created_at: string;
    updated_at?: string;
}
/**
 * Session情報インターフェース
 */
interface SessionInfo {
    name: string;
    commit: {
        id: string;
        message: string;
        author_name: string;
        author_email: string;
        created_at: string;
    };
    protected: boolean;
    can_push: boolean;
    web_url?: string;
}
/**
 * ActorGitManager設定インターフェース
 */
interface ActorGitManagerConfig {
    /** GitLab設定 */
    gitlab: GitLabConfig;
    /** Embedding設定（モデル名など） */
    embedding?: {
        modelName?: string;
        dimensions?: number;
    };
    /** 作成者情報 */
    author: {
        name: string;
        email: string;
    };
}
/**
 * ActorGitManagerクラス
 * GitLabとGitEmbeddingSDKを統合したActor/Session管理システム
 */
declare class ActorGitManager {
    private gitlabClient;
    private config;
    private embeddingSDKs;
    constructor(config: ActorGitManagerConfig);
    /**
     * 新しいActor（プロジェクト）を作成
     * @param actorConfig Actor作成設定
     * @returns Actor情報
     */
    createActor(actorConfig: CreateProjectConfig): Promise<ActorInfo>;
    /**
     * Actorを取得
     * @param actorId Actor ID
     * @returns Actor情報
     */
    getActor(actorId: number): Promise<ActorInfo>;
    /**
     * 新しいSession（ブランチ）を作成
     * @param actorId Actor ID
     * @param sessionConfig Session作成設定
     * @returns Session情報
     */
    createSession(actorId: number, sessionConfig: CreateBranchConfig): Promise<SessionInfo>;
    /**
     * Sessionを取得
     * @param actorId Actor ID
     * @param sessionName Session名
     * @returns Session情報
     */
    getSession(actorId: number, sessionName: string): Promise<SessionInfo>;
    /**
     * Actorの全Sessionを取得
     * @param actorId Actor ID
     * @returns Session一覧
     */
    listSessions(actorId: number): Promise<SessionInfo[]>;
    /**
     * EmbeddingSDKを初期化
     * @param actorId Actor ID
     * @param branch ブランチ名（省略時はdefault_branch）
     * @returns GitEmbeddingSDK
     */
    initializeEmbeddingSDK(actorId: number, branch?: string): Promise<GitEmbeddingSDK>;
    /**
     * ActorのEmbeddingSDKを取得（未初期化の場合は初期化）
     * @param actorId Actor ID
     * @param branch ブランチ名
     * @returns GitEmbeddingSDK
     */
    getEmbeddingSDK(actorId: number, branch?: string): Promise<GitEmbeddingSDK>;
    /**
     * Actorにドキュメントを追加
     * @param actorId Actor ID
     * @param documents ドキュメント配列
     * @param sessionName セッション名（省略時は現在のセッション）
     * @returns 追加されたドキュメントのID配列
     */
    addDocumentsToActor(actorId: number, documents: Document[], sessionName?: string): Promise<string[]>;
    /**
     * Actorで検索
     * @param actorId Actor ID
     * @param query 検索クエリ
     * @param k 返す結果数
     * @param sessionName セッション名（省略時は現在のセッション）
     * @returns 検索結果
     */
    searchInActor(actorId: number, query: string, k?: number, sessionName?: string): Promise<any[]>;
    /**
     * ActorでSessionを作成し、EmbeddingSDKを初期化
     * @param actorId Actor ID
     * @param sessionName セッション名
     * @param baseBranch 基点となるブランチ（省略時はdefault_branch）
     * @returns GitEmbeddingSDK
     */
    createActorSession(actorId: number, sessionName: string, baseBranch?: string): Promise<GitEmbeddingSDK>;
    /**
     * ActorのSessionを切り替え
     * @param actorId Actor ID
     * @param sessionName セッション名
     * @returns GitEmbeddingSDK
     */
    switchActorSession(actorId: number, sessionName: string): Promise<GitEmbeddingSDK>;
    /**
     * Actorのファイルを保存
     * @param actorId Actor ID
     * @param filePath ファイルパス
     * @param content ファイル内容
     * @param commitMessage コミットメッセージ
     * @param sessionName セッション名
     */
    saveFileToActor(actorId: number, filePath: string, content: string, commitMessage?: string, sessionName?: string): Promise<string>;
    /**
     * Actorからファイルを読み込み
     * @param actorId Actor ID
     * @param filePath ファイルパス
     * @param sessionName セッション名
     */
    loadFileFromActor(actorId: number, filePath: string, sessionName?: string): Promise<string>;
    /**
     * Actorの状態を取得
     * @param actorId Actor ID
     * @param sessionName セッション名
     */
    getActorStatus(actorId: number, sessionName?: string): Promise<{
        actor: ActorInfo;
        currentSession: string;
        sessions: SessionInfo[];
        indexSize: number;
        status: any[];
        commitHistory: any[];
    }>;
    /**
     * Actorを削除
     * @param actorId Actor ID
     */
    deleteActor(actorId: number): Promise<boolean>;
    /**
     * Sessionを削除
     * @param actorId Actor ID
     * @param sessionName セッション名
     */
    deleteSession(actorId: number, sessionName: string): Promise<boolean>;
    /**
     * 全てのEmbeddingSDKをクリーンアップ
     */
    cleanup(): Promise<void>;
}

/**
 * @file lib/git/actor-repository-manager.ts
 * @description アクターリポジトリの作成・初期化マネージャー
 * @author GFTD Co., Ltd.
 */

interface ActorRepositoryConfig {
    name: string;
    description?: string;
    type: string;
    repositoryType: 'local' | 'online';
    repositoryUrl?: string;
    gitConfig: ChatGitConfig;
    localPath?: string;
    repositoryName?: string;
}
interface RepositoryInitResult {
    success: boolean;
    repositoryPath: string;
    gitConfig: ChatGitConfig;
    initialCommitSha?: string;
    error?: string;
}
/**
 * アクターリポジトリ管理クラス
 * ローカル・オンラインリポジトリの作成と初期化を管理
 */
declare class ActorRepositoryManager {
    /**
     * 新しいアクターリポジトリを作成・初期化
     */
    static createActorRepository(config: ActorRepositoryConfig): Promise<RepositoryInitResult>;
    /**
     * ローカルリポジトリを作成
     */
    private static createLocalRepository;
    /**
     * オンラインリポジトリを初期化
     */
    private static initializeOnlineRepository;
    /**
     * 初期ファイルを作成
     */
    private static createInitialFiles;
    /**
     * README.mdの内容を生成
     */
    private static generateReadmeContent;
    /**
     * .gitignoreの内容を生成
     */
    private static generateGitignoreContent;
    /**
     * Actor設定ファイルを生成
     */
    private static generateActorConfig;
    /**
     * package.jsonを生成
     */
    private static generatePackageJson;
    /**
     * package.jsonを作成すべきかチェック
     */
    private static shouldCreatePackageJson;
    /**
     * ディレクトリ構造を作成
     */
    private static createDirectoryStructure;
    /**
     * index.tsファイルを生成
     */
    private static generateIndexFile;
    /**
     * PascalCaseに変換
     */
    private static toPascalCase;
    /**
     * リポジトリにファイルが存在するかチェック
     */
    private static checkRepositoryHasFiles;
    /**
     * アクターリポジトリの設定を検証
     */
    static validateActorConfig(config: ActorRepositoryConfig): {
        valid: boolean;
        errors: string[];
    };
}

/**
 * @file lib/git/chat-git-manager.ts
 * @description チャット履歴のGit管理マネージャー
 * @author GFTD Co., Ltd.
 */

/**
 * チャット履歴のGit管理クラス
 * セッション管理とGit操作を統合し、チャット履歴をファイルとして永続化
 */
declare class ChatGitManager implements IChatGitManager {
    private gitFs;
    private config;
    private fileNaming;
    private markdownOptions;
    private isInitialized;
    constructor(config: ChatGitConfig, fileNaming?: Partial<ChatHistoryFileNaming>, markdownOptions?: Partial<MarkdownExportOptions>);
    /**
     * 初期化
     */
    private initialize;
    /**
     * チャット履歴を保存
     */
    saveHistory(session: ActorSession, messages: ActorMessage[], commitMessage?: string): Promise<ChatGitSaveResult>;
    /**
     * チャット履歴を読み込み
     */
    loadHistory(sessionId: string, branch?: string): Promise<ChatHistoryFile | null>;
    /**
     * チャット履歴を検索
     */
    searchHistory(query: ChatHistorySearchQuery): Promise<ChatHistorySearchResult[]>;
    /**
     * メッセージを追加保存
     */
    appendMessages(sessionId: string, newMessages: ActorMessage[], commitMessage?: string): Promise<ChatGitSaveResult>;
    /**
     * セッションのブランチを作成
     */
    createSessionBranch(sessionId: string, branchName: string, baseBranch?: string): Promise<boolean>;
    /**
     * 履歴のGitステータス取得
     */
    getHistoryStatus(sessionId: string): Promise<{
        hasChanges: boolean;
        lastCommitSha?: string;
        lastCommitMessage?: string;
        branch: string;
    }>;
    /**
     * コミット履歴取得
     */
    getCommitHistory(sessionId: string, limit?: number): Promise<{
        commitSha: string;
        message: string;
        author: string;
        date: string;
        messageCount: number;
    }[]>;
    /**
     * セッションディレクトリのパスを取得
     */
    private getSessionDirectory;
    /**
     * Markdownに変換
     */
    private convertToMarkdown;
    /**
     * コミットメッセージを生成
     */
    private generateCommitMessage;
    /**
   * セッションディレクトリを検索
   */
    private findSessionDirectories;
    /**
   * 全セッションディレクトリを取得
   */
    private getAllSessionDirectories;
    /**
   * ディレクトリから履歴ファイルを読み込み
   */
    private loadHistoryFromDirectory;
    /**
     * クエリにマッチするかチェック
     */
    private matchesQuery;
    /**
     * キーワードにマッチするメッセージを検索
     */
    private findMatchingMessages;
    /**
     * 検索スコアを計算
     */
    private calculateScore;
}

/**
 * @file lib/git/chat-history-utils.ts
 * @description チャット履歴の復元・検索ヘルパー関数
 * @author GFTD Co., Ltd.
 */

/**
 * デフォルトのGit設定を作成
 */
declare function createDefaultChatGitConfig(repoUrl: string, token: string, authorName?: string, authorEmail?: string): ChatGitConfig;
/**
 * チャット履歴をクイック保存
 */
declare function saveSessionHistory(session: ActorSession, messages: ActorMessage[], gitConfig: ChatGitConfig, customCommitMessage?: string): Promise<boolean>;
/**
 * チャット履歴を検索
 */
declare function searchChatHistory(query: ChatHistorySearchQuery, gitConfig: ChatGitConfig): Promise<ChatHistorySearchResult[]>;
/**
 * セッション履歴を復元
 */
declare function restoreSessionHistory(sessionId: string, gitConfig: ChatGitConfig, branch?: string): Promise<ChatHistoryFile | null>;
/**
 * アクターの全セッション履歴を検索
 */
declare function findActorSessions(actorId: string, gitConfig: ChatGitConfig, limit?: number): Promise<ChatHistorySearchResult[]>;
/**
 * 期間で履歴を検索
 */
declare function findSessionsByDateRange(dateFrom: string, dateTo: string, gitConfig: ChatGitConfig, actorId?: string): Promise<ChatHistorySearchResult[]>;
/**
 * キーワードで履歴を検索
 */
declare function findSessionsByKeyword(keyword: string, gitConfig: ChatGitConfig, actorId?: string, limit?: number): Promise<ChatHistorySearchResult[]>;
/**
 * セッションの統計情報を取得
 */
declare function getSessionStatistics(sessionId: string, gitConfig: ChatGitConfig): Promise<{
    messageCount: number;
    firstMessageDate: string;
    lastMessageDate: string;
    commitCount: number;
    fileSizes: {
        markdown?: number;
        json?: number;
    };
} | null>;
/**
 * 複数のセッション履歴をまとめて取得
 */
declare function bulkRestoreSessions(sessionIds: string[], gitConfig: ChatGitConfig): Promise<Map<string, ChatHistoryFile | null>>;
/**
 * チャット履歴をMarkdown文字列としてエクスポート
 */
declare function exportHistoryAsMarkdown(historyFile: ChatHistoryFile, options?: {
    includeMetadata?: boolean;
    includeToc?: boolean;
    timestampFormat?: string;
}): string;
/**
 * 高度な検索クエリビルダー
 */
declare class ChatHistoryQueryBuilder {
    private query;
    sessionId(id: string): this;
    actorId(id: string): this;
    keyword(keyword: string): this;
    dateRange(from: string, to: string): this;
    branch(branch: string): this;
    limit(limit: number): this;
    build(): ChatHistorySearchQuery;
    execute(gitConfig: ChatGitConfig): Promise<ChatHistorySearchResult[]>;
}

/**
 * @file lib/auth/gftd-auth-client.ts
 * @description GFTD認証システムクライアント
 * @author GFTD Co., Ltd.
 */

/**
 * 認証トークン情報
 */
interface AuthToken {
    /** アクセストークン */
    accessToken: string;
    /** リフレッシュトークン */
    refreshToken?: string;
    /** 有効期限 (Unix timestamp) */
    expiresAt: number;
    /** トークンタイプ */
    tokenType: string;
    /** スコープ */
    scope: string[];
}
/**
 * ユーザー情報
 */
interface UserInfo {
    /** ユーザーID */
    id: string;
    /** ユーザー名 */
    username: string;
    /** メールアドレス */
    email: string;
    /** ロール */
    role: string[];
    /** GitLab組織ID (user_org_id = gitlab organization_id) */
    user_org_id?: string;
    /** 認証済みかどうか */
    authenticated: boolean;
}
/**
 * 認証エラー
 */
declare class GFTDAuthError extends Error {
    statusCode: number;
    code: string;
    constructor(message: string, statusCode?: number, code?: string);
}
/**
 * GFTD認証クライアント
 */
declare class GFTDAuthClient {
    private config;
    private currentToken?;
    private userInfo?;
    constructor(config: GFTDAuthConfig);
    /**
     * 認証が必須かどうか
     */
    isAuthRequired(): boolean;
    /**
     * 認証済みかどうか
     */
    isAuthenticated(): boolean;
    /**
     * トークンが有効かどうか
     */
    private isTokenValid;
    /**
     * 現在のユーザー情報を取得
     */
    getCurrentUser(): UserInfo | null;
    /**
     * 認証トークンを設定
     */
    setToken(token: AuthToken): void;
    /**
     * 認証トークンを取得
     */
    getToken(): AuthToken | null;
    /**
     * ログインURLを生成
     */
    generateLoginUrl(redirectUrl?: string): string;
    /**
     * 認証コードからトークンを取得
     */
    exchangeCodeForToken(code: string, redirectUri?: string): Promise<AuthToken>;
    /**
     * トークンを更新
     */
    refreshToken(): Promise<AuthToken>;
    /**
     * ユーザー情報を読み込み
     */
    loadUserInfo(): Promise<UserInfo>;
    /**
     * ログアウト
     */
    logout(): Promise<void>;
    /**
     * 認証が必要な場合のチェック
     */
    ensureAuthenticated(): Promise<void>;
    /**
     * トークンの更新が必要かどうか
     */
    private needsRefresh;
    /**
     * 状態文字列を生成
     */
    private generateState;
    /**
     * Authorizationヘッダーを取得
     */
    getAuthHeader(): string | null;
}

/**
 * 認証ミドルウェアのオプション
 */
interface AuthMiddlewareOptions {
    /** 認証をスキップするパス */
    skipPaths?: string[];
    /** 認証エラー時のリダイレクトURL */
    redirectUrl?: string;
    /** カスタムエラーハンドラー */
    errorHandler?: (error: GFTDAuthError, req: NextRequest) => NextResponse;
}
/**
 * GFTD認証ミドルウェア
 */
declare class GFTDAuthMiddleware {
    private authClient;
    private options;
    constructor(config: GFTDAuthConfig, options?: AuthMiddlewareOptions);
    /**
     * ミドルウェア関数
     */
    middleware(): (req: NextRequest) => Promise<NextResponse>;
    /**
     * API Routes用の認証チェック関数
     */
    requireAuth(req: NextRequest): Promise<void>;
    /**
     * トークンを検証
     */
    private validateToken;
    /**
     * 認証をスキップするかどうか
     */
    private shouldSkipAuth;
    /**
     * 認証エラーのハンドリング
     */
    private handleAuthError;
    /**
     * 認証クライアントを取得
     */
    getAuthClient(): GFTDAuthClient;
}
/**
 * 認証ミドルウェアファクトリー関数
 */
declare function createAuthMiddleware(config: GFTDAuthConfig, options?: AuthMiddlewareOptions): GFTDAuthMiddleware;
/**
 * React Hook用の認証チェック
 */
declare function useAuth(authClient: GFTDAuthClient): {
    checkAuth: () => Promise<boolean>;
    login: (redirectUrl?: string) => string;
    logout: () => Promise<void>;
    getCurrentUser: () => UserInfo | null;
    isAuthenticated: () => boolean;
    authRequired: boolean;
};

/**
 * @file lib/embedding/index.ts
 * @description LangChainJS + HuggingFaceTransformersEmbeddings + Xenova/all-MiniLM-L6-v2 を使用したembeddingシステム
 * @author GFTD Co., Ltd.
 */

/**
 * Embedding設定インターフェース
 */
interface EmbeddingConfig {
    /** モデル名 (デフォルト: 'Xenova/all-MiniLM-L6-v2') */
    modelName?: string;
    /** 最大シーケンス長 */
    maxSeqLength?: number;
    /** 正規化するかどうか */
    normalize?: boolean;
    /** キャッシュディレクトリ */
    cacheDir?: string;
}

/**
 * @file lib/embedding/vector-store.ts
 * @description usearchを使用したベクトルストアの実装
 * @author GFTD Co., Ltd.
 */

/**
 * ベクトルストアエントリー
 */
interface VectorStoreEntry {
    id: string;
    vector: number[];
    document: Document;
    timestamp: number;
}
/**
 * 検索結果
 */
interface SearchResult {
    document: Document;
    score: number;
    id: string;
}
/**
 * VectorStoreクラス
 * usearchを使用した高速ベクトル検索
 */
declare class VectorStore {
    private index;
    private fs;
    private entries;
    private dimensions;
    private isInitialized;
    constructor(fs: LightningFS, dimensions?: number);
    /**
     * ベクトルストアの初期化
     */
    initialize(): Promise<void>;
    /**
     * ファイルシステムの初期化
     */
    private initializeFileSystem;
    /**
     * ベクトルとドキュメントを追加
     * @param vector ベクトル
     * @param document ドキュメント
     * @returns エントリーID
     */
    add(vector: number[], document: Document): Promise<string>;
    /**
     * ベクトル検索
     * @param query クエリベクトル
     * @param k 返す結果数
     * @returns 検索結果
     */
    search(query: number[], k?: number): Promise<SearchResult[]>;
    /**
     * エントリーをファイルシステムに保存
     */
    private saveEntry;
    /**
     * インデックスをファイルに保存
     */
    save(filename: string): Promise<void>;
    /**
     * インデックスをファイルから読み込み
     */
    load(filename: string): Promise<void>;
    /**
     * インデックスサイズを取得
     */
    size(): number;
    /**
     * エントリーをIDで取得
     */
    getEntry(id: string): VectorStoreEntry | undefined;
    /**
     * エントリーをIDで削除
     */
    remove(id: string): Promise<boolean>;
    /**
     * すべてのエントリーをクリア
     */
    clear(): Promise<void>;
    /**
     * リソースのクリーンアップ
     */
    cleanup(): Promise<void>;
}

declare function cn(...inputs: ClassValue[]): string;

/**
 * @file lib/utils/uuid.ts
 * @description UUID生成ユーティリティ
 * @author GFTD Co., Ltd.
 */
/**
 * シンプルなUUID v4生成（ブラウザ・Node.js両対応）
 */
declare function generateUUID(): string;
/**
 * 短縮UUID生成（8文字、英数字のみ）
 */
declare function generateShortUUID(): string;
/**
 * アクター用のリポジトリ名生成
 * @param actorName 人間が読める名前
 * @returns UUID付きのリポジトリ名
 */
declare function generateRepositoryName(actorName: string): string;
/**
 * タイムスタンプ付きのUUID生成
 */
declare function generateTimestampUUID(): string;
/**
 * UUID検証
 */
declare function isValidUUID(uuid: string): boolean;
/**
 * 短縮UUID検証
 */
declare function isValidShortUUID(uuid: string): boolean;

/**
 * Actor SDK エクスポート
 * Actor v3 プロセス代数 & LangChain.js互換性対応
 * https://actor.gftd.ai/api/v3/actor
 */

declare const SDK_VERSION = "3.0.0";
declare const API_VERSION = "v3";
declare const PROCESS_ALGEBRA_ENABLED = true;
/**
 * Actor v3 機能フラグ
 */
declare const Features: {
    readonly PROCESS_ALGEBRA: true;
    readonly LANGCHAIN_COMPATIBILITY: true;
    readonly FORMAL_VERIFICATION: true;
    readonly DEADLOCK_DETECTION: true;
    readonly LIVELOCK_DETECTION: true;
    readonly COMMUNICATION_TOPOLOGY: true;
    readonly PERFORMANCE_METRICS: true;
};
/**
 * Process Algebra Support
 */
declare const ProcessAlgebra: {
    readonly NOTATIONS: readonly ["CCS", "π-calculus", "ACP"];
    readonly ANALYSIS_FEATURES: readonly ["deadlock_detection", "livelock_detection", "reachability_analysis"];
    readonly COMMUNICATION_PATTERNS: readonly ["send_receive", "parallel_composition", "choice", "recursion"];
};
/**
 * LangChain.js 互換性サポート
 */
declare const LangChainCompatibility: {
    readonly RUNNABLE_INTERFACE: true;
    readonly INVOKE_METHOD: true;
    readonly STREAM_METHOD: true;
    readonly BATCH_METHOD: true;
    readonly PIPE_METHOD: true;
    readonly FALLBACK_METHOD: true;
};

export { type AIMessage, API_VERSION, type ActorApiConfig, type EmbeddingConfig as ActorEmbeddingConfig, type ActorFunctionCall, ActorGitManager, type ActorGitManagerConfig, type ActorID, type ActorInfo, type ActorMessage, type ActorRepositoryConfig, ActorRepositoryManager, type ActorSDKConfig, type ActorSession, type ActorSystemConfig, type ActorToolCall, ActorV3ChatClient, ActorV3Client, type ActorV3Error, ActorV3Runnable, type ActorV3RunnableInterface, type ApiV3Response, type AuthMiddlewareOptions, type AuthToken, type BatchRequest, type BatchResponse, type Behavior, type BehaviorResult, type ChatGitConfig, ChatGitManager, type ChatGitSaveResult, type ChatHistoryFile, type ChatHistoryFileNaming, type ChatHistoryMetadata, ChatHistoryQueryBuilder, type ChatHistorySearchQuery, type ChatHistorySearchResult, type ChatMessage, type ChatRequest, type ChatResponse, type CreateActorRequest, type CreateActorResponse, type CreateBranchConfig, type CreateProjectConfig, type CreateSessionRequest, DEFAULT_ACTOR_TEMPLATES, type DebugConfig, type DefaultActorTemplate, type EmbeddingConfig$1 as EmbeddingConfig, type ErrorResponse, Features, GFTDAuthClient, type GFTDAuthConfig, GFTDAuthError, GFTDAuthMiddleware, type GitConfig, type GitEmbeddingConfig, GitEmbeddingSDK, GitFileSystem, type GitIntegrationConfig, GitLabClient, type GitLabConfig, type GitSearchResult, GitVectorStore, type GitVectorStoreEntry, type HumanMessage, type IChatGitManager, type InvokeRequest, type InvokeResponse, type LangChainActorConfig, type LangChainActorResponse, LangChainCompatibility, type LangChainMessage, type ListActorsResponse, type MarkdownExportOptions, type Message, type MessageLike, type MessageResponse, type MonitoringConfig, type OutAction, PROCESS_ALGEBRA_ENABLED, ProcessAlgebra, type ReceiveMessagesRequest, type ReceiveMessagesResponse, type RepositoryInitResult, type RunnableConfig$1 as RunnableConfig, type RunnableInput, type SDKConfig, SDKConfigManager, SDK_VERSION, type SearchResult, type SendMessageRequest, type SendMessageResponse, type SessionConfig, type SessionContinueRequest, type SessionCreateRequest, type SessionError, type SessionInfo, type SessionListResponse, type SessionResponse, type SessionRunnable, type SessionStreamEvent, type SessionStreamResponse, type State, type StreamRequest, type StreamingConfig, type StructuredTool, type SystemMessage, type SystemStatsResponse, type ToolCall, type ToolMessage, type ToolsConfig, type UIConfig, type UseGftdChatOptions, type UseGftdChatReturn, type UserInfo, VectorStore, type VectorStoreEntry, actorV3Api, actorV3ChatClient, actorV3ToLangChain, bulkRestoreSessions, cn, createAuthMiddleware, createConfigFromEnv, createConfigWithDefaultGitLab, createDefaultChatGitConfig, createDefaultConfig, createDefaultSDKConfig, createDevelopmentConfig, createLocalDevelopmentConfig, createMessage, createProductionConfig, createSampleBehavior, exportHistoryAsMarkdown, findActorSessions, findSessionsByDateRange, findSessionsByKeyword, generateRepositoryName, generateShortUUID, generateTimestampUUID, generateUUID, getSessionStatistics, isLocalDevelopment, isToolEnabled, isValidShortUUID, isValidUUID, langChainToActorV3, mergeConfig, restoreSessionHistory, saveSessionHistory, searchChatHistory, useActorV3Creation, useActorV3Health, useActorV3List, useActorV3Messaging, useActorV3Runnable, useActorV3System, useAuth, useGftdChat, validateConfig };
