{"version":3,"file":"help.mjs","names":[],"sources":["../../src/output/help.ts"],"sourcesContent":["import type { StandardJSONSchemaV1 } from '@standard-schema/spec';\nimport { extractSchemaMetadata, getJsonSchema, type PadroneArgsSchemaMeta, parsePositionalConfig } from '../core/args.ts';\nimport { findCommandByName } from '../core/commands.ts';\nimport type { AnyPadroneCommand } from '../types/index.ts';\nimport { getRootCommand } from '../util/utils.ts';\nimport type { ColorConfig, ColorTheme } from './colorizer.ts';\nimport {\n  createFormatter,\n  type HelpArgumentInfo,\n  type HelpDetail,\n  type HelpFormat,\n  type HelpInfo,\n  type HelpPositionalInfo,\n  type HelpSubcommandInfo,\n} from './formatter.ts';\n\nexport type HelpPreferences = {\n  format?: HelpFormat | 'auto';\n  detail?: HelpDetail;\n  theme?: ColorTheme | ColorConfig;\n  /** Show all global commands and flags in full detail */\n  all?: boolean;\n  /** Terminal width for text wrapping. Defaults to terminal columns or 80. */\n  width?: number;\n  /** Terminal capabilities for auto-detection of ANSI and width. */\n  terminal?: { columns?: number; isTTY?: boolean };\n  /** Environment variables for auto-detection (e.g., NO_COLOR, CI). */\n  env?: Record<string, string | undefined>;\n};\n\n/**\n * Extract positional arguments info from schema based on meta.positional config.\n */\nfunction extractPositionalArgsInfo(\n  schema: StandardJSONSchemaV1,\n  meta?: PadroneArgsSchemaMeta,\n): { args: HelpPositionalInfo[]; positionalNames: Set<string> } {\n  const args: HelpPositionalInfo[] = [];\n  const positionalNames = new Set<string>();\n\n  if (!schema || !meta?.positional || meta.positional.length === 0) {\n    return { args, positionalNames };\n  }\n\n  const positionalConfig = parsePositionalConfig(meta.positional);\n\n  try {\n    const jsonSchema = getJsonSchema(schema) as Record<string, any>;\n\n    if (jsonSchema.type === 'object' && jsonSchema.properties) {\n      const properties = jsonSchema.properties as Record<string, any>;\n      const required = (jsonSchema.required as string[]) || [];\n\n      for (const { name, variadic } of positionalConfig) {\n        const prop = properties[name];\n        if (!prop) continue;\n\n        positionalNames.add(name);\n        const optMeta = meta.fields?.[name];\n\n        args.push({\n          name: variadic ? `...${name}` : name,\n          description: optMeta?.description ?? prop.description,\n          optional: !required.includes(name),\n          default: prop.default,\n          type: variadic ? `array<${prop.items?.type || 'string'}>` : prop.type,\n          enum: (prop.enum ?? prop.items?.enum) as string[] | undefined,\n        });\n      }\n    }\n  } catch {\n    // Fallback to empty result if toJSONSchema fails\n  }\n\n  return { args, positionalNames };\n}\n\nfunction extractArgsInfo(schema: StandardJSONSchemaV1, meta?: PadroneArgsSchemaMeta, positionalNames?: Set<string>) {\n  const result: HelpArgumentInfo[] = [];\n  if (!schema) return result;\n\n  const vendor = schema['~standard'].vendor;\n  if (!vendor.includes('zod')) return result;\n\n  const argsMeta = meta?.fields;\n\n  try {\n    const jsonSchema = getJsonSchema(schema) as Record<string, any>;\n\n    // Handle object: z.object({ key: z.string(), ... })\n    if (jsonSchema.type === 'object' && jsonSchema.properties) {\n      const properties = jsonSchema.properties as Record<string, any>;\n      const required = (jsonSchema.required as string[]) || [];\n      const propertyNames = new Set(Object.keys(properties));\n\n      // Helper to check if a negated version of an arg exists\n      const hasExplicitNegation = (key: string): boolean => {\n        // Check for noVerbose style (camelCase)\n        const camelNegated = `no${key.charAt(0).toUpperCase()}${key.slice(1)}`;\n        if (propertyNames.has(camelNegated)) return true;\n        // Check for no-verbose style (kebab-case, though rare in JS)\n        const kebabNegated = `no-${key}`;\n        if (propertyNames.has(kebabNegated)) return true;\n        return false;\n      };\n\n      // Helper to check if this arg is itself a negation of another arg\n      const isNegationOf = (key: string): boolean => {\n        // Check for noVerbose -> verbose (camelCase)\n        if (key.startsWith('no') && key.length > 2 && key[2] === key[2]?.toUpperCase()) {\n          const positiveKey = key.charAt(2).toLowerCase() + key.slice(3);\n          if (propertyNames.has(positiveKey)) return true;\n        }\n        // Check for no-verbose -> verbose (kebab-case)\n        if (key.startsWith('no-')) {\n          const positiveKey = key.slice(3);\n          if (propertyNames.has(positiveKey)) return true;\n        }\n        return false;\n      };\n\n      for (const [key, prop] of Object.entries(properties)) {\n        // Skip positional arguments - they are shown in arguments section\n        if (positionalNames?.has(key)) continue;\n\n        const isOptional = !required.includes(key);\n        const enumValues = (prop.enum ?? prop.items?.enum) as string[] | undefined;\n        const optMeta = argsMeta?.[key];\n        const propType = prop.type as string;\n\n        // Resolve custom negative keywords from meta or schema\n        const rawNegative = optMeta?.negative ?? prop?.negative;\n        const hasCustomNegative = rawNegative !== undefined;\n        const negativeList = hasCustomNegative\n          ? typeof rawNegative === 'string'\n            ? rawNegative\n              ? [rawNegative]\n              : []\n            : Array.from(rawNegative as readonly string[]).filter(Boolean)\n          : undefined;\n\n        // Booleans are negatable unless there's an explicit noArg property,\n        // this arg is itself a negation of another arg, or custom negative keywords are set\n        const isNegatable = propType === 'boolean' && !hasCustomNegative && !hasExplicitNegation(key) && !isNegationOf(key);\n\n        result.push({\n          name: key,\n          description: optMeta?.description ?? prop.description,\n          optional: isOptional,\n          default: prop.default,\n          type: propType === 'array' ? `${prop.items?.type || 'string'}[]` : propType,\n          enum: enumValues,\n          deprecated: optMeta?.deprecated ?? prop?.deprecated,\n          hidden: optMeta?.hidden ?? prop?.hidden,\n          examples: optMeta?.examples ?? prop?.examples,\n          variadic: propType === 'array',\n          negatable: isNegatable,\n          negative: negativeList?.length ? negativeList : undefined,\n          group: optMeta?.group,\n        });\n      }\n    }\n  } catch {\n    // Fallback to empty result if toJSONSchema fails\n  }\n\n  return result;\n}\n\n// ============================================================================\n// Core Help Info Builder\n// ============================================================================\n\n/**\n * Builds a comprehensive HelpInfo structure from a command.\n * This is the single source of truth that all formatters use.\n * @param cmd - The command to build help info for\n * @param detail - The level of detail ('minimal', 'standard', or 'full')\n */\nexport function getHelpInfo(cmd: AnyPadroneCommand, detail: HelpPreferences['detail'] = 'standard', all?: boolean): HelpInfo {\n  const rootCmd = getRootCommand(cmd);\n  // A command is a \"default\" command if its name is '' or it has '' as an alias\n  const isDefaultCommand = cmd.parent && (!cmd.name || cmd.aliases?.includes(''));\n  // For commands with empty name, use the first non-empty alias as display name\n  const nonEmptyAliases = cmd.aliases?.filter(Boolean);\n  const commandName = cmd.path || cmd.name || nonEmptyAliases?.[0] || (cmd.parent ? '[default]' : 'program');\n  // Build display aliases: real aliases (excluding the one promoted to display name) + [default] marker\n  const remainingAliases = !cmd.name && nonEmptyAliases?.length ? nonEmptyAliases.slice(1) : (nonEmptyAliases ?? []);\n  const displayAliases = isDefaultCommand ? [...remainingAliases, '[default]'] : nonEmptyAliases;\n\n  // Extract positional args from schema based on meta.positional\n  const { args: positionalArgs, positionalNames } = cmd.argsSchema\n    ? extractPositionalArgsInfo(cmd.argsSchema, cmd.meta)\n    : { args: [], positionalNames: new Set<string>() };\n\n  const hasPositionals = positionalArgs.length > 0;\n\n  const helpInfo: HelpInfo = {\n    name: commandName,\n    title: cmd.title,\n    description: cmd.description,\n    examples: cmd.examples,\n    aliases: displayAliases,\n    deprecated: cmd.deprecated,\n    hidden: cmd.hidden,\n    usage: {\n      command: rootCmd === cmd ? commandName : `${rootCmd.name} ${commandName}`,\n      hasSubcommands: !!(cmd.commands && cmd.commands.length > 0),\n      hasPositionals,\n      hasArguments: false, // updated below after extracting arguments\n      stdinField: cmd.meta?.stdin,\n    },\n  };\n\n  // Build subcommands info (filter out hidden commands unless showing full detail)\n  if (cmd.commands && cmd.commands.length > 0) {\n    const visibleCommands = detail === 'full' ? cmd.commands : cmd.commands.filter((c) => !c.hidden);\n    // If the command has both a handler and subcommands, show the handler as a \"[default]\" entry\n    const selfEntry: typeof helpInfo.subcommands = cmd.action\n      ? [{ name: '[default]', title: cmd.title, description: cmd.description }]\n      : [];\n\n    helpInfo.subcommands = [\n      ...selfEntry,\n      ...visibleCommands.flatMap((c): HelpSubcommandInfo[] => {\n        const isDefault = !c.name || c.aliases?.includes('');\n        const nonEmptyAliases = c.aliases?.filter(Boolean);\n        const displayName = c.name || nonEmptyAliases?.[0] || '[default]';\n        const remainingAliases = !c.name && nonEmptyAliases?.length ? nonEmptyAliases.slice(1) : (nonEmptyAliases ?? []);\n        // Only add [default] alias marker if it's not already the display name\n        const displayAliases =\n          isDefault && displayName !== '[default]' ? [...remainingAliases, '[default]'] : isDefault ? remainingAliases : nonEmptyAliases;\n        const hasSubcommands = !!(c.commands && c.commands.length > 0);\n\n        // If a command has subcommands AND a default handler (direct or '' subcommand),\n        // show two entries: one for the default action, one for the subcommand router\n        const hasDefaultHandler = c.action || c.commands?.some((sub) => !sub.name || sub.aliases?.includes(''));\n        if (hasSubcommands && hasDefaultHandler) {\n          const defaultSub = !c.action ? c.commands?.find((sub) => !sub.name || sub.aliases?.includes('')) : undefined;\n          const hasDefaultSubInfo = defaultSub && (defaultSub.title || defaultSub.description);\n          return [\n            {\n              name: displayName,\n              title: hasDefaultSubInfo ? defaultSub.title : c.title,\n              description: hasDefaultSubInfo ? defaultSub.description : c.description,\n              aliases: displayAliases?.length ? displayAliases : undefined,\n              deprecated: c.deprecated,\n              hidden: c.hidden,\n              group: c.group,\n            },\n            {\n              name: displayName,\n              title: c.title,\n              description: c.description,\n              deprecated: c.deprecated,\n              hidden: c.hidden,\n              hasSubcommands: true,\n              group: c.group,\n            },\n          ];\n        }\n\n        return [\n          {\n            name: displayName,\n            title: c.title,\n            description: c.description,\n            aliases: displayAliases?.length ? displayAliases : undefined,\n            deprecated: c.deprecated,\n            hidden: c.hidden,\n            hasSubcommands,\n            group: c.group,\n          },\n        ];\n      }),\n    ];\n\n    // In 'full' detail mode, recursively build help for all nested commands\n    if (detail === 'full') {\n      helpInfo.nestedCommands = visibleCommands.map((c) => getHelpInfo(c, 'full'));\n    }\n  }\n\n  // Build arguments info from positionals\n  if (hasPositionals) {\n    helpInfo.positionals = positionalArgs;\n  }\n\n  // Build arguments info with aliases (excluding positional args)\n  if (cmd.argsSchema) {\n    const argsInfo = extractArgsInfo(cmd.argsSchema, cmd.meta, positionalNames);\n    const argMap: Record<string, HelpArgumentInfo> = Object.fromEntries(argsInfo.map((arg) => [arg.name, arg]));\n\n    // Merge flags and aliases into arguments\n    const { flags, aliases } = extractSchemaMetadata(cmd.argsSchema, cmd.meta?.fields, cmd.meta?.autoAlias);\n    for (const [flag, name] of Object.entries(flags)) {\n      const arg = argMap[name];\n      if (!arg) continue;\n      arg.flags = [...(arg.flags || []), flag];\n    }\n    for (const [alias, name] of Object.entries(aliases)) {\n      const arg = argMap[name];\n      if (!arg) continue;\n      arg.aliases = [...(arg.aliases || []), alias];\n    }\n\n    // Filter out hidden arguments\n    const visibleArgs = argsInfo.filter((arg) => !arg.hidden);\n    if (visibleArgs.length > 0) {\n      helpInfo.arguments = visibleArgs;\n      helpInfo.usage.hasArguments = true;\n    }\n  }\n\n  // Add global commands/flags (root command by default, all commands when --all is passed)\n  if (!cmd.parent || all) {\n    const builtins: HelpInfo['builtins'] = [];\n\n    if (!findCommandByName('help', rootCmd.commands)) {\n      builtins.push({\n        name: 'help [command], -h, --help',\n        description: 'Show help for a command',\n        sub: [\n          { name: '--all', description: 'Show all global commands and flags' },\n          { name: '--detail <level>', description: 'Detail level (minimal, standard, full)' },\n          { name: '--format <format>', description: 'Output format (text, ansi, json, markdown, html)' },\n        ],\n      });\n    }\n\n    if (!findCommandByName('version', rootCmd.commands)) {\n      builtins.push({\n        name: 'version, -v, --version',\n        description: 'Show version information',\n      });\n    }\n\n    if (!findCommandByName('completion', rootCmd.commands)) {\n      builtins.push({\n        name: 'completion [shell]',\n        description: 'Generate shell completions (bash, zsh, fish, powershell)',\n      });\n    }\n\n    if (!findCommandByName('man', rootCmd.commands)) {\n      builtins.push({\n        name: 'man',\n        description: 'Show or install man pages (--setup to install, --remove to uninstall) (experimental)',\n      });\n    }\n\n    builtins.push({\n      name: '[command] --repl',\n      description: 'Start interactive REPL scoped to a command',\n    });\n\n    if (!findCommandByName('mcp', rootCmd.commands)) {\n      builtins.push({\n        name: 'mcp [http|stdio]',\n        description: 'Start a Model Context Protocol server to expose commands as AI tools (experimental)',\n        sub: [\n          { name: '--port <port>', description: 'HTTP port (default: 3000)' },\n          { name: '--host <host>', description: 'HTTP host (default: 127.0.0.1)' },\n        ],\n      });\n    }\n\n    builtins.push({\n      name: '--color [theme], --no-color',\n      description: 'Set color theme (default, ocean, warm, monochrome) or disable colors',\n    });\n\n    if (builtins.length > 0) {\n      helpInfo.builtins = builtins;\n    }\n  }\n\n  return helpInfo;\n}\n\n// ============================================================================\n// Main Entry Point\n// ============================================================================\n\nexport function generateHelp(rootCommand: AnyPadroneCommand, commandObj: AnyPadroneCommand = rootCommand, prefs?: HelpPreferences): string {\n  const helpInfo = getHelpInfo(commandObj, prefs?.detail, prefs?.all);\n  const formatter = createFormatter(\n    prefs?.format ?? 'auto',\n    prefs?.detail,\n    prefs?.theme,\n    prefs?.all,\n    prefs?.width,\n    prefs?.terminal,\n    prefs?.env,\n  );\n  return formatter.format(helpInfo);\n}\n"],"mappings":";;;;;;;;AAiCA,SAAS,0BACP,QACA,MAC8D;CAC9D,MAAM,OAA6B,CAAC;CACpC,MAAM,kCAAkB,IAAI,IAAY;CAExC,IAAI,CAAC,UAAU,CAAC,MAAM,cAAc,KAAK,WAAW,WAAW,GAC7D,OAAO;EAAE;EAAM;CAAgB;CAGjC,MAAM,mBAAmB,sBAAsB,KAAK,UAAU;CAE9D,IAAI;EACF,MAAM,aAAa,cAAc,MAAM;EAEvC,IAAI,WAAW,SAAS,YAAY,WAAW,YAAY;GACzD,MAAM,aAAa,WAAW;GAC9B,MAAM,WAAY,WAAW,YAAyB,CAAC;GAEvD,KAAK,MAAM,EAAE,MAAM,cAAc,kBAAkB;IACjD,MAAM,OAAO,WAAW;IACxB,IAAI,CAAC,MAAM;IAEX,gBAAgB,IAAI,IAAI;IACxB,MAAM,UAAU,KAAK,SAAS;IAE9B,KAAK,KAAK;KACR,MAAM,WAAW,MAAM,SAAS;KAChC,aAAa,SAAS,eAAe,KAAK;KAC1C,UAAU,CAAC,SAAS,SAAS,IAAI;KACjC,SAAS,KAAK;KACd,MAAM,WAAW,SAAS,KAAK,OAAO,QAAQ,SAAS,KAAK,KAAK;KACjE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