#!/usr/bin/env perl

use strict;
use warnings;

use File::Basename qw(basename);
use File::Spec;
use FindBin qw($Bin);

my $command = basename($0);
my $core = File::Spec->catfile( $Bin, '_dashboard-core' );
exec { $^X } $^X, $core, $command, @ARGV;
die "Unable to exec $core for $command: $!";

__END__

=pod

=head1 NAME

collector - private built-in command wrapper for Developer Dashboard

=head1 SYNOPSIS

  dashboard collector ...

=head1 DESCRIPTION

This private helper is staged under F<~/.developer-dashboard/cli/dd/> so the
public C<dashboard> entrypoint can stay a thin switchboard.

=for comment FULL-POD-DOC START

=head1 PURPOSE

This staged helper exposes the collector lifecycle command family: run, start, stop, restart, status, output, inspect, list, and job/result maintenance. It is the CLI surface for the collector store and runner modules.

=head1 WHY IT EXISTS

It exists because collector process management is built-in dashboard behavior, but the command wrapper should stay staged and thin while the collector modules own execution and persistence rules.

=head1 WHEN TO USE

Use this file when changing collector CLI verbs, argument parsing, or how collector commands are handed off into the runtime manager and collector subsystems.

=head1 HOW TO USE

Users run C<dashboard collector E<lt>verbE<gt> ...>. The staged helper passes the request into the private runtime, which loads the collector store and runner and prints the resulting state or output.

=head1 WHAT USES IT

It is used by developers inspecting collector health, by restart/stop flows that coordinate collectors with the web process, and by collector lifecycle tests.

=head1 EXAMPLES

Example 1:

  dashboard collector run sample-collector

Run the public built-in command path that stages or re-enters this helper.

Example 2:

  ~/.developer-dashboard/cli/dd/collector --help

Inspect the staged helper directly after C<dashboard init> or helper extraction has populated the home runtime.

Example 3:

  prove -lv t/05-cli-smoke.t t/30-dashboard-loader.t

Rerun the focused staged-helper and thin-loader tests after changing helper dispatch behavior.

Example 4:

  prove -lr t

Verify that the helper still behaves correctly inside the complete repository suite.


=for comment FULL-POD-DOC END

=cut
