From 8b4df4c4a61618de1f87d9e784e83c6d0a160951 Mon Sep 17 00:00:00 2001 From: hawkff <109485367+hawkff@users.noreply.github.com> Date: Thu, 15 Oct 2026 16:22:21 -0400 Subject: [PATCH] Update Pi compatibility for 0.2.0 --- README.md | 8 +- package.json | 8 +- pnpm-lock.yaml | 345 +++++------------------------------------- src/catalog.ts | 1 + test/provider.test.ts | 64 +++++++- 5 files changed, 102 insertions(+), 324 deletions(-) diff --git a/README.md b/README.md index 1b2f22c..b52bfd6 100644 --- a/README.md +++ b/README.md @@ -27,15 +27,15 @@ Chat uses Pi's native API adapters and model metadata, with availability from yo ## Install -The extension targets Pi 1.1.0 and CLIProxyAPI 8.0.22, with Node.js 22.19 or newer. Run CLIProxyAPI with your upstream accounts configured before connecting Pi. The extension uses Pi's host-provided packages, adds no runtime dependencies, and needs no compilation. +The extension targets Pi 1.3.0 and CLIProxyAPI 8.0.30, with Node.js 22.19 or newer. Run CLIProxyAPI with your upstream accounts configured before connecting Pi. The extension uses Pi's host-provided packages, adds no runtime dependencies, and needs no compilation. If you installed `pi-cliproxy-native`, remove it before installing the renamed package. Both register the same `cliproxyapi` provider. ```sh -pi install npm:pi-cliproxyapi-native@0.1.9 +pi install npm:pi-cliproxyapi-native@0.2.0 ``` -For Git installation, use `pi install git:github.com/hawkff/pi-cliproxyapi-native@v0.1.9`. For a local checkout, use `pi install /path/to/pi-cliproxyapi-native`. +For Git installation, use `pi install git:github.com/hawkff/pi-cliproxyapi-native@v0.2.0`. For a local checkout, use `pi install /path/to/pi-cliproxyapi-native`. The default proxy address is `http://localhost:8317`. For another address, set the [connection](#connection) before logging in. Restart Pi, then run: @@ -252,6 +252,8 @@ The recognized prefixes are `vertex/`, `antigravity/`, `api/`, and `oauth/`. Eac For Antigravity IDs `claude-opus-5-5-high` and `claude-sonnet-5-5-high`, the extension falls back to `anthropic/claude-opus-5-5` and `anthropic/claude-sonnet-5-5` metadata. This applies to bare IDs and the recognized route prefixes. Explicit aliases take precedence, followed by exact native metadata. The fallback requires the corresponding canonical entry in Pi and names the model like a configured alias, for example `claude-opus-5-5-high (Claude Opus 5.5)`; requests keep the advertised `-high` ID. +The same fallback rules map `gemini-4-argon-high` to `google/gemini-4-argon`, including recognized route prefixes. + Use Pi's `models.json` `modelOverrides` for limits, prices, or compatibility changes. Use its `models` array for IDs with no built-in metadata. Updating Pi supplies newer metadata. Catalog prices are estimates, not the proxy's bill; check upstream limits before increasing them. ## Backend routes diff --git a/package.json b/package.json index 9580740..7b28214 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pi-cliproxyapi-native", - "version": "0.1.9", + "version": "0.2.0", "description": "CLIProxyAPI chat discovery and image/video generation with Pi's native adapters", "publishConfig": { "access": "public" @@ -39,9 +39,9 @@ }, "devDependencies": { "@biomejs/biome": "^2.5.13", - "@earendil-works/pi-ai": "^1.1.0", - "@earendil-works/pi-coding-agent": "^1.1.0", - "@earendil-works/pi-tui": "^1.1.0", + "@earendil-works/pi-ai": "^1.3.0", + "@earendil-works/pi-coding-agent": "^1.3.0", + "@earendil-works/pi-tui": "^1.3.0", "@types/node": "^24.13.4", "typescript": "5.9.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d681f51..279c531 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,14 +12,14 @@ importers: specifier: ^2.5.13 version: 2.5.13 '@earendil-works/pi-ai': - specifier: ^1.1.0 - version: 1.1.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3) + specifier: ^1.3.0 + version: 1.3.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3) '@earendil-works/pi-coding-agent': - specifier: ^1.1.0 - version: 1.1.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(ws@8.21.3) + specifier: ^1.3.0 + version: 1.3.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(ws@8.21.3) '@earendil-works/pi-tui': - specifier: ^1.1.0 - version: 1.1.0 + specifier: ^1.3.0 + version: 1.3.0 '@types/node': specifier: ^24.13.4 version: 24.13.4 @@ -179,196 +179,36 @@ packages: cpu: [x64] os: [win32] - '@earendil-works/chord@1.1.0': - resolution: {integrity: sha512-gsHzKfyQ3t0ZIQ3cLBjJ5Vqy1TYnFyruHIV3g3BwmulCDYe5BW4yT9vaJk9QzN6YANILIO75uzuq+Gdxtzz1og==} + '@earendil-works/pi-agent-core@1.3.0': + resolution: {integrity: sha512-2jvpxZs47PFD5mSQb/yK0pGHJ5yO7Nu22u9mFjHbSLRgu62vZ9rupimDSIp4arnqOadyv0AWvYHtCSpFoJV7ag==} engines: {node: '>=22.19.0'} - '@earendil-works/pi-agent-core@1.1.0': - resolution: {integrity: sha512-aX1KZomNCPmwYnXa3OivF3VYLJ+WPUkIJlEIZTgwdOZdY/+oToWTQ334WYpQeOz9POpiYFNMJLPwIhXQ4e48kg==} - engines: {node: '>=22.19.0'} - - '@earendil-works/pi-ai@1.1.0': - resolution: {integrity: sha512-1T7LAkc/5Bvc0v6w4vAGVdCrli0o/E0pEmYKTnixu95vSFArBjvbhS/G4ZwI0RUePgf0Imcu0VyqlM4EcXxqfw==} + '@earendil-works/pi-ai@1.3.0': + resolution: {integrity: sha512-KaBI8x7q7sPoFUXICNGD9efHzDG+oRNwVvkA9jdIsSQWH1RjFssOlEGsbLtewUPPgCrvmz0l2KTgSLXTyj3acw==} engines: {node: '>=22.19.0'} hasBin: true - '@earendil-works/pi-codemode@1.1.0': - resolution: {integrity: sha512-8Asc2AzhoNaXS1snmRFa96OhcWIlFM5k1Kuiz6p2DvIYgi5QHQccRAmDVY9oO92TzWrizpvQpconZGQ7JhlI7Q==} + '@earendil-works/pi-codemode@1.3.0': + resolution: {integrity: sha512-2G9tmbsPhgzwfz7cmzJpbLSLqOx3eu22Gbzm+Wc3HqeZMjLQS4F3KfAabozVhv7uEjq3k2O1dZTHmhhWr2xbfQ==} engines: {node: '>=22.19.0'} - '@earendil-works/pi-coding-agent@1.1.0': - resolution: {integrity: sha512-SeEi/4hdcHNgA9UWlefZl7ZZpm3dzi2OoxNjDHsBJ9o298LNOtbL4DGKgitlEj6uCTccvtw6f2hlCkTPVJ2RXg==} + '@earendil-works/pi-coding-agent@1.3.0': + resolution: {integrity: sha512-V/WoCjA2hQSe3QLWIUB24cTRdtEdeLiIzkDqU5RMXV6VWuD+KGZnzVBMhglwdnQTySkehZsjt8a3g6Jd2g4nnw==} engines: {node: '>=22.19.0'} hasBin: true - '@earendil-works/pi-mcp@1.1.0': - resolution: {integrity: sha512-xGKwvu3SvVTeoIx8Z7UGoJprB4VK20wKORMhufcWGx61fIauhu3J+UqfB5eeoF1oE/geYBA598K6nh1SdABQkg==} + '@earendil-works/pi-mcp@1.3.0': + resolution: {integrity: sha512-lbktLplmdGamM2t460Q0ziNEfpUEHDTVNf79g/AialJ3XZ+SHgNqa/OJXRR+fU+GV/l+gBhRPcyP8XkQlv8Avw==} engines: {node: '>=22.19.0'} - '@earendil-works/pi-telemetry@1.1.0': - resolution: {integrity: sha512-8gAK05/2pPozZZz6hCLOi8x2vsqzvsmO9gG92kbvuvTPm0qMHaFlaXX98ndXsrOi5pmzha7vNLguuG4+0Rgxjw==} + '@earendil-works/pi-telemetry@1.3.0': + resolution: {integrity: sha512-ERGZr+aXjNJzoUbB7ZzHVH3g5otzMHjHLs2Fyizm12By5X+gBEhod9cJXFOk13S7M8a29Am+Mq21zm73mRJFLg==} engines: {node: '>=22.19.0'} - '@earendil-works/pi-tui@1.1.0': - resolution: {integrity: sha512-v7wkS0y2ErZvZkSfemqd9RrBZJ5x6p8Ujsv7NdJj01IXJyFM0kNL6rMdcKcvTe7EVTd6ugvDB9VPZSoaBF9QxQ==} + '@earendil-works/pi-tui@1.3.0': + resolution: {integrity: sha512-AlKvEwEWyVtnuw7SVb4N/mUhlfIohyFslUNWarZVdLHHSdt3ca5EhMLwTzblBpDpaofSz+f+tAHie6CfxVrWKA==} engines: {node: '>=22.19.0'} - '@esbuild/aix-ppc64@0.28.2': - resolution: {integrity: sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [aix] - - '@esbuild/android-arm64@0.28.2': - resolution: {integrity: sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==} - engines: {node: '>=18'} - cpu: [arm64] - os: [android] - - '@esbuild/android-arm@0.28.2': - resolution: {integrity: sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==} - engines: {node: '>=18'} - cpu: [arm] - os: [android] - - '@esbuild/android-x64@0.28.2': - resolution: {integrity: sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==} - engines: {node: '>=18'} - cpu: [x64] - os: [android] - - '@esbuild/darwin-arm64@0.28.2': - resolution: {integrity: sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [darwin] - - '@esbuild/darwin-x64@0.28.2': - resolution: {integrity: sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==} - engines: {node: '>=18'} - cpu: [x64] - os: [darwin] - - '@esbuild/freebsd-arm64@0.28.2': - resolution: {integrity: sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [freebsd] - - '@esbuild/freebsd-x64@0.28.2': - resolution: {integrity: sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==} - engines: {node: '>=18'} - cpu: [x64] - os: [freebsd] - - '@esbuild/linux-arm64@0.28.2': - resolution: {integrity: sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==} - engines: {node: '>=18'} - cpu: [arm64] - os: [linux] - - '@esbuild/linux-arm@0.28.2': - resolution: {integrity: sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==} - engines: {node: '>=18'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-ia32@0.28.2': - resolution: {integrity: sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==} - engines: {node: '>=18'} - cpu: [ia32] - os: [linux] - - '@esbuild/linux-loong64@0.28.2': - resolution: {integrity: sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==} - engines: {node: '>=18'} - cpu: [loong64] - os: [linux] - - '@esbuild/linux-mips64el@0.28.2': - resolution: {integrity: sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==} - engines: {node: '>=18'} - cpu: [mips64el] - os: [linux] - - '@esbuild/linux-ppc64@0.28.2': - resolution: {integrity: sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [linux] - - '@esbuild/linux-riscv64@0.28.2': - resolution: {integrity: sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==} - engines: {node: '>=18'} - cpu: [riscv64] - os: [linux] - - '@esbuild/linux-s390x@0.28.2': - resolution: {integrity: sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==} - engines: {node: '>=18'} - cpu: [s390x] - os: [linux] - - '@esbuild/linux-x64@0.28.2': - resolution: {integrity: sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [linux] - - '@esbuild/netbsd-arm64@0.28.2': - resolution: {integrity: sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [netbsd] - - '@esbuild/netbsd-x64@0.28.2': - resolution: {integrity: sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==} - engines: {node: '>=18'} - cpu: [x64] - os: [netbsd] - - '@esbuild/openbsd-arm64@0.28.2': - resolution: {integrity: sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openbsd] - - '@esbuild/openbsd-x64@0.28.2': - resolution: {integrity: sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==} - engines: {node: '>=18'} - cpu: [x64] - os: [openbsd] - - '@esbuild/openharmony-arm64@0.28.2': - resolution: {integrity: sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openharmony] - - '@esbuild/sunos-x64@0.28.2': - resolution: {integrity: sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==} - engines: {node: '>=18'} - cpu: [x64] - os: [sunos] - - '@esbuild/win32-arm64@0.28.2': - resolution: {integrity: sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==} - engines: {node: '>=18'} - cpu: [arm64] - os: [win32] - - '@esbuild/win32-ia32@0.28.2': - resolution: {integrity: sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==} - engines: {node: '>=18'} - cpu: [ia32] - os: [win32] - - '@esbuild/win32-x64@0.28.2': - resolution: {integrity: sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==} - engines: {node: '>=18'} - cpu: [x64] - os: [win32] - '@google/genai@2.21.0': resolution: {integrity: sha512-+PDtco2/Z0ONdzCGekCoCT+O1VJS9xJQNN4XzQpXG/t3El/SWWMkCWlFRO1KmivOHPa4Q0VjUYu1HBKCZ/v33Q==} engines: {node: '>=20.0.0'} @@ -497,11 +337,6 @@ packages: ecdsa-sig-formatter@1.0.11: resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==} - esbuild@0.28.2: - resolution: {integrity: sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==} - engines: {node: '>=18'} - hasBin: true - extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -971,13 +806,9 @@ snapshots: '@biomejs/cli-win32-x64@2.5.13': optional: true - '@earendil-works/chord@1.1.0': - dependencies: - esbuild: 0.28.2 - - '@earendil-works/pi-agent-core@1.1.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3)': + '@earendil-works/pi-agent-core@1.3.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3)': dependencies: - '@earendil-works/pi-ai': 1.1.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3) + '@earendil-works/pi-ai': 1.3.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3) typebox: 1.3.27 transitivePeerDependencies: - '@aws-sdk/credential-provider-node' @@ -992,11 +823,11 @@ snapshots: - ws - zod - '@earendil-works/pi-ai@1.1.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3)': + '@earendil-works/pi-ai@1.3.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3)': dependencies: '@anthropic-ai/sdk': 0.129.0 '@aws-sdk/client-bedrock-runtime': 3.1127.0 - '@earendil-works/pi-telemetry': 1.1.0 + '@earendil-works/pi-telemetry': 1.3.0 '@google/genai': 2.21.0 '@smithy/node-http-handler': 4.12.1 http-proxy-agent: 9.1.0 @@ -1017,18 +848,17 @@ snapshots: - ws - zod - '@earendil-works/pi-codemode@1.1.0': + '@earendil-works/pi-codemode@1.3.0': dependencies: quickjs-wasi: 3.6.2 - '@earendil-works/pi-coding-agent@1.1.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(ws@8.21.3)': + '@earendil-works/pi-coding-agent@1.3.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(ws@8.21.3)': dependencies: - '@earendil-works/chord': 1.1.0 - '@earendil-works/pi-agent-core': 1.1.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3) - '@earendil-works/pi-ai': 1.1.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3) - '@earendil-works/pi-codemode': 1.1.0 - '@earendil-works/pi-mcp': 1.1.0 - '@earendil-works/pi-tui': 1.1.0 + '@earendil-works/pi-agent-core': 1.3.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3) + '@earendil-works/pi-ai': 1.3.0(@aws-sdk/credential-provider-node@3.972.83)(@smithy/signature-v4@5.7.3)(undici@8.10.2)(ws@8.21.3) + '@earendil-works/pi-codemode': 1.3.0 + '@earendil-works/pi-mcp': 1.3.0 + '@earendil-works/pi-tui': 1.3.0 '@silvia-odwyer/photon-node': 0.3.4 brace-expansion: 5.0.12 chalk: 6.0.0 @@ -1058,95 +888,17 @@ snapshots: - ws - zod - '@earendil-works/pi-mcp@1.1.0': + '@earendil-works/pi-mcp@1.3.0': dependencies: cross-spawn: 7.0.6 - '@earendil-works/pi-telemetry@1.1.0': {} + '@earendil-works/pi-telemetry@1.3.0': {} - '@earendil-works/pi-tui@1.1.0': + '@earendil-works/pi-tui@1.3.0': dependencies: get-east-asian-width: 1.6.0 marked: 18.0.11 - '@esbuild/aix-ppc64@0.28.2': - optional: true - - '@esbuild/android-arm64@0.28.2': - optional: true - - '@esbuild/android-arm@0.28.2': - optional: true - - '@esbuild/android-x64@0.28.2': - optional: true - - '@esbuild/darwin-arm64@0.28.2': - optional: true - - '@esbuild/darwin-x64@0.28.2': - optional: true - - '@esbuild/freebsd-arm64@0.28.2': - optional: true - - '@esbuild/freebsd-x64@0.28.2': - optional: true - - '@esbuild/linux-arm64@0.28.2': - optional: true - - '@esbuild/linux-arm@0.28.2': - optional: true - - '@esbuild/linux-ia32@0.28.2': - optional: true - - '@esbuild/linux-loong64@0.28.2': - optional: true - - '@esbuild/linux-mips64el@0.28.2': - optional: true - - '@esbuild/linux-ppc64@0.28.2': - optional: true - - '@esbuild/linux-riscv64@0.28.2': - optional: true - - '@esbuild/linux-s390x@0.28.2': - optional: true - - '@esbuild/linux-x64@0.28.2': - optional: true - - '@esbuild/netbsd-arm64@0.28.2': - optional: true - - '@esbuild/netbsd-x64@0.28.2': - optional: true - - '@esbuild/openbsd-arm64@0.28.2': - optional: true - - '@esbuild/openbsd-x64@0.28.2': - optional: true - - '@esbuild/openharmony-arm64@0.28.2': - optional: true - - '@esbuild/sunos-x64@0.28.2': - optional: true - - '@esbuild/win32-arm64@0.28.2': - optional: true - - '@esbuild/win32-ia32@0.28.2': - optional: true - - '@esbuild/win32-x64@0.28.2': - optional: true - '@google/genai@2.21.0': dependencies: google-auth-library: 10.9.1 @@ -1259,35 +1011,6 @@ snapshots: dependencies: safe-buffer: 5.2.1 - esbuild@0.28.2: - optionalDependencies: - '@esbuild/aix-ppc64': 0.28.2 - '@esbuild/android-arm': 0.28.2 - '@esbuild/android-arm64': 0.28.2 - '@esbuild/android-x64': 0.28.2 - '@esbuild/darwin-arm64': 0.28.2 - '@esbuild/darwin-x64': 0.28.2 - '@esbuild/freebsd-arm64': 0.28.2 - '@esbuild/freebsd-x64': 0.28.2 - '@esbuild/linux-arm': 0.28.2 - '@esbuild/linux-arm64': 0.28.2 - '@esbuild/linux-ia32': 0.28.2 - '@esbuild/linux-loong64': 0.28.2 - '@esbuild/linux-mips64el': 0.28.2 - '@esbuild/linux-ppc64': 0.28.2 - '@esbuild/linux-riscv64': 0.28.2 - '@esbuild/linux-s390x': 0.28.2 - '@esbuild/linux-x64': 0.28.2 - '@esbuild/netbsd-arm64': 0.28.2 - '@esbuild/netbsd-x64': 0.28.2 - '@esbuild/openbsd-arm64': 0.28.2 - '@esbuild/openbsd-x64': 0.28.2 - '@esbuild/openharmony-arm64': 0.28.2 - '@esbuild/sunos-x64': 0.28.2 - '@esbuild/win32-arm64': 0.28.2 - '@esbuild/win32-ia32': 0.28.2 - '@esbuild/win32-x64': 0.28.2 - extend@3.0.2: {} fast-sha256@1.3.0: {} diff --git a/src/catalog.ts b/src/catalog.ts index 2470e8e..5f89ac0 100644 --- a/src/catalog.ts +++ b/src/catalog.ts @@ -180,6 +180,7 @@ const owners: Readonly> = { const metadataFallbacks = new Map([ ["claude-opus-5-5-high", "anthropic/claude-opus-5-5"], ["claude-sonnet-5-5-high", "anthropic/claude-sonnet-5-5"], + ["gemini-4-argon-high", "google/gemini-4-argon"], ]); export function mapCatalog(value: unknown, config: Config, known: readonly Model[]) { diff --git a/test/provider.test.ts b/test/provider.test.ts index e2ce40c..233f240 100644 --- a/test/provider.test.ts +++ b/test/provider.test.ts @@ -235,10 +235,14 @@ test("auth prefixes keep separate entries and reuse metadata without guessing cu ); }); -test("Antigravity high IDs use exact Claude metadata fallbacks without changing advertised IDs", () => { +test("Antigravity high IDs use exact metadata fallbacks without changing advertised IDs", () => { const sources = builtinCatalog(); - for (const canonical of ["claude-opus-5-5", "claude-sonnet-5-5"]) { - const reference = sources.find((model) => model.provider === "anthropic" && model.id === canonical); + for (const [provider, canonical] of [ + ["anthropic", "claude-opus-5-5"], + ["anthropic", "claude-sonnet-5-5"], + ["google", "gemini-4-argon"], + ]) { + const reference = sources.find((model) => model.provider === provider && model.id === canonical); assert.ok(reference); const bare = `${canonical}-high`; for (const id of [ @@ -252,9 +256,9 @@ test("Antigravity high IDs use exact Claude metadata fallbacks without changing const model = mapped.models[0]; assert.equal(model.id, id); assert.equal(model.name, routedName(id, `${id} (${reference.name})`)); - assert.equal(model.api, "anthropic-messages"); - assert.equal(model.contextWindow, 1000000); - assert.equal(model.maxTokens, 128000); + assert.equal(model.api, reference.api); + assert.equal(model.contextWindow, reference.contextWindow); + assert.equal(model.maxTokens, reference.maxTokens); assert.deepEqual(model.thinkingLevelMap, reference.thinkingLevelMap); assert.deepEqual(model.cost, reference.cost); assert.deepEqual(mapCatalog(catalog, parseConfig({}), known).skipped, [id]); @@ -1585,6 +1589,53 @@ test("native Anthropic requests retain Antigravity high IDs and separate thinkin assert.deepEqual(seen, ids); }); +test("native Gemini requests retain Argon high IDs and send thinking levels instead of token budgets", async (t) => { + const bare = "gemini-4-argon-high"; + const ids = [bare, ...["antigravity", "vertex", "api", "oauth"].map((prefix) => `${prefix}/${bare}`)]; + const paths: string[] = []; + const baseUrl = await server(t, (req, res) => { + paths.push(new URL(req.url ?? "", "http://localhost").pathname); + assert.equal(req.headers.authorization, `Bearer ${key}`); + let body = ""; + req.setEncoding("utf8"); + req.on("data", (chunk) => { + body += chunk; + }); + req.on("end", () => { + const payload = JSON.parse(body); + assert.equal(payload.generationConfig.thinkingConfig.thinkingLevel, "HIGH"); + assert.equal(payload.generationConfig.thinkingConfig.thinkingBudget, undefined); + respond(res, "google-generative-ai"); + }); + }); + const config = parseConfig({ baseUrl }); + const sources = builtinCatalog(); + const provider = createCliproxyProvider(config, sources); + for (const id of ids) { + const model = mapCatalog({ data: [{ id }] }, config, sources).models[0]; + assert.ok(model); + const result = await provider + .streamSimple( + model, + normalizeContext({ messages: [{ role: "user", content: "Return ok.", timestamp: 0 }] }), + { + apiKey: key, + headers: { Authorization: `Bearer ${key}` }, + reasoning: "high", + maxRetries: 0, + signal: AbortSignal.timeout(5000), + }, + ) + .result(); + assert.equal(result.stopReason, "stop", result.errorMessage); + assert.equal(result.model, id); + } + assert.deepEqual( + paths, + ids.map((id) => `/v1beta/models/${id}:streamGenerateContent`), + ); +}); + test("native OpenAI adapters forward effective thinking-level sampling defaults and request overrides", async (t) => { for (const fixture of [known[1], known[2], known[4]]) { await t.test(fixture.api, async (t) => { @@ -1934,6 +1985,7 @@ test("qualified Gemini adapters retain thinking, tool IDs, strict sampling, imag const ids = [ "gemini-2.5-flash", "gemini-3.1-pro-preview", + "gemini-4-argon", "gemini-flash-latest", "gemini-flash-lite-latest", ];