#!/usr/bin/env perl

use strict;
use warnings;

use FindBin qw($Bin);
use lib "$Bin/../lib";

use Developer::Dashboard::CLI::Ticket qw(run_ticket_command);

# main(@ARGV)
# Runs the ticket helper for Developer Dashboard.
# Input: command-line arguments from @ARGV.
# Output: creates or attaches to the requested tmux ticket session, then exits.
run_ticket_command( args => \@ARGV );

__END__

=pod

=head1 NAME

ticket - private tmux ticket helper for Developer Dashboard

=head1 SYNOPSIS

  dashboard ticket <ticket-ref>

=head1 DESCRIPTION

This private helper is staged under F<~/.developer-dashboard/cli/dd/> so the main
C<dashboard> command can keep ticket-session behaviour available without
installing a generic executable into the user's global PATH.

=for comment FULL-POD-DOC START

=head1 PURPOSE

This staged helper exposes C<dashboard ticket>, the command that creates or
reuses a tmux session for a ticket and then attaches the terminal to it. It is
the shell-facing entrypoint for the ticket-session workflow.

=head1 WHY IT EXISTS

It exists because ticket-session behavior is a built-in convenience feature,
but the public switchboard should stay thin while the ticket module owns tmux
session naming, environment seeding, and create-vs-attach logic.

=head1 WHEN TO USE

Use this file when changing the C<dashboard ticket> CLI contract, the staged
helper handoff, or the examples contributors use to understand explicit ticket
selection and C<TICKET_REF> fallback.

=head1 HOW TO USE

Users run C<dashboard ticket E<lt>ticket-refE<gt>> or set C<TICKET_REF> and run
C<dashboard ticket>. The staged helper forwards the request into the private
runtime, which loads C<Developer::Dashboard::CLI::Ticket>, resolves the ticket
name, seeds C<TICKET_REF>, C<B>, and C<OB> in the tmux session environment,
creates a detached C<Code1> window when the session does not exist yet, and
then attaches to that session.

=head1 WHAT USES IT

It is used by ticket-session workflows in the shell, by prompt integrations
that rely on consistent ticket environment variables, and by ticket regression
tests that verify explicit ticket selection and environment fallback.

=head1 EXAMPLES

  dashboard ticket
  dashboard ticket DD-123
  TICKET_REF=DD-123 dashboard ticket
  dashboard ticket feature-branch-42

=for comment FULL-POD-DOC END

=cut
