footprintjs - v11.2.0
    Preparing search index...

    Interface StructureRecorder

    Pluggable observer for BUILD-TIME chart construction events.

    All methods are optional — implement only the hooks you need. Handlers fire SYNCHRONOUSLY during builder operations and .build(). A throwing handler is caught (see "Error isolation" in the file header); subsequent dispatch continues.

    Lifecycle: each StructureRecorder instance is registered via EITHER the flowChart() options bag ({ structureRecorders: [rec] }) OR the fluent .attachStructureRecorder(rec) chain — see the file header for the trade-offs. Registration after .build() is rejected (chart is sealed).

    interface StructureRecorder {
        id: string;
        onDeciderComplete?(event: StructureDeciderCompleteEvent): void;
        onEdgeAdded?(event: StructureEdgeAddedEvent): void;
        onLoopEdgeAdded?(event: StructureLoopEdgeAddedEvent): void;
        onStageAdded?(event: StructureStageAddedEvent): void;
        onStageTagged?(event: StructureStageTaggedEvent): void;
        onSubflowMounted?(event: StructureSubflowMountedEvent): void;
    }
    Index
    id: string

    Stable identifier — used by the dispatcher to scope error messages and to support detach(id) lookup.

    Convention (matches FlowRecorder.id from CLAUDE.md):

    • domain-prefixed kebab-case ('lens-structure', 'agentfootprint-composition', 'trace-explainable')
    • same id → multiple recorders coexist (NOT deduplicated by id; the dispatcher fires every attached recorder regardless)
    • detach(id) removes EVERY recorder with that id — be intentional about reuse if you rely on selective detach

    Choose a stable id at module load and don't randomise it across runs — it lands in StructureBuildError.recorderId so debug output is greppable.