import type { PortableTool } from "../portable-tool.js";
import type { CommunityDiscoveryResult, CommunityDiscoveryStatus } from "../../runtime/community/community-discovery-coordinator.js";
import type { CommunityInstallRiskTier, CommunityInstallSourceTier, CommunityInstallTrustStage, CommunityRegistryMatchResult } from "../../runtime/community/community-consent-client.js";
export declare const COMMUNITY_SEEK_TOOL_NAME: "community_seek";
export type CommunitySeekKind = "package" | "answer";
export interface CommunitySeekParams {
    intent: string;
    kinds?: CommunitySeekKind[];
}
export interface CommunitySeekPackageCandidate {
    kind: "package";
    id: string;
    title: string;
    summary: string;
    capabilityTags: string[];
    sourceTier: CommunityInstallSourceTier;
    trustStage: CommunityInstallTrustStage;
    effectiveRiskTier: CommunityInstallRiskTier;
    latestVersion: string | null;
}
export interface CommunitySeekAnswerCandidate {
    kind: "answer";
    reviewId: string;
    resourceId: string;
    title: string;
    /** 对端 agent 的经验文本(发布侧已过脱敏硬闸 R24)。 */
    experience: string;
    outcome: "success" | "fail" | "neutral";
}
export type CommunitySeekCandidate = CommunitySeekPackageCandidate | CommunitySeekAnswerCandidate;
/** 轻回执:落进对话的可折叠"去社区找了个 X"(展示侧由 UI 渲染)。 */
export interface CommunitySeekReceipt {
    intent: string;
    status: CommunityDiscoveryStatus;
    packageCount: number;
    answerCount: number;
    topTitle?: string;
}
export interface CommunitySeekResult {
    status: CommunityDiscoveryStatus;
    intent: string;
    packages: CommunitySeekPackageCandidate[];
    answers: CommunitySeekAnswerCandidate[];
}
export interface CommunitySeekDeps {
    /** 发现协调器:本地前置 + consent + 缓存 + ≤1 次 O(1) registry_match。 */
    discover(intent: string): Promise<CommunityDiscoveryResult>;
    /** 经验答案源(Cut1 默认无:hub registry_match 扩返经验答案后接入)。 */
    findAnswers?(intent: string, topK: number): Promise<CommunitySeekAnswerCandidate[]>;
    /** 轻回执 sink(对话侧渲染);best-effort,抛错不影响工具结果。 */
    onReceipt?(receipt: CommunitySeekReceipt): void;
    /**
     * 「去社区张罗到了」→ 发一条 acquire ActivityEvent(父总纲 Cut1「落…一条 ActivityEvent」):
     * 自家宠物现身于命中资源的店铺/街区。anchor 只给 shopId(店铺=canonical resourceId);
     * 街区由集市端按 layout 反解。best-effort fire-and-forget,抛错/未配置都不影响工具结果。
     */
    onAcquire?(anchor: {
        shopId?: string;
        districtId?: string;
    }): void;
}
export declare function toPackageCandidate(match: CommunityRegistryMatchResult): CommunitySeekPackageCandidate;
export declare function runCommunitySeek(deps: CommunitySeekDeps, params: CommunitySeekParams): Promise<CommunitySeekResult>;
export declare const COMMUNITY_SEEK_TOOL_SCHEMA: {
    readonly type: "object";
    readonly properties: {
        readonly intent: {
            readonly type: "string";
            readonly description: string;
        };
        readonly kinds: {
            readonly type: "array";
            readonly items: {
                readonly type: "string";
                readonly enum: readonly ["package", "answer"];
            };
            readonly description: "Restrict results to packages and/or answers. Omit for both.";
        };
    };
    readonly required: readonly ["intent"];
};
export declare function createCommunitySeekTool(deps: CommunitySeekDeps): PortableTool<CommunitySeekParams>;
