graph TD
S4[SUBAGENT 4: PACKAGEAGENT] --> MD[Metadata Generation]
S4 --> FO[File Organization]
S4 --> AC[Archive Creation]
MD --> |metadata.json| AC
FO --> |organized_files| AC
subgraph Metadata Generation
MD --> MD1[Process Input Data]
MD1 --> MD2[Generate JSON Structure]
MD2 --> MD3[Write metadata.json]
end
subgraph File Organization
FO --> FO1[Create Folder Structure]
FO1 --> FO2[Sort WAV Files]
FO2 --> FO3[Rename Files]
end
subgraph Archive Creation
AC --> AC1[Collect All Files]
AC1 --> AC2[Create ZIP Structure]
AC2 --> AC3[Compress Files]
AC3 --> ZIP[final_sample_pack.zip]
end
classDef default fill:#f9f,stroke:#333,stroke-width:2px
classDef process fill:#bbf,stroke:#333,stroke-width:2px
classDef output fill:#bfb,stroke:#333,stroke-width:2px
class S4 default
class MD,FO,AC process
class ZIP output