Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jackwener/OpenCLI
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.5.4
Choose a base ref
...
head repository: jackwener/OpenCLI
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.5.5
Choose a head ref
  • 5 commits
  • 16 files changed
  • 3 contributors

Commits on Mar 28, 2026

  1. fix: remove invalid state: 'normal' from chrome.windows.create() (#559

    )
    
    * fix: remove invalid `state: 'normal'` from chrome.windows.create()
    
    Chrome 146+ rejects 'normal' as an invalid value for the `state` parameter
    in chrome.windows.create(). This causes the error:
    
        Error: Invalid value for state
    
    Root cause analysis:
    - The Chrome Extensions API documentation states that `state` parameter
      only accepts 'minimized', 'maximized', and 'fullscreen' as input values
    - While WindowState enum includes 'normal', it's meant for reading window
      state, not for setting it during creation
    - Chrome 146 enforces stricter validation on the `state` parameter
    - When `state` is omitted, the window defaults to 'normal' state anyway
    
    Fix: Remove the `state: 'normal'` parameter entirely. The window will
    default to normal state without explicitly setting it.
    
    Tested: `opencli doctor` and `opencli bilibili hot` now work correctly
    on Chrome 146.0.7680.165.
    
    * build: rebuild dist after removing state: 'normal'
    
    ---------
    
    Co-authored-by: jackwener <jakevingoo@gmail.com>
    Cjy-CN and jackwener authored Mar 28, 2026
    Configuration menu
    Copy the full SHA
    f9857f8 View commit details
    Browse the repository at this point in the history
  2. 添加新浪财经行情及滚动新闻抓取 (#546)

    * 添加新浪财经行情及滚动新闻抓取
    
    * review: fix injection vuln, dead code, typos, hardcoded waits
    
    rolling-news:
    - Remove dead dateToTimestampParams function and unused CliError import
    - Fix column field name typo: clomn → column
    - Replace page.wait(5) with selector-based wait
    - Remove all commented-out code
    
    stock:
    - Fix P0 JS injection: use JSON.stringify() to safely embed args.key/market
    - Add null guard for inputEl before calling .focus()
    - waitForElement returns null instead of throwing on timeout
    - Replace page.wait(5) with selector-based wait
    - Extract MARKET_CN/HK/US as named constants
    - Throw CliError on NOT_FOUND instead of silent empty return
    
    ---------
    
    Co-authored-by: jackwener <jakevingoo@gmail.com>
    yichuanzhao99-ctrl and jackwener authored Mar 28, 2026
    Configuration menu
    Copy the full SHA
    0b15561 View commit details
    Browse the repository at this point in the history
  3. feat(sinafinance): rewrite stock as public API, no browser required (#…

    …563)
    
    * feat(sinafinance): rewrite stock as public API adapter
    
    Replace browser-based DOM scraping with direct Sina public APIs:
      suggest3.sinajs.cn — symbol search (GBK, no auth)
      hq.sinajs.cn       — real-time quote (GBK, no auth)
    
    Strategy.PUBLIC, browser: false — no Chrome or login required.
    Supports A股 (sh/sz), 港股 (hk prefix), 美股 (gb_ prefix).
    US MarketCap parsed from hq field [12]; formatted as T/B/M.
    
    * feat(exit-codes): add Unix-standard exit codes to all CliError types
    
    Introduce EXIT_CODES constant table (sysexits.h conventions) and wire
    exitCode into every CliError subclass so the process exit code reflects
    the semantic type of failure:
    
      0   success (default)
      1   generic / unexpected error
      2   argument / usage error        (ArgumentError)
     66   empty result / not found      (EmptyResultError, SelectorError)
     69   service unavailable           (BrowserConnectError, AdapterLoadError)
     77   permission / auth required    (AuthRequiredError)
     78   configuration error           (ConfigError)
    124   timeout                       (TimeoutError)
    130   Ctrl-C / SIGINT               (unchanged, tui.ts)
    
    resolveExitCode() in commanderAdapter.ts reads err.exitCode for typed
    CliErrors, and falls back to pattern-matching message text for untyped
    adapter errors (auth pattern → 77, not-found pattern → 66, else → 1).
    
    Shell scripts can now distinguish error categories:
      opencli spotify status || echo "exit $?"   # 69 if browser not running
      opencli github issues --repo x 2>/dev/null; [ $? -eq 77 ] && opencli github auth
    
    * review: regex escape sym, fix change precision, optimize suggest type param
    jackwener authored Mar 28, 2026
    Configuration menu
    Copy the full SHA
    5c655ee View commit details
    Browse the repository at this point in the history
  4. feat(exit-codes): Unix-standard process exit codes for all error types (

    #564)
    
    * feat(exit-codes): add Unix-standard exit codes to all CliError types
    
    Introduce EXIT_CODES constant table (sysexits.h conventions) and wire
    exitCode into every CliError subclass so the process exit code reflects
    the semantic type of failure:
    
      0   success (default)
      1   generic / unexpected error
      2   argument / usage error        (ArgumentError)
     66   empty result / not found      (EmptyResultError, SelectorError)
     69   service unavailable           (BrowserConnectError, AdapterLoadError)
     77   permission / auth required    (AuthRequiredError)
     78   configuration error           (ConfigError)
    124   timeout                       (TimeoutError)
    130   Ctrl-C / SIGINT               (unchanged, tui.ts)
    
    resolveExitCode() in commanderAdapter.ts reads err.exitCode for typed
    CliErrors, and falls back to pattern-matching message text for untyped
    adapter errors (auth pattern → 77, not-found pattern → 66, else → 1).
    
    Shell scripts can now distinguish error categories:
      opencli spotify status || echo "exit $?"   # 69 if browser not running
      opencli github issues --repo x 2>/dev/null; [ $? -eq 77 ] && opencli github auth
    
    * fix(exit-codes): address review findings
    
    - TIMEOUT: change from 124 → 75 (EX_TEMPFAIL); 124 is bash timeout(1)'s
      own exit code, creating ambiguity when shell runs `timeout 30 opencli`
    - SelectorError: change from EMPTY_RESULT(66) → GENERIC_ERROR(1); a
      missing DOM selector is an adapter bug, not a user "no data" condition
    - normalizeArgValue: throw ArgumentError instead of bare CliError so
      invalid bool args correctly exit with USAGE_ERROR(2) not GENERIC_ERROR(1)
    - resolveExitCode: explicitly map 'http' classification to GENERIC_ERROR
      to keep exit-code path in sync with the render path
    - tui.ts: replace hardcoded process.exit(130) with EXIT_CODES.INTERRUPTED
    
    * feat(exit-codes): replace all hardcoded exit numbers with EXIT_CODES constants
    
    Extend the exit code system to cover every process exit point in the codebase.
    No magic numbers remain — all exit codes are now referenced by name.
    
    Semantic upgrades beyond pure renaming:
    - plugin update missing args  → USAGE_ERROR (2) instead of 1
    - plugin update conflicting   → USAGE_ERROR (2) instead of 1
    - opencli install <unknown>   → USAGE_ERROR (2) instead of 1
    - unknown command fallback    → USAGE_ERROR (2) instead of 1
    - record with no candidates   → EMPTY_RESULT (66) instead of 1
    - external CLI install fail   → SERVICE_UNAVAIL (69) instead of 1
    - daemon EADDRINUSE           → SERVICE_UNAVAIL (69) instead of 1
    
    Files touched: cli.ts, external.ts, daemon.ts, main.ts,
                   clis/antigravity/serve.ts
    jackwener authored Mar 28, 2026
    Configuration menu
    Copy the full SHA
    ab0af2d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    812f27a View commit details
    Browse the repository at this point in the history
Loading