import { TraitReference, OrbitalDefinition } from '@almadar/core/types';

/**
 * Phase 9 — Typed factory dispatcher.
 *
 * Looks up a per-orbital factory by (organism, orbitalName) and calls
 * it with consumer params, narrowing from `object` to the per-factory
 * typed shape via emitted typed guards (no `as unknown as`).
 *
 * Autogenerated by almadar-sync std-ts from
 * packages/almadar-std/behaviors/registry/<topic>/organisms/std-*.orb
 * (multi-orbital organisms only).
 *
 * @packageDocumentation
 */

interface ParamFieldDescriptor {
    name: string;
    type: string;
    description: string;
}
interface OrbitalParamsManifest {
    organism: string;
    orbitalName: string;
    paramFields: readonly ParamFieldDescriptor[];
    traitNames: readonly string[];
    inlineTraitNames: readonly string[];
}
/**
 * One trait reference appended via `params.extraTraits[]`. Phase 2
 * (Mechanism 2). `from` + `as` are required because the dispatcher
 * merges into `uses[]` verbatim — no JS-side name transforms.
 * Mirrors `ExtraTraitRef` from @almadar-io/agent — kept structural
 * (no inter-package type dep) but type-compatible.
 */
interface DispatchExtraTrait extends Pick<TraitReference, 'ref' | 'name' | 'linkedEntity' | 'config' | 'events' | 'listens' | 'emitsScope'> {
    from: string;
    as: string;
}
/**
 * Look up the per-orbital factory by (organism, orbitalName) and call
 * it with the supplied params. Returns null when no factory exists.
 * Throws TypeError when params fail the factory's typed guard
  (caught by the agent's instantiate-orbital surface).
 *
 * `params.extraTraits` (Phase 2) is orthogonal to factory-specific
 * params: it's separated out BEFORE the typed guard runs and appended
 * to `def.traits[]` (with corresponding `uses[]` entries merged) AFTER
 * the factory returns. Strictly additive — never replaces factory
 * traits.
 *
 * `params.traitOverrides` may also carry entries keyed on an
 * extra-trait's NAME (Phase 4's `applyRuleOverlay` row emits
 * `traitOverrides[<TraitName>].config` for capability-matched traits).
 * Those entries are partitioned out BEFORE the typed guard runs — the
 * factory's guard rejects unknown trait keys — and merged into the
 * matching extraTrait BEFORE it's appended. Native-trait overrides
 * (keys in the factory's `manifest.traitNames`) stay on the factory
 * params untouched.
 */
declare function dispatchOrbitalFactory(organism: string, orbitalName: string, params: object & {
    extraTraits?: DispatchExtraTrait[];
}): OrbitalDefinition | null;
/**
 * Fetch the params manifest for one (organism, orbitalName). Returns
 * null when no factory exists. Used by the agent's Stage A prompt to
 * surface paramFields + traitNames + inlineTraitNames as the closed
 * set the LLM may emit.
 */
declare function getOrbitalFactoryManifest(organism: string, orbitalName: string): OrbitalParamsManifest | null;
/**
 * List every orbital manifest for one organism. Used by Stage A to
 * embed the chosen organism's full manifest set into the prompt.
 */
declare function listOrganismOrbitalManifests(organism: string): OrbitalParamsManifest[];

export { type OrbitalParamsManifest as O, type ParamFieldDescriptor as P, dispatchOrbitalFactory as d, getOrbitalFactoryManifest as g, listOrganismOrbitalManifests as l };
