#!/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

encode - private built-in command wrapper for Developer Dashboard

=head1 SYNOPSIS

  dashboard encode

=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 C<dashboard encode>, the text-to-token half of the dashboard codec pair. It lets users turn bookmark or action text into the portable payload format used by transient dashboard URLs.

=head1 WHY IT EXISTS

It exists because users and tests sometimes need a token generator from the CLI, but the public switchboard should not carry the codec implementation directly.

=head1 WHEN TO USE

Use this file when changing the CLI contract for token generation or when fixing how encode requests are handed off to the codec module.

=head1 HOW TO USE

Users pipe text into C<dashboard encode> or redirect a file into it. The staged helper forwards the request to the private runtime, which compresses and base64-encodes the payload and prints the token.

=head1 WHAT USES IT

It is used by token-debugging workflows, by docs that show the encode/decode round trip, and by fuzz and coverage tests around the codec helpers.

=head1 EXAMPLES

Example 1:

  dashboard encode /app/test

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

Example 2:

  ~/.developer-dashboard/cli/dd/encode --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
