ShellPilot.psd1

#
# Module manifest for module 'ShellPilot'
#
# Generated by: raandree
#
# Generated on: 6/6/2026
#

@{

# Script module or binary module file associated with this manifest.
RootModule = 'ShellPilot.psm1'

# Version number of this module.
ModuleVersion = '0.4.0'

# Supported PSEditions
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
GUID = 'd2a14b3e-8f6e-4a07-9c2d-1e5a6e3b9c01'

# Author of this module
Author = 'raandree'

# Company or vendor of this module
CompanyName = 'raandree'

# Copyright statement for this module
Copyright = '(c) raandree. All rights reserved.'

# Description of the functionality provided by this module
Description = 'GitHub Copilot in your PowerShell terminal: device-flow auth, model listing, chat and agentic tool-calling with usage and cost.'

# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '7.0'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @()

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @('ShellPilot.Format.ps1xml')

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @('Clear-ShpChat','Clear-ShpContext','Clear-ShpUsage','ConvertTo-ShpTokenCount','Get-ShpChat','Get-ShpContext','Get-ShpCosineSimilarity','Get-ShpCostEstimate','Get-ShpDefault','Get-ShpModel','Get-ShpModelName','Get-ShpTool','Get-ShpUsage','Initialize-Shp','Invoke-Shp','Register-ShpTool','Request-ShpEmbedding','Resolve-ShpError','Select-ShpModel','Set-ShpContext','Start-ShpChat','Unregister-ShpTool')

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()

# Variables to export from this module
VariablesToExport = @()

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = @()

# DSC resources to export from this module
DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

    PSData = @{

        # Tags applied to this module. These help with module discovery in online galleries.
        Tags = @('GitHubCopilot', 'Copilot', 'AI', 'LLM', 'Chat', 'Agent', 'PSEdition_Core')

        # A URL to the license for this module.
        LicenseUri = 'https://github.com/raandree/ShellPilot/blob/main/LICENSE'

        # A URL to the main website for this project.
        ProjectUri = 'https://github.com/raandree/ShellPilot'

        # A URL to an icon representing this module.
        IconUri = 'https://raw.githubusercontent.com/raandree/ShellPilot/main/assets/shellpilot-icon.png'

        # ReleaseNotes of this module
        ReleaseNotes = '## [0.4.0-preview0002] - 2026-07-28

### Added

- `Resolve-ShpError` explains the last error in the session and suggests a fix.
  It takes an error record (`$Error[0]` by default, or from the pipeline), sends
  the message, exception type, category, target, failing command line and script
  stack trace to the model, and returns the usual `Invoke-Shp` result. Every
  tool is disabled unless `-EnableTools` is passed, so diagnosing an error
  cannot touch the machine.
- `Invoke-Shp` supports `ShouldProcess`. `-WhatIf` dry-runs a whole agent turn -
  the model still plans and calls tools, but `write_file`, `create_directory`,
  `run_command` and user-registered tools are skipped and told they were not
  approved - and `-Confirm` prompts before each of those calls. Default
  behaviour is unchanged.
- `Invoke-Shp -MaxBudgetUSD` stops the tool-calling loop once the turn''s
  estimated spend passes the cap, and the result carries a new `BudgetExceeded`
  flag.
- `Invoke-Shp -AppendSystemPrompt` adds inline system instructions in either
  parameter set, so a file-driven system prompt can still be topped up for a
  single call.
- `Invoke-Shp -AllowPrivateNetwork` opts the `fetch_url` tool back in to
  loopback, link-local and private addresses.
- `Start-ShpChat` gained the `/models`, `/history`, `/retry` and `/usage`
  commands. `/retry` drops the last exchange and resends the previous prompt.
- The price table supports a long-context tier. An entry may carry a
  `LongContext` block with a `Threshold` in input tokens plus its own rates, and
  the cost breakdown now reports `Tier` and `TiersUsed`.

### Fixed

- The `fetch_url` tool no longer reaches private networks. Every URL, including
  each redirect target, is checked before the request: only `http` and `https`
  are allowed, and host names must resolve to publicly routable addresses.
  Loopback, link-local (including the `169.254.169.254` cloud metadata address),
  RFC 1918, carrier-grade NAT, `0.0.0.0/8`, multicast and their IPv6 equivalents
  are refused, as are IPv4-mapped forms and names that fail to resolve.
  Redirects are followed manually, up to five hops, so a public URL can no
  longer bounce the model into the host''s own network.
- Corrected the `gpt-5.6` rates, which shipped as placeholders. `gpt-5.6-luna`
  was charged five times its real rate (now 1.00 / 0.10 / 6.00 USD per million
  input / cached-input / output tokens) and `gpt-5.6-terra` twice
  (now 2.50 / 0.25 / 15.00). `gpt-5.6-sol` was already correct.
- Cost is now calculated per round-trip instead of on the turn totals. A model''s
  long-context rate is selected by a single request''s input size, so a turn made
  of several smaller round-trips is no longer at risk of being priced as one
  oversized request, and a genuinely oversized request is no longer under-priced
  at the default rate. Added the published thresholds and long-context rates for
  `gpt-5.4`, `gpt-5.5`, `gpt-5.6-luna`, `gpt-5.6-sol`, `gpt-5.6-terra` and
  `gemini-3.1-pro`.
- Added the missing price-table entries for models the service advertises:
  `gemini-3-flash-preview`, `gemini-3.1-pro-preview`, `gemini-3.6-flash` and
  `mai-code-1-flash-picker`, which all reported empty cost and credit fields.
  Also added published rates for `claude-fable-5`, `claude-opus-4.8-fast` and
  `kimi-k2.7-code`.
- Request bodies are now serialised with a stable key order. PowerShell
  hashtables have no defined enumeration order and .NET randomises string
  hashing per process, so the same payload could serialise differently between
  runs and defeat backend prompt caching.
- `Invoke-Shp` and `Get-ShpCostEstimate` now report `CostUSD` and `Credits` for
  `claude-opus-5` and `claude-sonnet-5`. Neither model had an entry in
  `data/PriceTable.psd1`, and the price lookup matches the model id exactly, so
  every call using them returned empty cost, credit and cost-breakdown fields.
  The rates are the published ones: Opus 5 at 5.00 / 0.50 / 6.25 / 25.00 USD per
  million input / cached-input / cache-write / output tokens, and Sonnet 5 at
  its introductory 2.00 / 0.20 / 2.50 / 10.00 (the standard
  3.00 / 0.30 / 3.75 / 15.00 takes effect on 2026-09-01).

'


        # Prerelease string of this module
        Prerelease =  'preview0002'

        # Flag to indicate whether the module requires explicit user acceptance for install/update/save
        # RequireLicenseAcceptance = $false

        # External dependent modules of this module
        # ExternalModuleDependencies = @()

    } # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}