'use strict';

module.exports = {
  tool: {
    name: 'JS Eyes Build Tool',
    version: 'Version: {version}',
    allDone: 'All tasks complete!',
  },
  site: {
    header: '──── Build Site (src/ → docs/) ────',
    srcMissing: 'src/ directory not found!',
    cleaned: 'Cleaned docs/ directory',
    copied: 'src/ → docs/ copy complete',
    nojekyll: '.nojekyll created',
    done: 'Site build complete!',
  },
  chrome: {
    header: '──── Build Chrome Extension ────',
    dirMissing: 'extensions/chrome directory not found!',
    deletedOld: 'Deleted old build artifact',
    done: 'Build complete!',
    output: 'Output: {path}',
    size: 'Size: {size}',
    error: 'Build failed: {msg}',
  },
  firefox: {
    header: '──── Build Firefox Extension ────',
    dirMissing: 'extensions/firefox directory not found!',
    manifestMissing: 'extensions/firefox/manifest.json not found!',
    skipSign: 'Skipped signing (--no-sign)',
    skipNote: 'Note: Unsigned Firefox extensions can only be loaded via about:debugging',
    checkPrereqs: 'Checking signing prerequisites...',
    webextOk: 'web-ext tool installed',
    webextMissing: 'web-ext tool not installed',
    webextInstall: 'Run: npm install -g web-ext',
    signing: 'Signing Firefox extension...',
    execCmd: 'Running: {cmd}',
    signOk: 'Extension signed successfully!',
    signedFiles: 'Signed files:',
    copiedToDist: 'Copied to dist: {file}',
    signFailed: 'Signing failed: {msg}',
  },
  env: {
    foundFile: 'Found .env file: {path}',
    gettingConfig: 'Getting AMO API config...',
    fromEnv: 'API config from environment variables',
    notFound: 'API config not found',
    configHelp: 'Configure AMO API keys in .env (config.json does not store secrets to avoid leaks):',
    optEnv: 'Set in .env:',
    amoUrl: 'Get API keys at: https://addons.mozilla.org/developers/addon/api/key/',
    fileError: 'Config file format error',
  },
  bump: {
    header: '──── Sync Version ────',
    noVersion: 'Please specify a version number',
    usage: 'Usage: node packages/devtools/bin/js-eyes-dev.js bump <version>',
    example: 'Example: node packages/devtools/bin/js-eyes-dev.js bump 1.4.0',
    badFormat: 'Invalid version format: "{version}"',
    expectedFormat: 'Expected: major.minor.patch (e.g. 1.4.0)',
    current: 'Current: {version}',
    new: 'New:     {version}',
    fileMissing: 'File not found: {name}',
    updated: '{name}: {old} -> {new}',
    updateFailed: 'Failed to update {name}: {msg}',
    done: 'Version sync complete!',
  },
  pkg: {
    readError: 'Cannot read package.json',
  },
  git: {
    clean: 'Nothing to commit — working tree clean.',
    staging: 'Staging all changes ...',
    nothingStaged: 'Nothing staged to commit.',
    committing: 'Committing:',
    committed: '✓ Committed',
    branch: 'Branch',
    files: 'Files',
    message: 'Message',
    pushing: 'Pushing to',
    pushDone: '✓ Push complete.',
    pushSkipped: 'Push skipped (--no-push)',
    buildSkipped: 'Build skipped (--no-build)',
    cleanAfterBuild: 'Nothing to commit — all clean after build.',
    stepBuild: 'Build',
    stepStage: 'Stage',
    stepCommit: 'Commit',
    stepPush: 'Push',
  },
  ghPages: {
    header: '──── GitHub Pages Custom Domain Setup ────',
    notFound: 'Pages not configured. Please enable Pages in repo Settings → Pages first.',
    creating: 'Pages not enabled. Creating via API...',
    created: 'Pages enabled ({branch}{path})',
    createFailed: 'API create Pages failed (404). Check token: Fine-grained needs Pages Read and write; Classic needs repo. Or enable Pages manually in Settings first.',
    settingDomain: 'Setting custom domain: {domain} ...',
    waitVerify: 'Custom domain set. Waiting for DNS verification...',
    pollStatus: '  [{i}/{max}] Domain state: {state}, cert: {cert}',
    timeout: 'Domain verification timed out. Enable HTTPS manually in repo later.',
    enableHttps: 'Domain verified. Enabling HTTPS enforcement...',
    httpsDone: 'HTTPS enforcement enabled.',
  },
  cf: {
    header: '──── Cloudflare DNS Setup ({domain}) ────',
    zoneNotFound: 'Zone not found. Creating...',
    zoneFound: 'Found Zone: {domain}',
    zoneCreated: 'Created Zone: {name}, ID: {id}',
    nsHint: 'Update NS records at your registrar to: {ns}',
    dnsAdded: 'Added DNS: {name} {type} -> {content}',
    dnsUpdated: 'Updated DNS: {name} {type} -> {content}',
    done: 'Done. DNS propagation may take a few minutes.',
    ghPagesHint: 'Ensure GitHub Pages has custom domain set: {domain}',
  },
  release: {
    ghMissing: 'GitHub CLI (gh) not found.',
    ghInstall: 'Install: https://cli.github.com/',
    tagExists: 'Tag {tag} already exists.',
    creating: 'Creating release',
    assets: 'Assets',
    done: 'Release created!',
    url: 'URL',
  },
  help: {
    usage: 'Usage: node packages/devtools/bin/js-eyes-dev.js <command> [options]',
    commands: 'Commands:',
    cmdBuildSkill: '  build skill            Build the main ClawHub skill bundle',
    cmdBuildSite: '  build site             Build site (src/ → docs/)',
    cmdBuildChrome: '  build chrome           Build Chrome extension as ZIP',
    cmdBuildFirefox: '  build firefox          Build & sign Firefox extension',
    cmdBuildAll: '  build [all]            Build everything (site + extensions)',
    cmdBump: '  bump <version>         Sync version across all manifests',
    cmdCommit: '  commit                 Stage all changes and commit',
    cmdSync: '  sync                   Build + commit + push',
    cmdRelease: '  release                Create GitHub release (requires gh)',
    cmdPublishWs: '  publish workspaces     Publish @js-eyes/* scope packages (supports --dry-run)',
    cmdSetupGhPages: '  setup-github-pages    Configure GitHub Pages custom domain (needs GITHUB_TOKEN)',
    cmdSetupCloudflare: '  setup-cloudflare     Configure Cloudflare DNS to point to GitHub Pages',
    options: 'Options:',
    optNoSign: '  --no-sign              Skip Firefox signing',
    optClean: '  --clean                Clean docs/ before site build',
    optMessage: '  --message "..."        Custom commit message',
    optNoBuild: '  --no-build             Skip build in sync',
    optNoPush: '  --no-push              Skip push in sync',
    optDraft: '  --draft                Create draft release',
    optLang: '  --lang <locale>        Set language (en-US / zh-CN)',
    optDomain: '  --domain <domain>     For setup: custom domain (e.g. js-eyes.com)',
    optRepo: '  --repo <owner/repo>   For setup-github-pages: GitHub repo',
    optTarget: '  --target <host>      For setup-cloudflare: GitHub Pages target (e.g. owner.github.io)',
    shortcuts: 'Shortcuts (npm scripts):',
    scDev: '  npm run dev                Dev server (serve src/)',
    scBuild: '  npm run build              Build everything',
    scPreview: '  npm run preview            Preview build (serve docs/)',
    scBuildChrome: '  npm run build:chrome       Build Chrome only',
    scBuildFirefox: '  npm run build:firefox      Build & sign Firefox',
    scBump: '  npm run bump -- 1.4.0      Sync version',
    unknownCmd: 'Unknown command: {cmd}',
    unknownTarget: 'Unknown build target: {target}',
    buildError: 'Build error: {msg}',
  },
};
