import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
import { BaseResourceComponent, NavigationService } from '@memberjunction/ng-shared';
import { ResourceData } from '@memberjunction/core-entities';
import * as i0 from "@angular/core";
/**
 * "Operations" sub-page of the Bulk Operations shell. A thin host that renders the generic, self-contained
 * `<mj-record-process-studio>` (list / create / edit / run) scoped to the current provider.
 *
 * This host also wires the surface into the MJ AI-agent stack: it reports the studio's live state via
 * `SetAgentContext` and registers a curated set of SAFE client tools via `SetAgentClientTools`. The host
 * reaches the hosted generic studio through a {@link ViewChild} reference (`studio`) and only reads its
 * public state / calls its public methods — it never reaches into the generic package's internals, and it
 * never duplicates the studio's logic.
 *
 * 🚨🚨🚨 SAFETY BOUNDARY — Bulk Operations is the most destructive surface in the product. 🚨🚨🚨
 * A single operation can mutate thousands of records. Therefore:
 *   1. The ONLY "run"-shaped tool exposed to the agent is `PreviewProcessChanges`, which calls
 *      `studio.Run(p)`. `Run()` opens the RecordProcessRunnerUX runner, which ALWAYS performs a
 *      compute-only DRY-RUN preview FIRST and requires the USER to click Apply to write real changes.
 *      So the agent can only trigger the *preview*; the destructive apply remains a manual user click.
 *   2. DO NOT add any tool that performs a REAL (non-dry-run) apply — nothing that bypasses the runner's
 *      preview → user-confirm flow (e.g. nothing that would call `runOp(id, false)` or write directly).
 *   3. DO NOT expose `SaveProcess` / process-definition commits as an agent tool. Creating/editing/saving
 *      a process definition stays user-driven; the agent may only *open* the editor (CreateNewProcess /
 *      EditProcess) and navigate.
 * If you are tempted to add a "RunProcessForReal" / "ApplyChanges" tool here: STOP. It violates this
 * boundary. The real apply is, and must remain, a manual user action inside the runner.
 */
export declare class BulkOperationsOperationsComponent extends BaseResourceComponent implements OnInit, AfterViewInit, OnDestroy {
    /** Reference to the hosted generic studio — the source of truth for context + the target of every tool. */
    private studio?;
    protected navigationService: NavigationService;
    ngOnInit(): Promise<void>;
    /**
     * Wire agent context + tools once the view (and therefore the `studio` ViewChild) is available.
     * The studio finishes its own initial `reload()` asynchronously; we publish context immediately
     * with whatever state is present and rely on each tool Handler to re-publish after it acts, so the
     * agent's streamed context tracks the visible operation set. A `queueMicrotask` defers the first
     * publish one tick so an in-flight `ngOnInit` reload that has already resolved is reflected.
     */
    ngAfterViewInit(): void;
    ngOnDestroy(): void;
    GetResourceDisplayName(_data: ResourceData): Promise<string>;
    GetResourceIconClass(_data: ResourceData): Promise<string>;
    /**
     * Publish the studio's live state to the AI agent. Tolerant of the ViewChild not yet being
     * resolved (publishes a minimal "loading" snapshot). Re-invoked by every tool Handler after it
     * mutates studio state, since the generic studio emits no change events we could subscribe to.
     */
    private publishAgentContext;
    /**
     * Register the curated set of SAFE agent tools for the Operations surface. Every Handler is tolerant
     * (returns a typed failure rather than throwing) and re-publishes context after acting.
     *
     * SAFETY: the only run capability here is `PreviewProcessChanges` (dry-run preview via the runner).
     * No tool performs a real apply, and no tool commits a process definition. See the class-level
     * SAFETY BOUNDARY comment.
     */
    private registerAgentTools;
    /** Reload the studio's process list, then re-publish context. */
    private handleRefresh;
    /**
     * Apply a search filter to the studio. We set the studio's public `Search` field and then drive its
     * own `onSearch` with a synthetic input event so the studio re-derives `Filtered` and runs its OnPush
     * change detection exactly as it would for a real keystroke.
     */
    private handleSearch;
    /** Open the editor in "new" mode (user-driven save). */
    private handleCreateNew;
    /** Open the editor for an existing process, resolved from the studio's loaded list by id or name. */
    private handleEdit;
    /**
     * Open the SAFE dry-run preview for an existing process. Delegates to `studio.Run(p)`, which mounts
     * the RecordProcessRunnerUX — that runner ALWAYS previews (dry-run) first and requires a manual user
     * click to apply real changes. The agent therefore triggers only the preview, never the apply.
     */
    private handlePreview;
    /** Return to the list view from the editor or preview. */
    private handleBackToList;
    /** The hosted studio, or undefined if the view isn't ready yet. */
    private requireStudio;
    /** Typed "not ready" failure for tools invoked before the ViewChild resolves. */
    private notReady;
    /**
     * Resolve a process row from the studio's loaded list by ID OR name (delegates to the pure,
     * unit-tested {@link resolveRowByIDOrName} helper: exact ID → exact name → partial-name contains).
     * Returns a structured failure (listing available names) if the param is missing/non-string or no
     * row matches. Resolves against the full loaded `Processes` set, not just the filtered view, so a
     * search filter never hides an operation the agent references by name.
     */
    private findProcess;
    /** Build a minimal synthetic input event so we can drive the studio's `onSearch(event)` API. */
    private makeInputEvent;
    static ɵfac: i0.ɵɵFactoryDeclaration<BulkOperationsOperationsComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<BulkOperationsOperationsComponent, "mj-bulk-operations-operations", never, {}, {}, never, never, false, never>;
}
//# sourceMappingURL=bulk-operations-operations.component.d.ts.map