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 | undefined; private static readonly READ_OPERATIONS; /** Dispatch a CRUD operation to the Harness API. */ dispatch(client: HarnessClient, resourceType: string, operation: OperationName, input: Record, signalOrAudit?: AbortSignal | AuditContext, signal?: AbortSignal): Promise; /** Dispatch an execute action to the Harness API. */ dispatchExecute(client: HarnessClient, resourceType: string, action: string, input: Record, signalOrAudit?: AbortSignal | AuditContext, signal?: AbortSignal): Promise; /** * Wraps executeSpec with timing and audit event emission. */ private executeSpecWithAudit; /** * Emit a pre-dispatch audit event for an operation that was blocked * (e.g. by elicitation when the client could not surface a confirmation * prompt). The blocked attempt does not run; this exists so operators can * see in audit logs that the LLM tried to execute something that was * gated. * * Best-effort: if path resolution throws (e.g. a `pathBuilder` requires * identifier fields that haven't been populated on the input map yet for * this blocked attempt), the failure is swallowed and the audit row is * emitted with `http_path` omitted. Audit emission must NEVER block or * alter the user-visible response — the blocked attempt itself is the * load-bearing signal, not the path. Safe to call when no audit manager * is configured (no-ops). */ auditBlockedAttempt(resourceType: string, operation: string, input: Record, auditCtx: AuditContext | undefined, blockReason: string): void; private emitAuditEvent; private executeSpec; private getBodySchemaValidationPayload; /** Get describe metadata for all enabled resource types (full detail). */ describe(): Record; /** 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; } //# sourceMappingURL=index.d.ts.map