PAX

 view release on metacpan or  search on metacpan

lib/PAX/CodeUnitCompiler.pm  view on Meta::CPAN


    if (
        _package_tail_is($package, '')
        && $short_name eq '_shutdown_loop'
        && $body =~ /_write_loop_state/
        && $body =~ /_cleanup_loop_files/
        && $body =~ /exit 0/
    ) {
        my $prototype = _sub_prototype_from_source($source, $short_name);
        return {
            name => $short_name,
            full_name => $full_name,
            op => 'collector_runner_shutdown_loop',
            write_loop_state_method => $package . '::_write_loop_state',
            process_title_method => $package . '::_process_title',
            cleanup_loop_files_method => $package . '::_cleanup_loop_files',
            now_method => $package . '::_now_iso8601',
            prototype => $prototype,
        };
    }

    if (
        _package_tail_is($package, '')
        && $short_name eq '_signal_stop'
        && $body =~ /\$SIGNAL_RUNNER->_shutdown_loop/
    ) {
        my $prototype = _sub_prototype_from_source($source, $short_name);
        return {
            name => $short_name,
            full_name => $full_name,
            op => 'collector_runner_signal_stop',
            prototype => $prototype,
        };
    }

    if (
        _package_tail_is($package, '')
        && $short_name eq 'dispatch'
        && $body =~ /unknown_skill_command_message/
        && $body =~ /execute_hooks/
        && $body =~ /_skill_env/
        && $body =~ /command_argv_for_path/
    ) {
        my $prototype = _sub_prototype_from_source($source, $short_name);
        return {
            name => $short_name,
            full_name => $full_name,
            op => 'skill_dispatcher_dispatch',
            command_spec_method => $package . '::_command_spec',
            execute_hooks_method => $package . '::execute_hooks',
            skill_layers_method => $package . '::_skill_layers',
            skill_env_method => $package . '::_skill_env',
            prototype => $prototype,
        };
    }

    if (
        _package_tail_is($package, '')
        && $short_name eq 'exec_command'
        && $body =~ /unknown_skill_command_message/
        && $body =~ /_execute_hooks_streaming/
        && $body =~ /_exec_resolved_command/
    ) {
        my $prototype = _sub_prototype_from_source($source, $short_name);
        return {
            name => $short_name,
            full_name => $full_name,
            op => 'skill_dispatcher_exec_command',
            command_spec_method => $package . '::_command_spec',
            execute_hooks_streaming_method => $package . '::_execute_hooks_streaming',
            skill_layers_method => $package . '::_skill_layers',
            skill_env_method => $package . '::_skill_env',
            exec_resolved_method => $package . '::_exec_resolved_command',
            prototype => $prototype,
        };
    }

    if (
        _package_tail_is($package, '')
        && $short_name eq 'execute_hooks'
        && $body =~ /_command_spec/
        && $body =~ /_skill_env/
        && $body =~ /load_runtime_layers/
        && $body =~ /load_skill_layers/
    ) {
        my $prototype = _sub_prototype_from_source($source, $short_name);
        return {
            name => $short_name,
            full_name => $full_name,
            op => 'skill_dispatcher_execute_hooks',
            command_spec_method => $package . '::_command_spec',
            skill_layers_method => $package . '::_skill_layers',
            skill_env_method => $package . '::_skill_env',
            prototype => $prototype,
        };
    }

    if (
        _package_tail_is($package, '')
        && $short_name eq '_execute_hooks_streaming'
        && $body =~ /_arrayref_or_empty/
        && $body =~ /_skill_env/
        && $body =~ /_run_child_command_streaming/
    ) {
        my $prototype = _sub_prototype_from_source($source, $short_name);
        return {
            name => $short_name,
            full_name => $full_name,
            op => 'skill_dispatcher_execute_hooks_streaming',
            arrayref_or_empty_method => $package . '::_arrayref_or_empty',
            skill_env_method => $package . '::_skill_env',
            run_child_streaming_method => $package . '::_run_child_command_streaming',
            prototype => $prototype,
        };
    }

    if (
        _package_tail_is($package, '')
        && $short_name eq '_run_child_command_streaming'
        && $body =~ /_arrayref_or_empty/
        && $body =~ /_hashref_or_empty/
        && $body =~ /_defined_or_default/
        && $body =~ /open3/
        && $body =~ /IO::Select/
    ) {
        my $prototype = _sub_prototype_from_source($source, $short_name);
        return {
            name => $short_name,
            full_name => $full_name,
            op => 'skill_dispatcher_run_child_command_streaming',
            arrayref_or_empty_method => $package . '::_arrayref_or_empty',
            hashref_or_empty_method => $package . '::_hashref_or_empty',
            defined_or_default_method => $package . '::_defined_or_default',
            prototype => $prototype,
        };
    }

    if (
        _package_tail_is($package, '')
        && $short_name eq '_exec_resolved_command'
        && $body =~ /_arrayref_or_empty/
        && $body =~ /_exec_replacement/
    ) {
        my $prototype = _sub_prototype_from_source($source, $short_name);
        return {
            name => $short_name,
            full_name => $full_name,
            op => 'skill_dispatcher_exec_resolved_command',
            arrayref_or_empty_method => $package . '::_arrayref_or_empty',
            exec_replacement_method => $package . '::_exec_replacement',
            prototype => $prototype,
        };
    }

    if (
        _package_tail_is($package, '')
        && $short_name eq '_exec_replacement'
        && $body =~ /!exec \@command, \@args/
    ) {
        my $prototype = _sub_prototype_from_source($source, $short_name);
        return {
            name => $short_name,
            full_name => $full_name,
            op => 'skill_dispatcher_exec_replacement',
            prototype => $prototype,
        };
    }

    if (
        _package_tail_is($package, '')
        && $short_name eq 'get_skill_config'
        && $body =~ /_skill_layers/
        && $body =~ /config\/', 'config\.json'|config', 'config.json/
        && $body =~ /_merge_skill_hashes/
    ) {
        my $prototype = _sub_prototype_from_source($source, $short_name);
        return {
            name => $short_name,
            full_name => $full_name,
            op => 'skill_dispatcher_get_skill_config',
            skill_layers_method => $package . '::_skill_layers',
            merge_skill_hashes_method => $package . '::_merge_skill_hashes',
            prototype => $prototype,
        };
    }

    if (
        _package_tail_is($package, '')
        && $short_name eq 'get_skill_path'
        && $body =~ /manager}->get_skill_path/



( run in 1.677 second using v1.01-cache-2.11-cpan-140bd7fdf52 )