import { type Config } from "../config.js";
import type { HarnessClient } from "../client/harness-client.js";
import type { ResourceDefinition, ToolsetDefinition, OperationName, EndpointSpec, FilterFieldSpec, ResourceScope } from "./types.js";
import type { AuditManager } from "../audit/manager.js";
import type { AuditContext } from "../audit/types.js";
/** All available toolset names — used by docs generation to discover opt-in toolsets. */
export declare const ALL_TOOLSET_NAMES: string[];
/**
 * Options for extending the Registry with additional toolsets.
 */
export interface RegistryOptions {
    additionalToolsets?: ToolsetDefinition[];
    /**
     * Optional callback that resolves the effective account ID for the current
     * request.  Used by multi-tenant deployments (internal HTTP mode) where the
     * account ID varies per request and is not known at startup.
     * When provided, `registry.getAccountId()` calls this first and falls back
     * to `config.HARNESS_ACCOUNT_ID` if it returns `undefined`.
     */
    accountIdResolver?: () => string | undefined;
    /** When provided, every dispatch emits an AuditEvent to all registered sinks. */
    auditManager?: AuditManager;
}
/**
 * The enabled registry — filtered by HARNESS_TOOLSETS config.
 */
export declare class Registry {
    private config;
    private resourceMap;
    private toolsets;
    private accountIdResolver?;
    private auditManager?;
    constructor(config: Config, options?: RegistryOptions);
    getAccountId(): string;
    /**
     * Parse HARNESS_TOOLSETS env var. Supports three modes:
     *
     *  - Explicit list:    "pipelines,services"         → only those toolsets
     *  - Additive (+):     "+ai-evals"                  → defaults + ai-evals
     *  - Subtractive (-):  "-chaos,-ccm"                → defaults minus chaos & ccm
     *  - Mixed +/-:        "+ai-evals,-chaos"            → defaults + ai-evals - chaos
     *
     * Returns `null` when the value is empty (meaning "all defaults").
     * Returns `"defaults"` when +/- modifiers are used (caller applies them).
     */
    private parseToolsetFilter;
    get orgId(): string | undefined;
    get projectId(): string | undefined;
    /** Get a resource definition by type, or throw. */
    getResource(resourceType: string): ResourceDefinition;
    /** Get all enabled resource types. */
    getAllResourceTypes(): string[];
    /** Get resource types that support a specific CRUD operation. */
    getTypesForOperation(operation: OperationName): string[];
    /** Get scopes supported by a resource for explicit resource_scope selection. */
    getSupportedScopes(resourceType: string): readonly ResourceScope[];
    /** Get resource types that have at least one execute action. */
    getTypesWithExecuteActions(): string[];
    /** Get all unique filter fields across all enabled resource definitions. */
    getAllFilterFields(): FilterFieldSpec[];
    /** Get all enabled toolsets with their resources. */
    getAllToolsets(): ToolsetDefinition[];
    /** Check if a resource type supports an operation. */
    supportsOperation(resourceType: string, operation: OperationName): boolean;
    /** Check if a resource type has execute actions. */
    getExecuteActions(resourceType: string): Record<string, EndpointSpec & {
        actionDescription: string;
    }> | undefined;
    private static readonly READ_OPERATIONS;
    /** Dispatch a CRUD operation to the Harness API. */
    dispatch(client: HarnessClient, resourceType: string, operation: OperationName, input: Record<string, unknown>, signalOrAudit?: AbortSignal | AuditContext, signal?: AbortSignal): Promise<unknown>;
    /** Dispatch an execute action to the Harness API. */
    dispatchExecute(client: HarnessClient, resourceType: string, action: string, input: Record<string, unknown>, signalOrAudit?: AbortSignal | AuditContext, signal?: AbortSignal): Promise<unknown>;
    /**
     * Wraps executeSpec with timing and audit event emission.
     */
    private executeSpecWithAudit;
    private emitAuditEvent;
    private executeSpec;
    /** Get describe metadata for all enabled resource types (full detail). */
    describe(): Record<string, unknown>;
    /** Search resource types by keyword — matches type, display name, toolset, description. */
    searchResources(query: string): Array<{
        type: string;
        name: string;
        toolset: string;
        ops: string[];
        description: string;
    }>;
    /** Get compact summary — one line per resource type, ~15 tokens each. */
    describeSummary(): Record<string, unknown>;
}
//# sourceMappingURL=index.d.ts.map