import { WorkflowDedupClient, PublishResult } from '@openhi/workflows';
import { EventBridgeEvent } from 'aws-lambda';
import { O as OpenHiContext } from './openhi-context-CaBH8SFo.js';

/**
 * @see sites/www-docs/content/packages/@openhi/constructs/workflows/control-plane/seed-system-data/seed-system-data-handler.md
 *
 * EventBridge workflow handler invoked once per platform-deploy event on
 * the control event bus. Idempotently re-asserts the platform-singleton
 * control-plane records (today: the three canonical Roles; future:
 * additional system data slotted in as sibling steps under the same
 * dedup record).
 */
type SeedSystemDataEvent = EventBridgeEvent<"platform.deployment-completed.v1", unknown>;
/**
 * Input shape the handler passes to the completion publisher. Mirrors
 * the wire shape of `PlatformSystemDataSeededV1Detail` plus the
 * envelope-correlation fields the publisher needs to chain the new
 * event onto the originating deploy event.
 */
interface PublishSeededInput {
    /** Per-workflow payload — re-asserted record count + source event/stack ids. */
    readonly payload: {
        readonly sourceEventId: string;
        readonly sourceStackId: string;
        readonly seededRecordCount: number;
    };
    /**
     * Envelope context propagated from the originating
     * `platform.deployment-completed.v1` event so the chain is
     * observable in logs.
     */
    readonly envelope: {
        readonly correlationId: string;
        readonly causationId: string;
    };
}
/**
 * Dependency seam for tests. The factory mirrors the production
 * arrangement: a real DynamoDB client + the real `workflowDedupClient`
 * factory bound to the `OPENHI_WORKFLOW_DEDUP_TABLE_NAME` env var the
 * construct injects via `grantConsumer`.
 */
interface SeedSystemDataDependencies {
    readonly dedupClient: WorkflowDedupClient;
    readonly seedRoles: (context: OpenHiContext) => Promise<void>;
    /**
     * Publishes the `platform.system-data-seeded.v1` completion event
     * onto the control event bus. Called after a successful seed and
     * before the handler returns — downstream consumers
     * (`seed-demo-data`) subscribe to this event instead of the raw
     * deploy-completion event so the dependency on system data is
     * enforced by a happens-before edge.
     */
    readonly publishSeeded: (input: PublishSeededInput) => Promise<PublishResult>;
}
/**
 * Test-visible orchestrator. The production `handler` calls this with
 * real dependencies; unit tests inject fakes.
 */
declare const runSeedSystemData: (event: SeedSystemDataEvent, deps: SeedSystemDataDependencies) => Promise<void>;
declare const handler: (event: SeedSystemDataEvent) => Promise<void>;

export { type PublishSeededInput, type SeedSystemDataDependencies, handler, runSeedSystemData };
