Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions data-machine-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@ function datamachine_code_has_datamachine_integration(): bool {
return class_exists('DataMachine\Abilities\PermissionHelper');
}

/**
* Register DMC-owned bundle artifact hooks.
*
* Bundle artifact type discovery can run before the rest of DMC's Data Machine
* integrations are available. Keep these hooks registered independently so
* imported agent bundles can materialize DMC-owned artifacts during install.
*/
function datamachine_code_register_bundle_artifacts(): void {
static $registered = false;

if ( $registered ) {
return;
}

$registered = true;
( new \DataMachineCode\Bundle\WorkspacePreloadArtifact() )->register();
}
datamachine_code_register_bundle_artifacts();

/**
* Register optional Data Machine integrations.
*/
Expand All @@ -77,10 +96,6 @@ function datamachine_code_register_datamachine_integrations(): void {

$registered = true;

// Bundle artifact types are Data Machine-specific and are only registered
// when the bundle importer substrate is present.
( new \DataMachineCode\Bundle\WorkspacePreloadArtifact() )->register();

// Project active workspace identity into Data Machine's engine_data snapshot.
\DataMachineCode\Runtime\ActiveWorkspaceProjector::register();

Expand Down
Loading