mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-11-22 13:29:19 +08:00
Merge branch 'main' into fix/tabular-mixed-tool-result-4215
This commit is contained in:
@@ -41,7 +41,7 @@ jobs:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.2.0
|
||||
uses: astral-sh/setup-uv@v10.3.0
|
||||
|
||||
- name: Export production dependency set from uv.lock
|
||||
run: |
|
||||
|
||||
+75
-85
@@ -5,53 +5,53 @@
|
||||
"": {
|
||||
"name": "headroom-docs",
|
||||
"dependencies": {
|
||||
"@radix-ui/react-slot": "1.3.3",
|
||||
"@radix-ui/react-slot": "1.5.0",
|
||||
"class-variance-authority": "0.7.1",
|
||||
"clsx": "2.1.1",
|
||||
"dotted-map": "^3.1.0",
|
||||
"fumadocs-core": "16.15.15",
|
||||
"fumadocs-mdx": "15.4.5",
|
||||
"fumadocs-twoslash": "^4.0.1",
|
||||
"fumadocs-typescript": "^5.4.1",
|
||||
"fumadocs-ui": "16.15.15",
|
||||
"fumadocs-core": "16.17.1",
|
||||
"fumadocs-mdx": "15.4.7",
|
||||
"fumadocs-twoslash": "^4.0.2",
|
||||
"fumadocs-typescript": "^5.5.1",
|
||||
"fumadocs-ui": "16.17.1",
|
||||
"lucide-react": "^1.48.0",
|
||||
"next": "^16.3.8",
|
||||
"next": "^16.4.0",
|
||||
"react": "^19.3.0",
|
||||
"react-dom": "^19.3.0",
|
||||
"recharts": "^3.10.1",
|
||||
"tailwind-merge": "^3.7.0",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ai-sdk/openai": "^4.0.79",
|
||||
"@anthropic-ai/sdk": "^0.129.0",
|
||||
"@ai-sdk/openai": "^4.0.91",
|
||||
"@anthropic-ai/sdk": "^0.133.0",
|
||||
"@tailwindcss/postcss": "^4.3.3",
|
||||
"@types/mdx": "^2.0.14",
|
||||
"@types/node": "^26.6.3",
|
||||
"@types/node": "^26.6.5",
|
||||
"@types/react": "^19.3.0",
|
||||
"@types/react-dom": "^19.3.0",
|
||||
"ai": "7.0.119",
|
||||
"openai": "^7.23.0",
|
||||
"postcss": "^8.5.28",
|
||||
"ai": "7.0.137",
|
||||
"openai": "^7.32.0",
|
||||
"postcss": "^8.5.29",
|
||||
"tailwindcss": "^4.2.2",
|
||||
"typescript": "^7.0.2",
|
||||
},
|
||||
},
|
||||
},
|
||||
"overrides": {
|
||||
"postcss": "^8.5.28",
|
||||
"postcss": "^8.5.29",
|
||||
},
|
||||
"packages": {
|
||||
"@ai-sdk/gateway": ["@ai-sdk/gateway@4.0.97", "", { "dependencies": { "@ai-sdk/provider": "4.0.19", "@ai-sdk/provider-utils": "5.0.50", "@vercel/oidc": "3.2.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-YFS9McgEDHXPwXOWlu1JCylkFyDsgPNLwH9jXgMxdiaur3k6SaIUPKCRSciQQ5LbEZOSb4JAaPYYO7B5Cvq7ow=="],
|
||||
"@ai-sdk/gateway": ["@ai-sdk/gateway@4.0.110", "", { "dependencies": { "@ai-sdk/provider": "4.0.26", "@ai-sdk/provider-utils": "5.0.58", "@vercel/oidc": "3.2.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-5IwnOR6v7KC+D9eddUqsCobXl/FbLUVb2LaQc/uyuQdpP3/n9s0YLc9zl4/W3IS/R2pjHrqUfCzEAeOu7bFLoQ=="],
|
||||
|
||||
"@ai-sdk/openai": ["@ai-sdk/openai@4.0.85", "", { "dependencies": { "@ai-sdk/provider": "4.0.23", "@ai-sdk/provider-utils": "5.0.55" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-bMdfU4LJilFiD6DR6PipbhaSwfy14Uep4cSTRgElsv9Upmv+fNddSeqkBiEfobMlaPNT6zGfMdagonFlqZEtmQ=="],
|
||||
"@ai-sdk/openai": ["@ai-sdk/openai@4.0.95", "", { "dependencies": { "@ai-sdk/provider": "4.0.28", "@ai-sdk/provider-utils": "5.0.61" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-rx8agb3u+pvDDqvrDYrXfMJVlnlwigNcdgqbwH4oGVi/UZRMNVY+SYhGNI9ynwjmiGcl6QG/QJz73e6qaGL7jg=="],
|
||||
|
||||
"@ai-sdk/provider": ["@ai-sdk/provider@4.0.23", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-TdEzgE1ndBGhDDwZcg/WZG3IeUj8Yz7/DkUG4ctMyK5HdNXTEKpjkCdwX8ayvkgluTv7yjnqCdOkB8/q1nfaNQ=="],
|
||||
"@ai-sdk/provider": ["@ai-sdk/provider@4.0.28", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-6ThcmkJQXSMlBrf6mirIjUUS04Q5/kApbYTOzd5lZfYXLa1XPpnDLxP/G96/DKc00fDIUOW9S2ls0mSzb0+l9w=="],
|
||||
|
||||
"@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@5.0.55", "", { "dependencies": { "@ai-sdk/provider": "4.0.23", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.29.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-VeY9IqwJGcHSmezQTZknaYUT3sRcaXpuIt5VWyGOlJtoc5wkpDPstXZtfa41bGUsbQwCijvN6ASbggUCeTcMkw=="],
|
||||
"@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@5.0.61", "", { "dependencies": { "@ai-sdk/provider": "4.0.28", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.29.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-Y+Z3539UXw0ctFDNepTtG23VqBQHr2A6yI2qUxvQcg75DJYgJoD2F9U2Vp5OgQjX7lxto1BLgFtKuOhzrr52vQ=="],
|
||||
|
||||
"@alloc/quick-lru": ["@alloc/quick-lru@5.2.0", "", {}, ""],
|
||||
|
||||
"@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.129.0", "", { "dependencies": { "json-schema-to-ts": "^3.1.1", "standardwebhooks": "^1.0.0" }, "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" }, "optionalPeers": ["zod"], "bin": { "anthropic-ai-sdk": "bin/cli" } }, "sha512-MH7LB20kNpGLUpPTe2OG5XvL/KhX8HUO9XyBaFjgFk6TLS4Xjt0VPIuMKywe7POKKPslX+QxSlVok9e+8kG5Nw=="],
|
||||
"@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.133.0", "", { "dependencies": { "json-schema-to-ts": "^3.1.1", "standardwebhooks": "^1.0.0" }, "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" }, "optionalPeers": ["zod"], "bin": { "anthropic-ai-sdk": "bin/cli" } }, "sha512-jlqUN8p8ESTJj+GJnA4KjzbEfF1waEoGzRT8jwytlYGFFgv+/DUQOxlYGvYw10UzhD1kwLqYzxvA3FrTB2YWuQ=="],
|
||||
|
||||
"@babel/runtime": ["@babel/runtime@7.29.2", "", {}, ""],
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
"@fuma-translate/react": ["@fuma-translate/react@1.0.2", "", { "peerDependencies": { "@types/react": "*", "react": "^19.2.0", "react-dom": "^19.2.0" } }, "sha512-uOiOtBx3nRXR8Nu1GzBf1tApgF1FErDBTHxRIAQeyQdyOoZbrNRN6H4kDCWObY4qyGeGbHydG0DHzgeUgFDMIw=="],
|
||||
|
||||
"@fumadocs/tailwind": ["@fumadocs/tailwind@0.1.2", "", { "peerDependencies": { "tailwindcss": "^4.0.0" }, "optionalPeers": ["tailwindcss"] }, "sha512-VppeXgIRXjZMgpf2qijj1hcfxyeYl1s0ok8k6N3jyjiX64M7sDwnt2zGPd6dbfDybgbBvDw6C6J1e42gB5NzsA=="],
|
||||
"@fumadocs/tailwind": ["@fumadocs/tailwind@0.1.3", "", { "peerDependencies": { "tailwindcss": "^4.0.0" }, "optionalPeers": ["tailwindcss"] }, "sha512-gDgLbTnY5b+nogCg2y/pP7GsaQS4Zt/0vftJAu07Wy7Wsb3/lwd9GwoGqccCnPElTFwMG+pPwrmHXBPexEfE8A=="],
|
||||
|
||||
"@fumari/image-size": ["@fumari/image-size@0.1.1", "", {}, "sha512-iaiV2wyzJ4mW358NX4CX3yGit+WjKYzpaQ+rldK9BjL/5jFpeV6ruWnZVq7MEyMn3Gd0DLi8g/79NZAAQaGscw=="],
|
||||
|
||||
@@ -255,7 +255,7 @@
|
||||
|
||||
"@radix-ui/react-scroll-area": ["@radix-ui/react-scroll-area@1.2.18", "", { "dependencies": { "@radix-ui/number": "1.1.3", "@radix-ui/primitive": "1.1.7", "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.2.2", "@radix-ui/react-direction": "1.1.4", "@radix-ui/react-presence": "1.1.10", "@radix-ui/react-primitive": "2.1.10", "@radix-ui/react-use-callback-ref": "1.1.4", "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Zn5Cd171wxsO3Dfg8HaW6RifTb9CYTKQJHs/G4+LN1GfmJpaQMZQyQxMprVPHpaz7QY4l9BxK2JwQuzHsXC8nA=="],
|
||||
|
||||
"@radix-ui/react-slot": ["@radix-ui/react-slot@1.3.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.5" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q=="],
|
||||
"@radix-ui/react-slot": ["@radix-ui/react-slot@1.5.0", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.5" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-tyYd9ddPXAysAbdbD9eYxgwpCSv6f3PncqVSNKQFSR5lcJVLz3cb/pANDoYrLiHBpXv7skortyUgGUWsYuPPFQ=="],
|
||||
|
||||
"@radix-ui/react-tabs": ["@radix-ui/react-tabs@1.1.21", "", { "dependencies": { "@radix-ui/primitive": "1.1.7", "@radix-ui/react-context": "1.2.2", "@radix-ui/react-direction": "1.1.4", "@radix-ui/react-id": "1.1.4", "@radix-ui/react-presence": "1.1.10", "@radix-ui/react-primitive": "2.1.10", "@radix-ui/react-roving-focus": "1.1.19", "@radix-ui/react-use-controllable-state": "1.2.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-UKxJlZid7FVtsk/WTxj4i4uSEgj2Au+KBbS7SQyTlzMhhn+86Cz3tISZdTa87bfEfcuvZezf2ZsxD4xuEKtkog=="],
|
||||
|
||||
@@ -281,19 +281,19 @@
|
||||
|
||||
"@reduxjs/toolkit": ["@reduxjs/toolkit@2.11.2", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "@standard-schema/utils": "^0.3.0", "immer": "^11.0.0", "redux": "^5.0.1", "redux-thunk": "^3.1.0", "reselect": "^5.1.0" }, "peerDependencies": { "react": "^16.9.0 || ^17.0.0 || ^18 || ^19", "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0" } }, ""],
|
||||
|
||||
"@shikijs/core": ["@shikijs/core@4.4.3", "", { "dependencies": { "@shikijs/primitive": "4.4.3", "@shikijs/types": "4.4.3", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5", "hast-util-to-html": "^9.0.5" } }, "sha512-QCR4q2ZO/ILJEuwiBMel4wdcTDb1JGwfjKTxPDF6x8ixOaluPrVqIn06C99AcRPhmYlBR56d/Fb+GN58GzExpg=="],
|
||||
"@shikijs/core": ["@shikijs/core@4.5.0", "", { "dependencies": { "@shikijs/primitive": "4.5.0", "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5", "hast-util-to-html": "^9.0.5" } }, "sha512-6CIgwq+bt2JZ3OSjb/nBkkwEf/CfpHcbam+Mg5Pllco7HAGRQ2/EFhZrrJtbyNTgKwknfVS+llsXGygiDGwJWw=="],
|
||||
|
||||
"@shikijs/engine-javascript": ["@shikijs/engine-javascript@4.4.3", "", { "dependencies": { "@shikijs/types": "4.4.3", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.6" } }, "sha512-FbOjFJp9VLdo1Wevs10BBtVxiTWwNLqZh5Gkhjgda/ioL15YOgeSl9n+6XMa3qRlPQzfhFNe641SrynFHYG0nQ=="],
|
||||
"@shikijs/engine-javascript": ["@shikijs/engine-javascript@4.5.0", "", { "dependencies": { "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.6" } }, "sha512-Ed6UdEj84LyYkwnxM5CvSMWAD+id9ExTYri0/+x41U9zrgNifPSS9lZm0JqBP0VfYI8yr8tY5nbNq9+p9R0kFA=="],
|
||||
|
||||
"@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@4.4.3", "", { "dependencies": { "@shikijs/types": "4.4.3", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-EcOQkxdxGQrc1Row/cC2c96/v1dbZqGnEVu1qTuT/MJmp6+cXCvQussowVmCv5Tqr3KuY3c7IbM6HTW3LJ1k9w=="],
|
||||
"@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@4.5.0", "", { "dependencies": { "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-dKVmbJecVdB9recl8a/CU4jdpNXyjJQrIcesIkpS70s5HS02ohpnCSpMUbotPnEUzbAcLQ+S4hwZYbkBBiTcJw=="],
|
||||
|
||||
"@shikijs/langs": ["@shikijs/langs@4.4.3", "", { "dependencies": { "@shikijs/types": "4.4.3" } }, "sha512-ePic0yfAJGOF83D5wBHK/00EjK65oahBYxFk5epgq33WRv7X9UuxLEV8PtR0szC0z8dl7INIpIodB99JRFlR+A=="],
|
||||
"@shikijs/langs": ["@shikijs/langs@4.5.0", "", { "dependencies": { "@shikijs/types": "4.5.0" } }, "sha512-wwBTqwduXSz0X4v9Qa2EWeFaYJEw1clCncWjoRNQRbVDu3SPRTRWucnouYapKj3b8Q+sk/41Vbc4B5c8nuYzLA=="],
|
||||
|
||||
"@shikijs/primitive": ["@shikijs/primitive@4.4.3", "", { "dependencies": { "@shikijs/types": "4.4.3", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-m0wBeLDQDeIxRdUmrCPdQqfuUamDwRL5isCfYbguKD6NiaKpVbsv+3J81DyIKgNW5h4WAIIr8T4EkgQrBBxvaQ=="],
|
||||
"@shikijs/primitive": ["@shikijs/primitive@4.5.0", "", { "dependencies": { "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-UM7ShlA8oz0OWxLLO8BmO9Ip6fVqdkt8yF0EH7nOCqHfrx1eEAzF0ZUVK7L+I8NEgeu1PEWSRlxaiPPeCb4iDg=="],
|
||||
|
||||
"@shikijs/themes": ["@shikijs/themes@4.4.3", "", { "dependencies": { "@shikijs/types": "4.4.3" } }, "sha512-w8UHjeUnIR965KMWJHUPXOc2mNJUnK3vpVLYLvw5IYU2mnTTJ89E24OrJDBNiJDQ0qzb0tc4l7mrIXx5cFeIyw=="],
|
||||
"@shikijs/themes": ["@shikijs/themes@4.5.0", "", { "dependencies": { "@shikijs/types": "4.5.0" } }, "sha512-zGb87H3UBbpuI4yoh5UguB1XbU+2BDU3kflM7UfZ+Cy2hWo9lBtqjSVK20gmLY6ukYl040hAypGXMgud9vul8Q=="],
|
||||
|
||||
"@shikijs/types": ["@shikijs/types@4.4.3", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-UEJxmRR++MAGR6hugn0vgVS2W/6lWAts84FFSrnlH9sP0LNol7E5+NQ792pH8liWUhyMyjhTgSUH3k7iD7tc5g=="],
|
||||
"@shikijs/types": ["@shikijs/types@4.5.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-drtPrtD8N0DENyD2cyt6Ajy+IWsiCLgMxODwLTpvH1UsN6a9jf90tNTPjqwHvA+0Lzu9e0txk8DjfqH1p9UJRw=="],
|
||||
|
||||
"@shikijs/vscode-textmate": ["@shikijs/vscode-textmate@10.0.2", "", {}, ""],
|
||||
|
||||
@@ -375,7 +375,7 @@
|
||||
|
||||
"@types/ms": ["@types/ms@2.1.0", "", {}, ""],
|
||||
|
||||
"@types/node": ["@types/node@26.6.4", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg=="],
|
||||
"@types/node": ["@types/node@26.6.5", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg=="],
|
||||
|
||||
"@types/react": ["@types/react@19.3.0", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg=="],
|
||||
|
||||
@@ -431,37 +431,37 @@
|
||||
|
||||
"@workflow/serde": ["@workflow/serde@4.1.0", "", {}, "sha512-pav4F2BoirECWR7Nf1TKt+2eETcBj7jj4cBefQ8VXQCA6NPkaKeLfj/zMgi+3zYV5ZIBT4GuUiphsj0/b9hPQQ=="],
|
||||
|
||||
"@yuku-analyzer/binding-android-arm64": ["@yuku-analyzer/binding-android-arm64@0.10.2", "", { "os": "android", "cpu": "arm64" }, "sha512-xt4Vy3RTBw1NfszBlf4A0Rr6ZjA/th2Pj9XlWFLQHW9A1qOCtxNCoIWSzn/INtnZLMB4jO2gWdEtSaHUtK73wA=="],
|
||||
"@yuku-core/binding-android-arm64": ["@yuku-core/binding-android-arm64@0.17.0", "", { "os": "android", "cpu": "arm64" }, "sha512-Uge3U7s9vdCcYb9IiIWBIQmGEttlvWkvWYb9Qu6iUNS2IhAu4/D/g4ucbEmjemkflWYGpWsKZlX+JxcacIlR+g=="],
|
||||
|
||||
"@yuku-analyzer/binding-darwin-arm64": ["@yuku-analyzer/binding-darwin-arm64@0.10.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-ftokSqvYXZxfmA/bfIbp8c1BJ8QxNax371kUOQNFyvR5hmtKqQyTqSKtMk+WaixHM3w4tKj/JdyY+ud1bGamXA=="],
|
||||
"@yuku-core/binding-darwin-arm64": ["@yuku-core/binding-darwin-arm64@0.17.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-jpWhRhfsAFUKXR/dUFoA9NgHeeIl5Yn0hmBEDt4QUEmnYuYZSDXeKQeSCazvIvfzbI0lyIkFSf5/TQeRPwiNuA=="],
|
||||
|
||||
"@yuku-analyzer/binding-darwin-x64": ["@yuku-analyzer/binding-darwin-x64@0.10.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-yUrmmhmF5R4Xmbfo8gUxJKr3YbvbLcE2JvLhDLzFJkMN29/fGm6K3dZX6YpNecfgBDnQ+VywGp8K9xjRaBFZ3Q=="],
|
||||
"@yuku-core/binding-darwin-x64": ["@yuku-core/binding-darwin-x64@0.17.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-AoWoVw8rktzCHXvpoygUu2QZ37LVlCp77p0oZ8EijCMUIaWzTMNUnkRGosEGvzXJOOpzB4wuXYVkphcV55Er+g=="],
|
||||
|
||||
"@yuku-analyzer/binding-freebsd-x64": ["@yuku-analyzer/binding-freebsd-x64@0.10.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-cy9+KvVoK5Xad3Vs5pLwAeZf3JC/1y0XJElgv1q6g7W7g/n52FRjedpYmQiJeMZdnhJiAshq7Vz/Xj3jC5Ns2Q=="],
|
||||
"@yuku-core/binding-freebsd-x64": ["@yuku-core/binding-freebsd-x64@0.17.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-CpyBhwZSzkRX6ZPt3AYVlG0TYk11cTP6rZ7Rz0Ux1BLxHgy4TmEW4UGsiKnL5FMAY/nM3HudevWmvaUVV4Qgng=="],
|
||||
|
||||
"@yuku-analyzer/binding-linux-arm-gnu": ["@yuku-analyzer/binding-linux-arm-gnu@0.10.2", "", { "os": "linux", "cpu": "arm" }, "sha512-AgVZ6VCV2XP4yHCwyv78KLV76gcu2neiEF2+RBTPQN7sqYY+bLvMxphGPmfG+9qk5Uf1PJAhZYIUnMGVbbRCZw=="],
|
||||
"@yuku-core/binding-linux-arm-gnu": ["@yuku-core/binding-linux-arm-gnu@0.17.0", "", { "os": "linux", "cpu": "arm" }, "sha512-H6SQK917PjtWpbQmqUsRAqDDToutDqoXWzLKKAFY+6PSfNnzRPLrydm6SG/GkHT91L8Z2/yJPwXzzF98t1UlbQ=="],
|
||||
|
||||
"@yuku-analyzer/binding-linux-arm-musl": ["@yuku-analyzer/binding-linux-arm-musl@0.10.2", "", { "os": "linux", "cpu": "arm" }, "sha512-5qAj2GjoSN6+HuH75+g5r40CFhWmMvH0K8VKWmPfQyOgA/LonoDMr5H5O5feJwzdnfdCytPDAh1RAf7/SSg7dg=="],
|
||||
"@yuku-core/binding-linux-arm-musl": ["@yuku-core/binding-linux-arm-musl@0.17.0", "", { "os": "linux", "cpu": "arm" }, "sha512-sAxyv9p/3+fxJgXcUsaJ+8IRQWvZ4F264Gx7Kj/VBuIQX95Ih7jP/zUZPGr2UM/3NHFnXIb74Rhyuk6WLufIrQ=="],
|
||||
|
||||
"@yuku-analyzer/binding-linux-arm64-gnu": ["@yuku-analyzer/binding-linux-arm64-gnu@0.10.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-eJvQ4Ja5oPf/HOjmBkCLYyhOHUkL7U+iMAN8sX44x8exBBpPRyqnhEgTsuU73HzxPLrGPdRhybFnAE63Omib/Q=="],
|
||||
"@yuku-core/binding-linux-arm64-gnu": ["@yuku-core/binding-linux-arm64-gnu@0.17.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-hDcx5Nt04jMwkllwZVtxiWt1qQI5gCqaFcT1JLP6Lw9eOqx1Yt8p21NuqZuqknmnW5napB3dSwF7Op+eySHdrQ=="],
|
||||
|
||||
"@yuku-analyzer/binding-linux-arm64-musl": ["@yuku-analyzer/binding-linux-arm64-musl@0.10.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-TppF2j194mOQ/kBXvNr9u5TYO+eR9r8ieg4lTIEyJIVYHAR9GWeB0oFHLcJiLXVa3qUJGzE4bmzSntCW5ylA7A=="],
|
||||
"@yuku-core/binding-linux-arm64-musl": ["@yuku-core/binding-linux-arm64-musl@0.17.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-SGWvwtPe3uXVGjpKk6LTjO4ieGzad/a5h3cbSeduSIiNDfotM200kifB5cPUfg2LhfbM4uCImsApYZOqXW8lkw=="],
|
||||
|
||||
"@yuku-analyzer/binding-linux-x64-gnu": ["@yuku-analyzer/binding-linux-x64-gnu@0.10.2", "", { "os": "linux", "cpu": "x64" }, "sha512-03xu6ocJuwhm1a/JKmrHiaJUO1Oj86rABsm4FAl8AvfewfW/9idIUmPiFxZfb6RfiIONegebsTGJhFx0NbBNpA=="],
|
||||
"@yuku-core/binding-linux-x64-gnu": ["@yuku-core/binding-linux-x64-gnu@0.17.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Vq258yq8+UZQwdD26b6lz9FtqwHwOVWyjy+lcbYKlAhFuN/0FNO2UzlkG5F/0pXR0iRK/Xyxkq5IZpLJHS+2HQ=="],
|
||||
|
||||
"@yuku-analyzer/binding-linux-x64-musl": ["@yuku-analyzer/binding-linux-x64-musl@0.10.2", "", { "os": "linux", "cpu": "x64" }, "sha512-f7W2sAWWQN8x8YB0RRxIche7mLImH7lDgzUy9+B69cM2I6VFJ4a5+0pgAuMLROPOqimaxFPdXqLdDE/vpgGltg=="],
|
||||
"@yuku-core/binding-linux-x64-musl": ["@yuku-core/binding-linux-x64-musl@0.17.0", "", { "os": "linux", "cpu": "x64" }, "sha512-luEtfpzTP3Xph+HHz2rIVGH1VLbext5SFYrUyhKlbgoahkZ8MDzKI9TYsOVt0HukQkyEtW7+fG7yXJcdKqD4GA=="],
|
||||
|
||||
"@yuku-analyzer/binding-win32-arm64": ["@yuku-analyzer/binding-win32-arm64@0.10.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-f534qNc5YaJI29e1oryxEnxPkp7WCYJ1j7ChSec8pQNlYqTm8Tao7hij7NxRF+9BuxzeZCZ+WsbaAfLlklR0Eg=="],
|
||||
"@yuku-core/binding-win32-arm64": ["@yuku-core/binding-win32-arm64@0.17.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-CaqorOjCPJgUoDwS5nztgeZW4ay21enm3A4A42EY/CotiyDbFO7lKfrqTftGb+ZXrwJ41gNtY1gQ0AaWm0Wvwg=="],
|
||||
|
||||
"@yuku-analyzer/binding-win32-x64": ["@yuku-analyzer/binding-win32-x64@0.10.2", "", { "os": "win32", "cpu": "x64" }, "sha512-sKHkmLK8BsindMfyIThoN0bWC5uqSJEVNaLRD/ifA99mtb0UDin1ZCg4WYSVQAmM4k2iOTl4UZx/p3zcBiBgYw=="],
|
||||
"@yuku-core/binding-win32-x64": ["@yuku-core/binding-win32-x64@0.17.0", "", { "os": "win32", "cpu": "x64" }, "sha512-gPDXHz0dPwvgj1GO7xzK8jPktrCh9xyMXZKmwqq+5bemxrSXSDUK/osSw93xmHha/PQP2WcJ1WiJ8+XEx+ciHg=="],
|
||||
|
||||
"@yuku-toolchain/types": ["@yuku-toolchain/types@0.10.2", "", {}, "sha512-sSeo4SSSToiS+sSD+bwn/s94EEcaLJ7tG5LCp8gFYC1G5VzxzX7fqB6m9RU1yMD8KTpu6zdU/I1NlQf8hVBJ9Q=="],
|
||||
"@yuku-toolchain/types": ["@yuku-toolchain/types@0.17.0", "", {}, "sha512-3T4eKUuFAtuwbyRc2OIpanxPTl4CZdbmOvg1HB9UmRrPb3bsF3fFfbLSyIFYtZrE9/cNqLyEq/7g3Hm6nHIekA=="],
|
||||
|
||||
"acorn": ["acorn@8.16.0", "", { "bin": "bin/acorn" }, ""],
|
||||
|
||||
"acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, ""],
|
||||
|
||||
"ai": ["ai@7.0.119", "", { "dependencies": { "@ai-sdk/gateway": "4.0.97", "@ai-sdk/provider": "4.0.19", "@ai-sdk/provider-utils": "5.0.50" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-KlHbkKMmdb2g0DXdkhBXzSvLSkdoAg0MdShhTTOyuoHKJetEUlgjn2juZ05lHY97EqCwBuSK8dgiEeB0ty5xZw=="],
|
||||
"ai": ["ai@7.0.137", "", { "dependencies": { "@ai-sdk/gateway": "4.0.110", "@ai-sdk/provider": "4.0.26", "@ai-sdk/provider-utils": "5.0.58" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-JxrPkSQknxIN/gYqS3UQksExS6eWI23QMPBrKMGXeeFHhru6xFtF4MuMq17WaHD+lXPh0lne6H0BM2Z2VMW9EQ=="],
|
||||
|
||||
"aria-hidden": ["aria-hidden@1.2.6", "", { "dependencies": { "tslib": "^2.0.0" } }, ""],
|
||||
|
||||
@@ -491,7 +491,7 @@
|
||||
|
||||
"clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],
|
||||
|
||||
"cn": ["cn@0.2.6", "", { "bin": { "cn": "bin/cn.mjs" } }, "sha512-+i4L0zUGgRcEnhsxueVrP7iBGxBx5iD0WOTYg1MwFEu2ZyCmH5Ov2V1cul2Ht5UchRQQgftCf4be/RxspuW6QQ=="],
|
||||
"cn": ["cn@0.4.0", "", { "bin": { "cn": "bin/cn.mjs" } }, "sha512-qOAeUhPwPzBxx6jaeQdo646XIKliKHc2j1ZF7Ngb1o0pJZKH5gq8FkA0aVdUdPFUDXNXyUCXpCtoJISo6dhizg=="],
|
||||
|
||||
"collapse-white-space": ["collapse-white-space@2.1.0", "", {}, ""],
|
||||
|
||||
@@ -541,8 +541,6 @@
|
||||
|
||||
"enhanced-resolve": ["enhanced-resolve@5.24.5", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.3" } }, "sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A=="],
|
||||
|
||||
"entities": ["entities@6.0.1", "", {}, ""],
|
||||
|
||||
"es-toolkit": ["es-toolkit@1.45.1", "", {}, ""],
|
||||
|
||||
"esast-util-from-estree": ["esast-util-from-estree@2.0.0", "", { "dependencies": { "@types/estree-jsx": "^1.0.0", "devlop": "^1.0.0", "estree-util-visit": "^2.0.0", "unist-util-position-from-estree": "^2.0.0" } }, ""],
|
||||
@@ -579,17 +577,17 @@
|
||||
|
||||
"fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" } }, ""],
|
||||
|
||||
"framer-motion": ["framer-motion@13.5.1", "", { "dependencies": { "motion-dom": "13.5.1", "motion-utils": "13.5.0", "tslib": "^2.4.0" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["react", "react-dom"] }, "sha512-HeWOaeHD3kyTSIEMT6+nw7fBn4saIfxxabZyAITbycAl4xr1kzGJKIvGt/OWghSlvIA9qTnZ1zTGelHAe6S8DA=="],
|
||||
"framer-motion": ["framer-motion@14.3.0", "", { "dependencies": { "motion-dom": "14.3.0", "motion-utils": "14.1.1", "tslib": "^2.4.0" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["react", "react-dom"] }, "sha512-d8WCrU0ZQn7ukKMykCsDyIOwb/taZeDqqrDBK0du5GO0AO/ynz8fdR/LIIz9Pyy3n3tGwrneR+n0egyrrLa3fw=="],
|
||||
|
||||
"fumadocs-core": ["fumadocs-core@16.15.15", "", { "dependencies": { "@fumari/image-size": "^0.1.1", "estree-util-value-to-estree": "^3.5.0", "github-slugger": "^2.0.0", "hast-util-to-estree": "^3.1.3", "hast-util-to-jsx-runtime": "^2.3.6", "mdast-util-mdx": "^3.0.0", "mdast-util-to-markdown": "^2.1.2", "npm-to-yarn": "3.2.0", "remark": "^15.0.1", "remark-gfm": "^4.0.1", "remark-rehype": "^11.1.2", "scroll-into-view-if-needed": "^3.1.0", "shiki": "^4.4.3", "tinyglobby": "^0.2.17", "unified": "^11.0.5", "unist-util-visit": "^5.1.0", "vfile": "^6.0.3", "yaml": "^2.9.1", "zbsearch": "^4.0.0" }, "peerDependencies": { "@mdx-js/mdx": "*", "@mixedbread/sdk": "0.x.x", "@modelcontextprotocol/server": "2.x.x", "@orama/core": "1.x.x", "@oramacloud/client": "2.x.x", "@tanstack/react-router": "1.x.x", "@types/estree-jsx": "*", "@types/hast": "*", "@types/mdast": "*", "@types/react": "*", "algoliasearch": "5.x.x", "flexsearch": "*", "lucide-react": "*", "next": "16.x.x", "react": "^19.2.0", "react-dom": "^19.2.0", "react-router": "7.x.x || 8.x.x", "waku": "*", "zod": "4.x.x" }, "optionalPeers": ["@mdx-js/mdx", "@mixedbread/sdk", "@modelcontextprotocol/server", "@orama/core", "@oramacloud/client", "@tanstack/react-router", "@types/estree-jsx", "@types/hast", "@types/mdast", "@types/react", "algoliasearch", "flexsearch", "lucide-react", "next", "react", "react-dom", "react-router", "waku", "zod"] }, "sha512-kEQLKRlpRl16MfMrlAYiEpk3FPadn4725R3QHYVnF3tJhflRXvznWaJ5pP33F09d6qnOss5onEIgMpAO6rOrpA=="],
|
||||
"fumadocs-core": ["fumadocs-core@16.17.1", "", { "dependencies": { "@fumari/image-size": "^0.1.1", "estree-util-value-to-estree": "^3.5.0", "github-slugger": "^2.0.0", "hast-util-from-dom": "^5.0.1", "hast-util-to-estree": "^3.1.3", "hast-util-to-jsx-runtime": "^2.3.6", "mdast-util-mdx": "^3.0.0", "micromark": "^4.0.2", "micromark-extension-gfm-table": "^2.1.2", "npm-to-yarn": "3.2.0", "remark": "^15.0.1", "remark-gfm": "^4.0.1", "remark-rehype": "^11.1.2", "scroll-into-view-if-needed": "^3.1.0", "shiki": "^4.5.0", "tinyglobby": "^0.2.17", "unified": "^11.0.5", "vfile": "^6.0.3", "yaml": "^2.9.1", "zbsearch": "^4.0.1" }, "peerDependencies": { "@mdx-js/mdx": "*", "@mixedbread/sdk": "0.x.x", "@modelcontextprotocol/server": "2.x.x", "@orama/core": "1.x.x", "@oramacloud/client": "2.x.x", "@tanstack/react-router": "1.x.x", "@types/estree-jsx": "*", "@types/hast": "*", "@types/mdast": "*", "@types/react": "*", "algoliasearch": "5.x.x", "flexsearch": "*", "lucide-react": "*", "meilisearch": ">=0.50.0 <1.0.0", "next": "16.x.x", "react": "^19.2.0", "react-dom": "^19.2.0", "react-router": "7.x.x || 8.x.x", "waku": "*", "zod": "4.x.x" }, "optionalPeers": ["@mdx-js/mdx", "@mixedbread/sdk", "@modelcontextprotocol/server", "@orama/core", "@oramacloud/client", "@tanstack/react-router", "@types/estree-jsx", "@types/hast", "@types/mdast", "@types/react", "algoliasearch", "flexsearch", "lucide-react", "meilisearch", "next", "react", "react-dom", "react-router", "waku", "zod"] }, "sha512-zquUMPZaCEdsxFZ6ReZPzVN2yCP9tS3GZRndK0WtxbsvZ9KvvUDCeoLIpOZ6d3JU0uwSsclaIUGxI5ifvTftOQ=="],
|
||||
|
||||
"fumadocs-mdx": ["fumadocs-mdx@15.4.5", "", { "dependencies": { "@mdx-js/mdx": "^3.1.1", "@standard-schema/spec": "^1.1.0", "chokidar": "^5.0.0", "esbuild": "^0.28.2", "estree-util-value-to-estree": "^3.5.0", "github-slugger": "^2.0.0", "magic-string": "^1.4.1", "mdast-util-mdx": "^3.0.0", "picocolors": "^1.1.1", "picomatch": "^4.0.7", "tinyexec": "^1.3.1", "tinyglobby": "^0.2.17", "unified": "^11.0.5", "unist-util-remove-position": "^5.0.0", "unist-util-visit": "^5.1.0", "vfile": "^6.0.3", "yaml": "^2.9.1", "yuku-analyzer": "^0.10.2", "zod": "^4.6.5" }, "peerDependencies": { "@fumadocs/satteri": "0.x.x", "@types/mdast": "*", "@types/mdx": "*", "@types/react": "*", "fumadocs-core": "^16.15.3", "mdast-util-directive": "*", "next": "^15.3.0 || ^16.0.0", "react": "^19.2.0", "rolldown": "*", "satteri": "^0.10.5", "vite": "7.x.x || 8.x.x" }, "optionalPeers": ["@fumadocs/satteri", "@types/mdast", "@types/mdx", "@types/react", "mdast-util-directive", "next", "react", "rolldown", "satteri", "vite"], "bin": { "fumadocs-mdx": "./bin.js" } }, "sha512-r8gzaqleN+YXgPIbkYSZ05zr89dsr67/64Ar/00Uu7dRWTIHzbgmN1nC0lB8RFNeWnrL41bOTJilhLM4PAsrbw=="],
|
||||
"fumadocs-mdx": ["fumadocs-mdx@15.4.7", "", { "dependencies": { "@mdx-js/mdx": "^3.1.1", "@standard-schema/spec": "^1.1.0", "chokidar": "^5.0.0", "esbuild": "^0.28.2", "estree-util-value-to-estree": "^3.5.0", "github-slugger": "^2.0.0", "magic-string": "^1.4.2", "mdast-util-mdx": "^3.0.0", "picocolors": "^1.1.1", "picomatch": "^4.0.7", "tinyexec": "^1.3.1", "tinyglobby": "^0.2.17", "unified": "^11.0.5", "unist-util-remove-position": "^5.0.0", "vfile": "^6.0.3", "yaml": "^2.9.1", "yuku-analyzer": "^0.17.0", "zod": "^4.6.5" }, "peerDependencies": { "@fumadocs/satteri": "0.x.x", "@types/mdast": "*", "@types/mdx": "*", "@types/react": "*", "fumadocs-core": "^16.17.0", "mdast-util-directive": "*", "next": "^15.3.0 || ^16.0.0", "react": "^19.2.0", "rolldown": "*", "satteri": "^0.10.5", "vite": "7.x.x || 8.x.x" }, "optionalPeers": ["@fumadocs/satteri", "@types/mdast", "@types/mdx", "@types/react", "mdast-util-directive", "next", "react", "rolldown", "satteri", "vite"], "bin": { "fumadocs-mdx": "./bin.js" } }, "sha512-54lE+dIlIkebSxcN1Lqe0yn5lkKI4zm/Fxl+Se+IqSGyANsBVoa7XaDFFUSLfklxfkSM1NKkrbw0yzvRWVb9rw=="],
|
||||
|
||||
"fumadocs-twoslash": ["fumadocs-twoslash@4.0.1", "", { "dependencies": { "@base-ui/react": "^1.8.0", "@types/hast": "^3.0.5", "cn": "^0.2.6", "mdast-util-from-markdown": "^2.0.3", "mdast-util-to-hast": "^13.2.1", "typescript": "~7.0.2" }, "peerDependencies": { "@types/react": "*", "fumadocs-core": "^16.15.7", "fumadocs-ui": "^16.7.16", "react": "^19.2.0", "react-dom": "^19.2.0", "shiki": "^4.4.3" }, "optionalPeers": ["@types/react"] }, "sha512-9+mDaQJZGSI657IsX+kfvtGHYulvHdI0uVgD2hd32i5RMERH2TOgHaq7zz/TKTI7L4WDhx8MZ0BRjyOiso1KMQ=="],
|
||||
"fumadocs-twoslash": ["fumadocs-twoslash@4.0.2", "", { "dependencies": { "@base-ui/react": "^1.8.0", "@types/hast": "^3.0.5", "cn": "^0.4.0", "mdast-util-from-markdown": "^2.0.3", "mdast-util-to-hast": "^13.2.1", "typescript": "~7.0.2" }, "peerDependencies": { "@types/react": "*", "fumadocs-core": "^16.15.7", "fumadocs-ui": "^16.7.16", "react": "^19.2.0", "react-dom": "^19.2.0", "shiki": "^4.4.3" }, "optionalPeers": ["@types/react"] }, "sha512-SZVadHkuPO8CbtNvM8K9VzgzWAWUi3MDGAQYKVtgi/11Ni3OgZJ3H5YV+P1UwF/HapaSnJKUnLVRH2TM8VsUTg=="],
|
||||
|
||||
"fumadocs-typescript": ["fumadocs-typescript@5.4.1", "", { "dependencies": { "estree-util-value-to-estree": "^3.5.0", "hast-util-to-estree": "^3.1.3", "hast-util-to-jsx-runtime": "^2.3.6", "remark": "^15.0.1", "remark-rehype": "^11.1.2", "shiki": "^4.4.3", "typescript": "~7.0.2", "unified": "^11.0.5", "unist-util-visit": "^5.1.0" }, "peerDependencies": { "@types/estree": "*", "@types/hast": "*", "@types/mdast": "*", "@types/react": "*", "fumadocs-core": "^16.7.0", "fumadocs-ui": "^16.7.0", "react": "^19.2.0", "react-dom": "^19.2.0" }, "optionalPeers": ["@types/estree", "@types/hast", "@types/mdast", "@types/react", "fumadocs-ui"] }, "sha512-qW61uHWNnK7XWFpINeWedX9UMQotPOLDC5oHybwA5l39CAR0xC/G6hlyGgTF2WH4AQjsFDwDAwgVuuU4dbmNJQ=="],
|
||||
"fumadocs-typescript": ["fumadocs-typescript@5.5.2", "", { "dependencies": { "estree-util-value-to-estree": "^3.5.0", "hast-util-to-estree": "^3.1.3", "hast-util-to-jsx-runtime": "^2.3.6", "remark": "^15.0.1", "remark-rehype": "^11.1.2", "shiki": "^4.5.0", "typescript": "~7.0.2", "unified": "^11.0.5" }, "peerDependencies": { "@types/estree": "*", "@types/hast": "*", "@types/mdast": "*", "@types/react": "*", "fumadocs-core": "^16.17.1", "fumadocs-ui": "^16.7.0", "react": "^19.2.0", "react-dom": "^19.2.0" }, "optionalPeers": ["@types/estree", "@types/hast", "@types/mdast", "@types/react", "fumadocs-ui"] }, "sha512-QbKLRpx2Hfyq3R4NpPHKEz0TW+csBuT9IFLhrjyalfP89HpsZBwpHRVCOl//d2Smcbpmj9N4UCp03p97od+NkA=="],
|
||||
|
||||
"fumadocs-ui": ["fumadocs-ui@16.15.15", "", { "dependencies": { "@fuma-translate/react": "^1.0.2", "@fumadocs/tailwind": "0.1.2", "@radix-ui/react-accordion": "^1.2.20", "@radix-ui/react-collapsible": "^1.1.20", "@radix-ui/react-dialog": "^1.1.23", "@radix-ui/react-direction": "^1.1.4", "@radix-ui/react-navigation-menu": "^1.2.22", "@radix-ui/react-popover": "^1.1.23", "@radix-ui/react-presence": "^1.1.10", "@radix-ui/react-scroll-area": "^1.2.18", "@radix-ui/react-slot": "^1.3.3", "@radix-ui/react-tabs": "^1.1.21", "class-variance-authority": "^0.7.1", "cn": "^0.3.0", "lucide-react": "^1.47.0", "motion": "^13.4.0", "next-themes": "^0.4.6", "react-remove-scroll": "^2.7.2", "rehype-raw": "^7.0.0", "scroll-into-view-if-needed": "^3.1.0", "shiki": "^4.4.3", "unist-util-visit": "^5.1.0" }, "peerDependencies": { "@types/mdx": "*", "@types/react": "*", "fumadocs-core": "16.15.15", "next": "16.x.x", "react": "^19.2.0", "react-dom": "^19.2.0", "takumi-js": "*" }, "optionalPeers": ["@types/mdx", "@types/react", "next", "takumi-js"] }, "sha512-wE9gTz+JYoz9wwxaNCfj7jqN7c7oAY7lCyuFootpY8jmGiyZHfy6db2cxlRwjm+qEaLdsV/KOsAjbuuT/n8elg=="],
|
||||
"fumadocs-ui": ["fumadocs-ui@16.17.1", "", { "dependencies": { "@fuma-translate/react": "^1.0.2", "@fumadocs/tailwind": "0.1.3", "@radix-ui/react-accordion": "^1.2.20", "@radix-ui/react-collapsible": "^1.1.20", "@radix-ui/react-dialog": "^1.1.23", "@radix-ui/react-direction": "^1.1.4", "@radix-ui/react-navigation-menu": "^1.2.22", "@radix-ui/react-popover": "^1.1.23", "@radix-ui/react-presence": "^1.1.10", "@radix-ui/react-scroll-area": "^1.2.18", "@radix-ui/react-slot": "^1.3.3", "@radix-ui/react-tabs": "^1.1.21", "class-variance-authority": "^0.7.1", "cn": "^0.4.0", "hast-util-to-jsx-runtime": "^2.3.6", "lucide-react": "^1.50.0", "motion": "^14.0.0", "next-themes": "^0.4.6", "react-remove-scroll": "^2.7.2", "scroll-into-view-if-needed": "^3.1.0", "shiki": "^4.5.0" }, "peerDependencies": { "@types/mdx": "*", "@types/react": "*", "fumadocs-core": "16.17.1", "next": "16.x.x", "react": "^19.2.0", "react-dom": "^19.2.0", "takumi-js": "*" }, "optionalPeers": ["@types/mdx", "@types/react", "next", "takumi-js"] }, "sha512-ByW1NbvEbMfsZfW+DkWewSEX7Ituv732K0y2ga1ri+Zghf+4zu2sa0QjJetC3DaKffyvx5vbPVxwjyYCeNtRhg=="],
|
||||
|
||||
"get-nonce": ["get-nonce@1.0.1", "", {}, ""],
|
||||
|
||||
@@ -597,20 +595,16 @@
|
||||
|
||||
"graceful-fs": ["graceful-fs@4.2.11", "", {}, ""],
|
||||
|
||||
"hast-util-from-parse5": ["hast-util-from-parse5@8.0.3", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "devlop": "^1.0.0", "hastscript": "^9.0.0", "property-information": "^7.0.0", "vfile": "^6.0.0", "vfile-location": "^5.0.0", "web-namespaces": "^2.0.0" } }, ""],
|
||||
"hast-util-from-dom": ["hast-util-from-dom@5.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "hastscript": "^9.0.0", "web-namespaces": "^2.0.0" } }, "sha512-N+LqofjR2zuzTjCPzyDUdSshy4Ma6li7p/c3pA78uTwzFgENbgbUrm2ugwsOdcjI1muO+o6Dgzp9p8WHtn/39Q=="],
|
||||
|
||||
"hast-util-parse-selector": ["hast-util-parse-selector@4.0.0", "", { "dependencies": { "@types/hast": "^3.0.0" } }, ""],
|
||||
|
||||
"hast-util-raw": ["hast-util-raw@9.1.0", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "@ungap/structured-clone": "^1.0.0", "hast-util-from-parse5": "^8.0.0", "hast-util-to-parse5": "^8.0.0", "html-void-elements": "^3.0.0", "mdast-util-to-hast": "^13.0.0", "parse5": "^7.0.0", "unist-util-position": "^5.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0", "web-namespaces": "^2.0.0", "zwitch": "^2.0.0" } }, ""],
|
||||
|
||||
"hast-util-to-estree": ["hast-util-to-estree@3.1.3", "", { "dependencies": { "@types/estree": "^1.0.0", "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "devlop": "^1.0.0", "estree-util-attach-comments": "^3.0.0", "estree-util-is-identifier-name": "^3.0.0", "hast-util-whitespace": "^3.0.0", "mdast-util-mdx-expression": "^2.0.0", "mdast-util-mdx-jsx": "^3.0.0", "mdast-util-mdxjs-esm": "^2.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", "style-to-js": "^1.0.0", "unist-util-position": "^5.0.0", "zwitch": "^2.0.0" } }, ""],
|
||||
|
||||
"hast-util-to-html": ["hast-util-to-html@9.0.5", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "ccount": "^2.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-whitespace": "^3.0.0", "html-void-elements": "^3.0.0", "mdast-util-to-hast": "^13.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", "stringify-entities": "^4.0.0", "zwitch": "^2.0.4" } }, ""],
|
||||
|
||||
"hast-util-to-jsx-runtime": ["hast-util-to-jsx-runtime@2.3.6", "", { "dependencies": { "@types/estree": "^1.0.0", "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "comma-separated-tokens": "^2.0.0", "devlop": "^1.0.0", "estree-util-is-identifier-name": "^3.0.0", "hast-util-whitespace": "^3.0.0", "mdast-util-mdx-expression": "^2.0.0", "mdast-util-mdx-jsx": "^3.0.0", "mdast-util-mdxjs-esm": "^2.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", "style-to-js": "^1.0.0", "unist-util-position": "^5.0.0", "vfile-message": "^4.0.0" } }, ""],
|
||||
|
||||
"hast-util-to-parse5": ["hast-util-to-parse5@8.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "devlop": "^1.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", "web-namespaces": "^2.0.0", "zwitch": "^2.0.0" } }, ""],
|
||||
|
||||
"hast-util-whitespace": ["hast-util-whitespace@3.0.0", "", { "dependencies": { "@types/hast": "^3.0.0" } }, ""],
|
||||
|
||||
"hastscript": ["hastscript@9.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-parse-selector": "^4.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0" } }, ""],
|
||||
@@ -719,7 +713,7 @@
|
||||
|
||||
"micromark-extension-gfm-strikethrough": ["micromark-extension-gfm-strikethrough@2.1.0", "", { "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, ""],
|
||||
|
||||
"micromark-extension-gfm-table": ["micromark-extension-gfm-table@2.1.1", "", { "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, ""],
|
||||
"micromark-extension-gfm-table": ["micromark-extension-gfm-table@2.1.2", "", { "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-pRzm4kDTu0MjlmBkxmS9yYhw60nncfcEwu9NNdPFSQEFXS95ZKyIIyTSHu/o3ReBUrLKYEq+7YaXCRn/bPB4MA=="],
|
||||
|
||||
"micromark-extension-gfm-tagfilter": ["micromark-extension-gfm-tagfilter@2.0.0", "", { "dependencies": { "micromark-util-types": "^2.0.0" } }, ""],
|
||||
|
||||
@@ -777,11 +771,11 @@
|
||||
|
||||
"micromark-util-types": ["micromark-util-types@2.0.2", "", {}, ""],
|
||||
|
||||
"motion": ["motion@13.5.1", "", { "dependencies": { "framer-motion": "13.5.1", "tslib": "^2.4.0" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["react", "react-dom"] }, "sha512-eV9SUem6KnzEa9+eT+dVBeDlhy5TTdn09YWR1WhUsKoZCJPw/n4TcYhjbxq2Gy5PTwDr//4H3r5vxkcZnNnO1w=="],
|
||||
"motion": ["motion@14.3.0", "", { "dependencies": { "framer-motion": "14.3.0", "tslib": "^2.4.0" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["react", "react-dom"] }, "sha512-yh/nHYjikl68+FTxAMywFYzzj21/oGY7RGCfkqN5zpuT1rk3rp0lKfVU8EUq0A64qQeGnxuKUJWP85MipqdLBw=="],
|
||||
|
||||
"motion-dom": ["motion-dom@13.5.1", "", { "dependencies": { "motion-utils": "13.5.0" } }, "sha512-/7CVCD20Mz1KobktorpdgvowV0V41J7UxqE+qWS3GkSJqrRr5ft+2RloOYtEKv+wvBp3JaSFBclhxt4ja8ovHg=="],
|
||||
"motion-dom": ["motion-dom@14.3.0", "", { "dependencies": { "motion-utils": "14.1.1" } }, "sha512-rcKO4aEJzAqDEsrH6qFzhLZxs7bNqZpiUEuEATz9LaRwt6dG7hZEbcFUSHNR8NECaKYM0Iuw6Iv6NpWEGXDI+w=="],
|
||||
|
||||
"motion-utils": ["motion-utils@13.5.0", "", {}, "sha512-Hqe/sqjIKliPZg8sVjWAkdySDPJNIeKH+euVkDOG8ri3DUUU7ZjndmHsGqEPz2iHpiyVaV5I22iguCMHU2he+Q=="],
|
||||
"motion-utils": ["motion-utils@14.1.1", "", {}, "sha512-3VvN5Uvf8B6qG+OfOui6Nht5EWp+vLuU3IqcAj7ItZGKqtmTjCebl5sGZF7/08gEHRnEl1AP/fIwbcEyVrcQGQ=="],
|
||||
|
||||
"ms": ["ms@2.1.3", "", {}, ""],
|
||||
|
||||
@@ -797,12 +791,10 @@
|
||||
|
||||
"oniguruma-to-es": ["oniguruma-to-es@4.3.6", "", { "dependencies": { "oniguruma-parser": "^0.12.2", "regex": "^6.1.0", "regex-recursion": "^6.0.2" } }, "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA=="],
|
||||
|
||||
"openai": ["openai@7.30.0", "", { "peerDependencies": { "@aws-sdk/credential-provider-node": ">=3.972.0 <4", "@smithy/hash-node": ">=4.3.0 <5", "@smithy/signature-v4": ">=5.4.0 <6", "undici": ">=5 <9", "ws": "^8.21.0", "zod": "^3.25 || ^4.0" }, "optionalPeers": ["@aws-sdk/credential-provider-node", "@smithy/hash-node", "@smithy/signature-v4", "undici", "ws", "zod"] }, "sha512-tvvcPdhS56B/79o0mJS5h4JndAov5Sz78T7CFl4gJ+C9S3GoSqHNLO6lG/8kdK+/c13zWEI97Srf66ar0V242g=="],
|
||||
"openai": ["openai@7.34.0", "", { "peerDependencies": { "@aws-sdk/credential-provider-node": ">=3.972.0 <4", "@smithy/hash-node": ">=4.3.0 <5", "@smithy/signature-v4": ">=5.4.0 <6", "undici": ">=5 <9", "ws": "^8.21.0", "zod": "^3.25 || ^4.0" }, "optionalPeers": ["@aws-sdk/credential-provider-node", "@smithy/hash-node", "@smithy/signature-v4", "undici", "ws", "zod"] }, "sha512-PMwuTQ/3cVyWZJOVpb6bzlrQj17uImlnUGQWqh5zHlN/snwK5ww4ZUHW8NYGtH6f9PQOEPxyD/f8WJVIHp1q2A=="],
|
||||
|
||||
"parse-entities": ["parse-entities@4.0.2", "", { "dependencies": { "@types/unist": "^2.0.0", "character-entities-legacy": "^3.0.0", "character-reference-invalid": "^2.0.0", "decode-named-character-reference": "^1.0.0", "is-alphanumerical": "^2.0.0", "is-decimal": "^2.0.0", "is-hexadecimal": "^2.0.0" } }, ""],
|
||||
|
||||
"parse5": ["parse5@7.3.0", "", { "dependencies": { "entities": "^6.0.0" } }, ""],
|
||||
|
||||
"picocolors": ["picocolors@1.1.1", "", {}, ""],
|
||||
|
||||
"picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="],
|
||||
@@ -851,8 +843,6 @@
|
||||
|
||||
"regex-utilities": ["regex-utilities@2.3.0", "", {}, "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng=="],
|
||||
|
||||
"rehype-raw": ["rehype-raw@7.0.0", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-raw": "^9.0.0", "vfile": "^6.0.0" } }, ""],
|
||||
|
||||
"rehype-recma": ["rehype-recma@1.0.0", "", { "dependencies": { "@types/estree": "^1.0.0", "@types/hast": "^3.0.0", "hast-util-to-estree": "^3.0.0" } }, ""],
|
||||
|
||||
"remark": ["remark@15.0.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "remark-parse": "^11.0.0", "remark-stringify": "^11.0.0", "unified": "^11.0.0" } }, ""],
|
||||
@@ -879,7 +869,7 @@
|
||||
|
||||
"sharp": ["sharp@0.35.5", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.5" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.5", "@img/sharp-darwin-x64": "0.35.5", "@img/sharp-freebsd-wasm32": "0.35.5", "@img/sharp-libvips-darwin-arm64": "1.3.4", "@img/sharp-libvips-darwin-x64": "1.3.4", "@img/sharp-libvips-linux-arm": "1.3.4", "@img/sharp-libvips-linux-arm64": "1.3.4", "@img/sharp-libvips-linux-ppc64": "1.3.4", "@img/sharp-libvips-linux-riscv64": "1.3.4", "@img/sharp-libvips-linux-s390x": "1.3.4", "@img/sharp-libvips-linux-x64": "1.3.4", "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", "@img/sharp-libvips-linuxmusl-x64": "1.3.4", "@img/sharp-linux-arm": "0.35.5", "@img/sharp-linux-arm64": "0.35.5", "@img/sharp-linux-ppc64": "0.35.5", "@img/sharp-linux-riscv64": "0.35.5", "@img/sharp-linux-s390x": "0.35.5", "@img/sharp-linux-x64": "0.35.5", "@img/sharp-linuxmusl-arm64": "0.35.5", "@img/sharp-linuxmusl-x64": "0.35.5", "@img/sharp-webcontainers-wasm32": "0.35.5", "@img/sharp-win32-arm64": "0.35.5", "@img/sharp-win32-ia32": "0.35.5", "@img/sharp-win32-x64": "0.35.5" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g=="],
|
||||
|
||||
"shiki": ["shiki@4.4.3", "", { "dependencies": { "@shikijs/core": "4.4.3", "@shikijs/engine-javascript": "4.4.3", "@shikijs/engine-oniguruma": "4.4.3", "@shikijs/langs": "4.4.3", "@shikijs/themes": "4.4.3", "@shikijs/types": "4.4.3", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-Mb/GvXPHBAXdgGIcnfU5L3ldpn1XcxrGkPHwqgRx17/I2XRfqlFKk2vGkHWINn1kdXvzJZeuO3is6I9KLPFm0g=="],
|
||||
"shiki": ["shiki@4.5.0", "", { "dependencies": { "@shikijs/core": "4.5.0", "@shikijs/engine-javascript": "4.5.0", "@shikijs/engine-oniguruma": "4.5.0", "@shikijs/langs": "4.5.0", "@shikijs/themes": "4.5.0", "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-OcRW72ngQvc+MSVWBRIovC/BTW589iUE/Vxav7VeM4RcY9MUjqB+IR6ILG1k9nuW6LiG/nct9uma4/MBtnZbmQ=="],
|
||||
|
||||
"source-map": ["source-map@0.7.6", "", {}, ""],
|
||||
|
||||
@@ -947,8 +937,6 @@
|
||||
|
||||
"vfile": ["vfile@6.0.3", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, ""],
|
||||
|
||||
"vfile-location": ["vfile-location@5.0.3", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile": "^6.0.0" } }, ""],
|
||||
|
||||
"vfile-message": ["vfile-message@4.0.3", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0" } }, ""],
|
||||
|
||||
"victory-vendor": ["victory-vendor@37.3.6", "", { "dependencies": { "@types/d3-array": "^3.0.3", "@types/d3-ease": "^3.0.0", "@types/d3-interpolate": "^3.0.1", "@types/d3-scale": "^4.0.2", "@types/d3-shape": "^3.1.0", "@types/d3-time": "^3.0.0", "@types/d3-timer": "^3.0.0", "d3-array": "^3.1.6", "d3-ease": "^3.0.1", "d3-interpolate": "^3.0.1", "d3-scale": "^4.0.2", "d3-shape": "^3.1.0", "d3-time": "^3.0.0", "d3-timer": "^3.0.1" } }, ""],
|
||||
@@ -959,9 +947,11 @@
|
||||
|
||||
"yaml": ["yaml@2.9.1", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw=="],
|
||||
|
||||
"yuku-analyzer": ["yuku-analyzer@0.10.2", "", { "dependencies": { "@yuku-toolchain/types": "^0.10.2", "yuku-ast": "^0.10.2" }, "optionalDependencies": { "@yuku-analyzer/binding-android-arm64": "0.10.2", "@yuku-analyzer/binding-darwin-arm64": "0.10.2", "@yuku-analyzer/binding-darwin-x64": "0.10.2", "@yuku-analyzer/binding-freebsd-x64": "0.10.2", "@yuku-analyzer/binding-linux-arm-gnu": "0.10.2", "@yuku-analyzer/binding-linux-arm-musl": "0.10.2", "@yuku-analyzer/binding-linux-arm64-gnu": "0.10.2", "@yuku-analyzer/binding-linux-arm64-musl": "0.10.2", "@yuku-analyzer/binding-linux-x64-gnu": "0.10.2", "@yuku-analyzer/binding-linux-x64-musl": "0.10.2", "@yuku-analyzer/binding-win32-arm64": "0.10.2", "@yuku-analyzer/binding-win32-x64": "0.10.2" } }, "sha512-UBRcDcZtIn14g88loZUZ123d6MOkc2hMTawUle5MkuWboowM90KbWHN3Zz+HfuS06sw935ygecBpcJlXHB/pOA=="],
|
||||
"yuku-analyzer": ["yuku-analyzer@0.17.0", "", { "dependencies": { "@yuku-toolchain/types": "^0.17.0", "yuku-ast": "^0.17.0", "yuku-core": "0.17.0" } }, "sha512-MJWtt5HvXVR51mGOR2uMXQ45t1X1oMkmx4vaP/Li1HNC69OFG/qYmxf++aVazkXH5pdxTYTHYRUPl67b7NYxjA=="],
|
||||
|
||||
"yuku-ast": ["yuku-ast@0.10.2", "", { "dependencies": { "@yuku-toolchain/types": "^0.10.2" } }, "sha512-UnG9mA6giglCvSErft2/40TVFX750Sj1xgwddPLpG7J7rlr/P1wPADg9G2RK+d/1tNLtRVoLdMMOMVBB9561TQ=="],
|
||||
"yuku-ast": ["yuku-ast@0.17.0", "", { "dependencies": { "@yuku-toolchain/types": "^0.17.0" } }, "sha512-htIzp3bLNdBtOSh8L8pJ7nkTft2kw/C3ghTToSg3FKtzi0YGkvAdEUUza9c744tnbeXtKUMEupFOYHuVNXn1yQ=="],
|
||||
|
||||
"yuku-core": ["yuku-core@0.17.0", "", { "dependencies": { "@yuku-toolchain/types": "^0.17.0" }, "optionalDependencies": { "@yuku-core/binding-android-arm64": "0.17.0", "@yuku-core/binding-darwin-arm64": "0.17.0", "@yuku-core/binding-darwin-x64": "0.17.0", "@yuku-core/binding-freebsd-x64": "0.17.0", "@yuku-core/binding-linux-arm-gnu": "0.17.0", "@yuku-core/binding-linux-arm-musl": "0.17.0", "@yuku-core/binding-linux-arm64-gnu": "0.17.0", "@yuku-core/binding-linux-arm64-musl": "0.17.0", "@yuku-core/binding-linux-x64-gnu": "0.17.0", "@yuku-core/binding-linux-x64-musl": "0.17.0", "@yuku-core/binding-win32-arm64": "0.17.0", "@yuku-core/binding-win32-x64": "0.17.0" } }, "sha512-4BgHT4euQ62wr/9h5UWoMzt4QTrmT3WUo96aRiY2R6RRCyKjCveU23MNwNJISzYvNnbFGZ7O2E1SU5zgWqzS+Q=="],
|
||||
|
||||
"zbsearch": ["zbsearch@4.0.1", "", {}, "sha512-lmnEEnb93QQcNv7qARDr7jBVPxYdZbZ9XdZ0dbZ0qaOvGne4jJMW4fjwPfVaUKQXv3FNWvGbDwRDgyaSb1pc8w=="],
|
||||
|
||||
@@ -969,9 +959,9 @@
|
||||
|
||||
"zwitch": ["zwitch@2.0.4", "", {}, ""],
|
||||
|
||||
"@ai-sdk/gateway/@ai-sdk/provider": ["@ai-sdk/provider@4.0.19", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-ryVZSSfmpEsr4bM8rbt9cSBWal+KGYRrm57C+k/hiPQHMiMahaqg2bPF0MpxSUWY8mGpt7s/ajM6PAqNTMKqPQ=="],
|
||||
"@ai-sdk/gateway/@ai-sdk/provider": ["@ai-sdk/provider@4.0.26", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-BZ443uBEq6HuMA+Z4b7Hpm65GpZSo7pWqnYqpf/7tAO3C48JbtvAhOE2JnODFj+jodsZzfRHkAyQb64xuD2tZQ=="],
|
||||
|
||||
"@ai-sdk/gateway/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@5.0.50", "", { "dependencies": { "@ai-sdk/provider": "4.0.19", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.29.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-qg2LutM5RlUT/tuuFf+VkhFGNZ2sEJHL0oDIrFN/sMoVbDBANglqtGCJUOnBqGMoFBH8IfAXMrFZvbFWx4dMOg=="],
|
||||
"@ai-sdk/gateway/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@5.0.58", "", { "dependencies": { "@ai-sdk/provider": "4.0.26", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.29.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-iXSwKR/7LpHzAlyrUl+bTinwzmZ3Nmup1viwPisM5Gn5cogRdIG4rV9w1ZDuKFcrXyu/AeVs42E1CX/0aNwrfQ=="],
|
||||
|
||||
"@base-ui/react/@babel/runtime": ["@babel/runtime@7.29.7", "", {}, "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw=="],
|
||||
|
||||
@@ -983,6 +973,14 @@
|
||||
|
||||
"@mdx-js/mdx/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
|
||||
"@radix-ui/react-collection/@radix-ui/react-slot": ["@radix-ui/react-slot@1.3.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.5" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q=="],
|
||||
|
||||
"@radix-ui/react-dialog/@radix-ui/react-slot": ["@radix-ui/react-slot@1.3.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.5" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q=="],
|
||||
|
||||
"@radix-ui/react-popover/@radix-ui/react-slot": ["@radix-ui/react-slot@1.3.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.5" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q=="],
|
||||
|
||||
"@radix-ui/react-primitive/@radix-ui/react-slot": ["@radix-ui/react-slot@1.3.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.5" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q=="],
|
||||
|
||||
"@reduxjs/toolkit/immer": ["immer@11.1.4", "", {}, ""],
|
||||
|
||||
"@reduxjs/toolkit/reselect": ["reselect@5.1.1", "", {}, ""],
|
||||
@@ -1007,26 +1005,18 @@
|
||||
|
||||
"@tailwindcss/postcss/tailwindcss": ["tailwindcss@4.3.3", "", {}, "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ=="],
|
||||
|
||||
"ai/@ai-sdk/provider": ["@ai-sdk/provider@4.0.19", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-ryVZSSfmpEsr4bM8rbt9cSBWal+KGYRrm57C+k/hiPQHMiMahaqg2bPF0MpxSUWY8mGpt7s/ajM6PAqNTMKqPQ=="],
|
||||
"ai/@ai-sdk/provider": ["@ai-sdk/provider@4.0.26", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-BZ443uBEq6HuMA+Z4b7Hpm65GpZSo7pWqnYqpf/7tAO3C48JbtvAhOE2JnODFj+jodsZzfRHkAyQb64xuD2tZQ=="],
|
||||
|
||||
"ai/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@5.0.50", "", { "dependencies": { "@ai-sdk/provider": "4.0.19", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.29.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-qg2LutM5RlUT/tuuFf+VkhFGNZ2sEJHL0oDIrFN/sMoVbDBANglqtGCJUOnBqGMoFBH8IfAXMrFZvbFWx4dMOg=="],
|
||||
|
||||
"fumadocs-ui/cn": ["cn@0.3.3", "", { "bin": { "cn": "bin/cn.mjs" } }, "sha512-OEiyJkSpYm2kOuNOKQ+c2wmzZRG8orrb9fnObtHTbCGNx/E9KLnGcmcocItOzREKk5KzQN5I2e3BUCj563KEpw=="],
|
||||
|
||||
"hast-util-from-parse5/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
"ai/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@5.0.58", "", { "dependencies": { "@ai-sdk/provider": "4.0.26", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.29.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-iXSwKR/7LpHzAlyrUl+bTinwzmZ3Nmup1viwPisM5Gn5cogRdIG4rV9w1ZDuKFcrXyu/AeVs42E1CX/0aNwrfQ=="],
|
||||
|
||||
"hast-util-parse-selector/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
|
||||
"hast-util-raw/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
|
||||
"hast-util-to-estree/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
|
||||
"hast-util-to-html/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
|
||||
"hast-util-to-jsx-runtime/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
|
||||
"hast-util-to-parse5/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
|
||||
"hast-util-whitespace/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
|
||||
"hastscript/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
@@ -1039,9 +1029,9 @@
|
||||
|
||||
"mdast-util-to-hast/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
|
||||
"parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, ""],
|
||||
"micromark-extension-gfm/micromark-extension-gfm-table": ["micromark-extension-gfm-table@2.1.1", "", { "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, ""],
|
||||
|
||||
"rehype-raw/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
"parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, ""],
|
||||
|
||||
"rehype-recma/@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, ""],
|
||||
|
||||
|
||||
@@ -82,6 +82,10 @@ The client never sees CCR tool calls on the Anthropic and OpenAI proxy paths; He
|
||||
also return `finish_reason=MALFORMED_FUNCTION_CALL` on large function-response
|
||||
continuations after CCR retrieval; that separate limitation remains tracked in
|
||||
[issue #2041](https://github.com/headroomlabs-ai/headroom/issues/2041).
|
||||
Native Google batch contexts retain the effective forwarded Tool objects,
|
||||
including injected retrieval declarations and sibling Google Search or code
|
||||
execution tools. Continuations use those declarations alongside the original
|
||||
conversation rather than rebuilding a function-declaration wrapper.
|
||||
</Callout>
|
||||
|
||||
## Phase 4: Context Tracker
|
||||
|
||||
@@ -284,6 +284,7 @@ accept arbitrary environment variables — writes are restricted to a hardcoded
|
||||
| `HEADROOM_INTERCEPT_READ_MIN_CHARS` | ast-grep read-interception threshold |
|
||||
| `HEADROOM_VERIFY_TRUNCATION_ON_DISK` | Verify ast-grep Read truncation against disk when no client banner is found. Always returns `UNKNOWN` on Windows, where `dir_fd` / `O_NOFOLLOW` support is unavailable. |
|
||||
| `HEADROOM_VERIFY_TRUNCATION_MAX_BYTES` | Max on-disk file size (bytes) the disk-verify fallback will read |
|
||||
| `HEADROOM_BUFFERED_UPSTREAM_STREAM` | Send buffered CCR requests (and their continuations) upstream as `stream: true` and fold the reply (default on; `0` sends `stream: false`) |
|
||||
|
||||
Keys outside this list are ignored, and `/admin/upstream` is read-only — there is no
|
||||
write route on the admin surface, specifically so a caller cannot redirect
|
||||
|
||||
Generated
+393
-444
File diff suppressed because it is too large
Load Diff
+13
-13
@@ -13,33 +13,33 @@
|
||||
"postinstall": "fumadocs-mdx"
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/react-slot": "1.3.3",
|
||||
"@radix-ui/react-slot": "1.5.0",
|
||||
"class-variance-authority": "0.7.1",
|
||||
"clsx": "2.1.1",
|
||||
"dotted-map": "^3.1.0",
|
||||
"fumadocs-core": "16.15.15",
|
||||
"fumadocs-mdx": "15.4.5",
|
||||
"fumadocs-twoslash": "^4.0.1",
|
||||
"fumadocs-typescript": "^5.4.1",
|
||||
"fumadocs-ui": "16.15.15",
|
||||
"fumadocs-core": "16.17.1",
|
||||
"fumadocs-mdx": "15.4.7",
|
||||
"fumadocs-twoslash": "^4.0.2",
|
||||
"fumadocs-typescript": "^5.5.1",
|
||||
"fumadocs-ui": "16.17.1",
|
||||
"lucide-react": "^1.48.0",
|
||||
"next": "^16.3.8",
|
||||
"next": "^16.4.0",
|
||||
"react": "^19.3.0",
|
||||
"react-dom": "^19.3.0",
|
||||
"recharts": "^3.10.1",
|
||||
"tailwind-merge": "^3.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ai-sdk/openai": "^4.0.79",
|
||||
"@anthropic-ai/sdk": "^0.129.0",
|
||||
"@ai-sdk/openai": "^4.0.91",
|
||||
"@anthropic-ai/sdk": "^0.133.0",
|
||||
"@tailwindcss/postcss": "^4.3.3",
|
||||
"@types/mdx": "^2.0.14",
|
||||
"@types/node": "^26.6.3",
|
||||
"@types/node": "^26.6.5",
|
||||
"@types/react": "^19.3.0",
|
||||
"@types/react-dom": "^19.3.0",
|
||||
"ai": "7.0.119",
|
||||
"openai": "^7.23.0",
|
||||
"postcss": "^8.5.28",
|
||||
"ai": "7.0.137",
|
||||
"openai": "^7.32.0",
|
||||
"postcss": "^8.5.29",
|
||||
"tailwindcss": "^4.2.2",
|
||||
"typescript": "^7.0.2"
|
||||
},
|
||||
|
||||
Generated
+2825
-336
File diff suppressed because it is too large
Load Diff
@@ -4,10 +4,11 @@
|
||||
"private": true,
|
||||
"description": "Locked CLI dependencies for the Docker wrap E2E harness",
|
||||
"dependencies": {
|
||||
"@openai/codex": "0.158.0",
|
||||
"openclaw": "2026.9.6"
|
||||
"@openai/codex": "0.162.1",
|
||||
"openclaw": "2026.10.2"
|
||||
},
|
||||
"overrides": {
|
||||
"@modelcontextprotocol/sdk": "1.32.1"
|
||||
"@modelcontextprotocol/sdk": "1.32.1",
|
||||
"npm": "12.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,7 +403,7 @@ class BatchResultProcessor:
|
||||
"""Make Google/Gemini continuation call.
|
||||
|
||||
Note: Google format uses 'contents' not 'messages',
|
||||
and 'parts' format for messages.
|
||||
and 'parts' format for messages. Tools are already native Google Tool objects.
|
||||
"""
|
||||
model = request_context.model
|
||||
url = f"{self.api_urls['google']}/v1beta/models/{model}:generateContent"
|
||||
@@ -424,7 +424,7 @@ class BatchResultProcessor:
|
||||
|
||||
# Add tools
|
||||
if tools:
|
||||
body["tools"] = [{"functionDeclarations": tools}]
|
||||
body["tools"] = tools
|
||||
|
||||
response = await self.http_client.post(
|
||||
url,
|
||||
|
||||
@@ -44,6 +44,10 @@ try:
|
||||
del _os.environ[_leaked_key]
|
||||
del _env_snapshot, _os
|
||||
|
||||
# Probing an unknown model makes litellm print() its "Provider List"
|
||||
# banner to stdout, which corrupts `headroom perf --format json`.
|
||||
litellm.suppress_debug_info = True
|
||||
|
||||
LITELLM_AVAILABLE = True
|
||||
except ImportError:
|
||||
litellm = None # type: ignore[assignment]
|
||||
|
||||
@@ -59,6 +59,13 @@ _ACCUMULATED_FIELDS = {
|
||||
"input_json_delta": "_partial_json",
|
||||
"thinking_delta": "thinking",
|
||||
}
|
||||
# What a non-streaming Message carries for block types whose stream form adds
|
||||
# placeholders: a thinking ``content_block_start`` carries
|
||||
# ``estimated_tokens: null``, which the Message schema lacks.
|
||||
_MESSAGE_BLOCK_FIELDS: dict[str, frozenset[str]] = {
|
||||
"thinking": frozenset({"type", "thinking", "signature"}),
|
||||
"redacted_thinking": frozenset({"type", "data"}),
|
||||
}
|
||||
_KNOWN_MESSAGE_FIELDS = frozenset(
|
||||
{
|
||||
"id",
|
||||
@@ -421,7 +428,11 @@ def _response_from_events(frames: list[_SSEFrame]) -> _Reconstruction:
|
||||
response[key] = copy.deepcopy(delta[key])
|
||||
extensions.message_delta_delta.update(_extensions(delta, _MESSAGE_DELTA_FIELDS))
|
||||
if isinstance(usage, dict):
|
||||
response.setdefault("usage", {}).update(copy.deepcopy(usage))
|
||||
# Merged the way the Anthropic SDK's MessageStream does: a null
|
||||
# count here never overwrites the one message_start reported.
|
||||
response.setdefault("usage", {}).update(
|
||||
{key: copy.deepcopy(value) for key, value in usage.items() if value is not None}
|
||||
)
|
||||
for key in usage:
|
||||
if key not in extensions.message_delta_usage_keys:
|
||||
extensions.message_delta_usage_keys.append(key)
|
||||
@@ -682,3 +693,51 @@ def render_anthropic_sse_response(response: dict[str, Any]) -> list[bytes]:
|
||||
"""
|
||||
|
||||
return _render_known_response(response)
|
||||
|
||||
|
||||
def fold_anthropic_stream(raw_sse_bytes: bytes) -> dict[str, Any] | None:
|
||||
"""Fold a whole Anthropic event stream into the body ``stream: false`` returns.
|
||||
|
||||
Blocks are accumulated as the Anthropic SDK's ``MessageStream`` does (see
|
||||
``_response_from_events``), then trimmed to the non-streaming Message
|
||||
shape: a null member leaves every block, and thinking blocks keep only
|
||||
their schema. The proxy's own continuations resend these blocks as
|
||||
history, and Anthropic rejects a block carrying a stream-only member with
|
||||
400 "Extra inputs are not permitted".
|
||||
|
||||
Args:
|
||||
raw_sse_bytes: The complete Anthropic SSE reply.
|
||||
|
||||
Returns:
|
||||
The Message; the stream's ``error`` event when it carried one (the
|
||||
same shape as an Anthropic HTTP error body); or None when the stream
|
||||
ended before ``message_stop`` or with a block still open.
|
||||
|
||||
Raises:
|
||||
ValueError: The stream is complete but holds a known event this
|
||||
module cannot fold, such as a delta type it does not know.
|
||||
"""
|
||||
|
||||
envelope = AnthropicSSEEnvelope.parse(raw_sse_bytes)
|
||||
if envelope.saw_error:
|
||||
for raw in _split_frames(raw_sse_bytes):
|
||||
event_type, payload = _json_payload(raw)
|
||||
if event_type == "error" and payload is not None:
|
||||
return payload
|
||||
if not envelope.is_complete():
|
||||
return None
|
||||
if envelope.saw_unreconstructable_frame:
|
||||
raise ValueError("the event stream holds a frame that cannot be folded")
|
||||
message = envelope.message
|
||||
content = []
|
||||
for block in message["content"]:
|
||||
fields = _MESSAGE_BLOCK_FIELDS.get(block.get("type"))
|
||||
content.append(
|
||||
{
|
||||
key: value
|
||||
for key, value in block.items()
|
||||
if value is not None and (fields is None or key in fields)
|
||||
}
|
||||
)
|
||||
message["content"] = content
|
||||
return message
|
||||
|
||||
@@ -76,18 +76,21 @@ class BufferedCCRErrorFormat:
|
||||
heartbeat: bytes
|
||||
|
||||
|
||||
# The wire types Anthropic documents; clients switch their retry behaviour
|
||||
# on these, so a 429 must not arrive labelled `api_error`.
|
||||
ANTHROPIC_ERROR_TYPES: dict[int, str] = {
|
||||
400: "invalid_request_error",
|
||||
401: "authentication_error",
|
||||
403: "permission_error",
|
||||
404: "not_found_error",
|
||||
413: "request_too_large",
|
||||
429: "rate_limit_error",
|
||||
529: "overloaded_error",
|
||||
}
|
||||
|
||||
|
||||
def _anthropic_error_type(status: int) -> str:
|
||||
# The wire types Anthropic documents; clients switch their retry behaviour
|
||||
# on these, so a 429 must not arrive labelled `api_error`.
|
||||
return {
|
||||
400: "invalid_request_error",
|
||||
401: "authentication_error",
|
||||
403: "permission_error",
|
||||
404: "not_found_error",
|
||||
413: "request_too_large",
|
||||
429: "rate_limit_error",
|
||||
529: "overloaded_error",
|
||||
}.get(status, "api_error")
|
||||
return ANTHROPIC_ERROR_TYPES.get(status, "api_error")
|
||||
|
||||
|
||||
def _openai_error_type(status: int) -> str:
|
||||
|
||||
@@ -12,9 +12,9 @@ import logging
|
||||
import os
|
||||
import time
|
||||
import uuid
|
||||
from collections.abc import Callable
|
||||
from collections.abc import Awaitable, Callable
|
||||
from datetime import datetime
|
||||
from functools import lru_cache
|
||||
from functools import lru_cache, partial
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any
|
||||
from urllib.parse import urlsplit
|
||||
@@ -40,6 +40,7 @@ from headroom.pipeline import PipelineStage, summarize_routing_markers
|
||||
from headroom.proxy import public_errors
|
||||
from headroom.proxy.anthropic_wire import (
|
||||
build_anthropic_upstream_url,
|
||||
fold_anthropic_stream,
|
||||
is_safeguard_capable_request,
|
||||
preserve_opaque_response_fields,
|
||||
strip_safeguard_payload,
|
||||
@@ -51,6 +52,7 @@ from headroom.proxy.auth_mode import (
|
||||
)
|
||||
from headroom.proxy.buffered_ccr_response import (
|
||||
ANTHROPIC_ERROR_FORMAT,
|
||||
ANTHROPIC_ERROR_TYPES,
|
||||
DEFAULT_BUFFERED_CCR_GRACE_SECONDS,
|
||||
buffered_ccr_asgi_call,
|
||||
)
|
||||
@@ -402,6 +404,87 @@ class AnthropicHandlerMixin:
|
||||
)
|
||||
return httpx.Response(200, json=parsed, headers=headers)
|
||||
|
||||
async def _send_buffered_as_stream(
|
||||
self,
|
||||
send: Callable[[dict[str, str], dict[str, Any]], Awaitable[httpx.Response]],
|
||||
headers: dict[str, str],
|
||||
body: dict[str, Any],
|
||||
*,
|
||||
url: str,
|
||||
request_id: str,
|
||||
) -> httpx.Response:
|
||||
"""Send a non-streaming request Headroom built as a stream, and fold the reply.
|
||||
|
||||
The buffered CCR path flips a streaming turn to ``stream: false`` so the
|
||||
whole reply is in hand before server-side retrieval, and the CCR, memory
|
||||
and turn-hook continuations are built from that body. Upstream then
|
||||
sends nothing until the generation is complete, and a network that
|
||||
drops HTTP connections idle for ~60s (TLS-inspecting antivirus, VPN,
|
||||
corporate proxy; TCP keepalive does not reset an HTTP idle timer) cuts
|
||||
every long turn: each retry fails at ~60s and the client gets a 502 it
|
||||
resends forever. Asked for as a stream, upstream sends deltas and pings
|
||||
for the whole generation; folded, the reply is the same Message JSON the
|
||||
caller already reads.
|
||||
|
||||
``send(headers, body)`` makes one upstream call. A reply that is not a
|
||||
200 event stream (an HTTP error, or an upstream that answered JSON
|
||||
anyway) is returned unchanged. A connection dropped mid-stream raises
|
||||
inside ``send``, as it does for a ``stream: false`` reply; a stream that
|
||||
ends early gets the 502 of ``_adapt_event_stream_to_json``; an in-band
|
||||
``error`` event comes back with its HTTP status. A complete stream this
|
||||
proxy cannot fold is answered by sending the original ``stream: false``
|
||||
body instead, so it costs one more generation rather than a 502 the
|
||||
client would resend forever.
|
||||
|
||||
First-party Anthropic only: a gateway's event stream is not something
|
||||
the fold has been checked against. Kill switch:
|
||||
``HEADROOM_BUFFERED_UPSTREAM_STREAM=0``, a runtime-env knob, so
|
||||
``headroom wrap`` also pushes it to a reused proxy.
|
||||
"""
|
||||
from headroom.providers.claude.runtime import is_custom_anthropic_base_url
|
||||
from headroom.proxy import runtime_env
|
||||
|
||||
if (
|
||||
body.get("stream")
|
||||
or is_custom_anthropic_base_url(url)
|
||||
or runtime_env.getenv("HEADROOM_BUFFERED_UPSTREAM_STREAM", "1").strip().lower()
|
||||
in ("0", "false", "no", "off")
|
||||
):
|
||||
return await send(headers, body)
|
||||
|
||||
stream_headers = {k: v for k, v in headers.items() if k.lower() != "accept"}
|
||||
stream_headers["accept"] = "text/event-stream"
|
||||
response = await send(stream_headers, {**body, "stream": True})
|
||||
if response.status_code != 200 or not _looks_like_sse_response(response):
|
||||
return response
|
||||
try:
|
||||
folded = fold_anthropic_stream(response.content)
|
||||
except ValueError as exc:
|
||||
logger.warning(
|
||||
f"[{request_id}] Could not fold the upstream event stream ({exc}); "
|
||||
"sending the request again as stream:false"
|
||||
)
|
||||
return await send(headers, body)
|
||||
if folded is None:
|
||||
# Ended early: the strict 502 any truncated reply here gets (#3266).
|
||||
return self._adapt_event_stream_to_json(response, request_id)
|
||||
|
||||
status_code = 200
|
||||
if folded.get("type") == "error":
|
||||
error_type = (folded.get("error") or {}).get("type")
|
||||
status_code = {name: code for code, name in ANTHROPIC_ERROR_TYPES.items()}.get(
|
||||
error_type, 500
|
||||
)
|
||||
logger.warning(
|
||||
f"[{request_id}] Upstream event stream carried an in-band "
|
||||
f"{error_type!r} error; answering {status_code}"
|
||||
)
|
||||
return httpx.Response(
|
||||
status_code,
|
||||
json=folded,
|
||||
headers=sanitize_forwarded_response_headers(response.headers, "content-type"),
|
||||
)
|
||||
|
||||
async def _count_tokens_offloaded(self, model, messages): # noqa: ANN001, ANN201
|
||||
from headroom.proxy.token_counting import count_tokens_offloaded
|
||||
|
||||
@@ -4212,11 +4295,10 @@ class AnthropicHandlerMixin:
|
||||
|
||||
async def _buffered_ccr_operation():
|
||||
async with stage_timer.measure("upstream_connect"):
|
||||
response = await self._retry_request(
|
||||
send_upstream = partial(
|
||||
self._retry_request,
|
||||
"POST",
|
||||
url,
|
||||
headers,
|
||||
body,
|
||||
original_body_bytes=original_body_bytes,
|
||||
body_mutated=body_mutation_tracker.mutated,
|
||||
mutation_reasons=body_mutation_tracker.reasons,
|
||||
@@ -4225,6 +4307,14 @@ class AnthropicHandlerMixin:
|
||||
path_for_log="/v1/messages",
|
||||
timeout=self._anthropic_buffered_request_timeout(),
|
||||
)
|
||||
# Only the CCR flip goes out as a stream: a client's
|
||||
# own stream:false request keeps its bytes.
|
||||
if buffered_stream_ccr:
|
||||
response = await self._send_buffered_as_stream(
|
||||
send_upstream, headers, body, url=url, request_id=request_id
|
||||
)
|
||||
else:
|
||||
response = await send_upstream(headers, body)
|
||||
self.pipeline_extensions.emit(
|
||||
PipelineStage.POST_SEND,
|
||||
operation="proxy.request",
|
||||
@@ -4520,13 +4610,6 @@ class AnthropicHandlerMixin:
|
||||
)
|
||||
from headroom.proxy.helpers import log_outbound_request
|
||||
|
||||
ccr_outbound_bytes, ccr_outbound_source = (
|
||||
prepare_outbound_body_bytes(
|
||||
body=continuation_body,
|
||||
original_body_bytes=None,
|
||||
body_mutated=True,
|
||||
)
|
||||
)
|
||||
# A continuation is a non-streaming call, so it
|
||||
# needs a matching Accept for the same reason the
|
||||
# buffered flip above does (#3078).
|
||||
@@ -4537,23 +4620,43 @@ class AnthropicHandlerMixin:
|
||||
}
|
||||
ccr_outbound_headers["content-type"] = "application/json"
|
||||
ccr_outbound_headers["accept"] = "application/json"
|
||||
log_outbound_request(
|
||||
forwarder="anthropic_ccr_continuation",
|
||||
method="POST",
|
||||
path=url,
|
||||
body_bytes_count=len(ccr_outbound_bytes),
|
||||
body_mutated=True,
|
||||
mutation_reasons=["ccr_continuation"],
|
||||
request_id=request_id,
|
||||
source=ccr_outbound_source,
|
||||
)
|
||||
try:
|
||||
cont_response = await self.http_client.post(
|
||||
|
||||
async def _post_continuation(
|
||||
send_headers: dict[str, str], send_body: dict[str, Any]
|
||||
) -> httpx.Response:
|
||||
assert self.http_client is not None
|
||||
ccr_outbound_bytes, ccr_outbound_source = (
|
||||
prepare_outbound_body_bytes(
|
||||
body=send_body,
|
||||
original_body_bytes=None,
|
||||
body_mutated=True,
|
||||
)
|
||||
)
|
||||
log_outbound_request(
|
||||
forwarder="anthropic_ccr_continuation",
|
||||
method="POST",
|
||||
path=url,
|
||||
body_bytes_count=len(ccr_outbound_bytes),
|
||||
body_mutated=True,
|
||||
mutation_reasons=["ccr_continuation"],
|
||||
request_id=request_id,
|
||||
source=ccr_outbound_source,
|
||||
)
|
||||
return await self.http_client.post(
|
||||
url,
|
||||
content=ccr_outbound_bytes,
|
||||
headers=ccr_outbound_headers,
|
||||
headers=send_headers,
|
||||
timeout=self._anthropic_buffered_request_timeout(),
|
||||
)
|
||||
|
||||
try:
|
||||
cont_response = await self._send_buffered_as_stream(
|
||||
_post_continuation,
|
||||
ccr_outbound_headers,
|
||||
continuation_body,
|
||||
url=url,
|
||||
request_id=request_id,
|
||||
)
|
||||
logger.info(
|
||||
f"CCR: Got response status={cont_response.status_code}, "
|
||||
f"content-encoding={cont_response.headers.get('content-encoding')}"
|
||||
@@ -4758,12 +4861,17 @@ class AnthropicHandlerMixin:
|
||||
if tools:
|
||||
continuation_body["tools"] = tools
|
||||
|
||||
cont_response = await self._retry_request(
|
||||
"POST",
|
||||
url,
|
||||
cont_response = await self._send_buffered_as_stream(
|
||||
partial(
|
||||
self._retry_request,
|
||||
"POST",
|
||||
url,
|
||||
timeout=self._anthropic_buffered_request_timeout(),
|
||||
),
|
||||
headers,
|
||||
continuation_body,
|
||||
timeout=self._anthropic_buffered_request_timeout(),
|
||||
url=url,
|
||||
request_id=request_id,
|
||||
)
|
||||
|
||||
# Update response with continuation
|
||||
@@ -4800,12 +4908,17 @@ class AnthropicHandlerMixin:
|
||||
hook_messages: list[dict[str, Any]],
|
||||
) -> dict[str, Any]:
|
||||
continuation_body = {**body, "messages": hook_messages}
|
||||
continuation_response = await self._retry_request(
|
||||
"POST",
|
||||
url,
|
||||
continuation_response = await self._send_buffered_as_stream(
|
||||
partial(
|
||||
self._retry_request,
|
||||
"POST",
|
||||
url,
|
||||
timeout=self._anthropic_buffered_request_timeout(),
|
||||
),
|
||||
headers,
|
||||
continuation_body,
|
||||
timeout=self._anthropic_buffered_request_timeout(),
|
||||
url=url,
|
||||
request_id=request_id,
|
||||
)
|
||||
continuation_json = continuation_response.json()
|
||||
_hook_usage.record(continuation_json)
|
||||
|
||||
@@ -374,6 +374,7 @@ class BatchHandlerMixin:
|
||||
await self._store_google_batch_context(
|
||||
batch_name,
|
||||
requests_list,
|
||||
compressed_requests,
|
||||
model,
|
||||
api_key,
|
||||
)
|
||||
@@ -619,6 +620,7 @@ class BatchHandlerMixin:
|
||||
self,
|
||||
batch_name: str,
|
||||
requests_list: list[dict[str, Any]],
|
||||
forwarded_requests: list[dict[str, Any]],
|
||||
model: str,
|
||||
api_key: str | None,
|
||||
) -> None:
|
||||
@@ -627,6 +629,7 @@ class BatchHandlerMixin:
|
||||
Args:
|
||||
batch_name: The batch name from the API response.
|
||||
requests_list: The original batch requests.
|
||||
forwarded_requests: Effective requests with any injected native tools.
|
||||
model: The model used for the batch.
|
||||
api_key: The API key for continuation calls.
|
||||
"""
|
||||
@@ -640,7 +643,7 @@ class BatchHandlerMixin:
|
||||
api_base_url=self.GEMINI_API_URL,
|
||||
)
|
||||
|
||||
for batch_req in requests_list:
|
||||
for batch_req, forwarded_req in zip(requests_list, forwarded_requests, strict=True):
|
||||
metadata = batch_req.get("metadata", {})
|
||||
custom_id = metadata.get("key", "")
|
||||
req_content = batch_req.get("request", {})
|
||||
@@ -661,7 +664,7 @@ class BatchHandlerMixin:
|
||||
BatchRequestContext(
|
||||
custom_id=custom_id,
|
||||
messages=messages,
|
||||
tools=req_content.get("tools"),
|
||||
tools=forwarded_req.get("request", {}).get("tools"),
|
||||
model=model,
|
||||
system_instruction=sys_text,
|
||||
)
|
||||
|
||||
@@ -36,3 +36,17 @@ def is_token_mode(mode: str | None) -> bool:
|
||||
def is_cache_mode(mode: str | None) -> bool:
|
||||
"""Return True when mode resolves to cache mode."""
|
||||
return normalize_proxy_mode(mode) == PROXY_MODE_CACHE
|
||||
|
||||
|
||||
def read_maturation_inert_reason(
|
||||
mode: str | None, *, quiesce_turns: int, max_hold_turns: int
|
||||
) -> str | None:
|
||||
"""Why read maturation can never fire under ``mode``, else None.
|
||||
|
||||
Cache mode freezes every turn but the latest, and maturation skips frozen
|
||||
messages. A Read in the latest turn has had no quiet turns yet, so it is
|
||||
held unless a threshold is 0; by the time it could quiesce it is frozen.
|
||||
"""
|
||||
if is_cache_mode(mode) and quiesce_turns > 0 and max_hold_turns > 0:
|
||||
return "cache mode freezes a Read before it can quiesce"
|
||||
return None
|
||||
|
||||
@@ -84,6 +84,12 @@ RUNTIME_ENV_KNOBS: tuple[Knob, ...] = (
|
||||
"int",
|
||||
"Max on-disk file size (bytes) the disk-verify fallback will read.",
|
||||
),
|
||||
Knob(
|
||||
"HEADROOM_BUFFERED_UPSTREAM_STREAM",
|
||||
"bool",
|
||||
"Send buffered CCR requests upstream as stream:true and fold the reply "
|
||||
"(default on; 0 sends stream:false).",
|
||||
),
|
||||
)
|
||||
|
||||
_KNOBS_BY_ENV: dict[str, Knob] = {k.env: k for k in RUNTIME_ENV_KNOBS}
|
||||
|
||||
@@ -163,6 +163,7 @@ from headroom.proxy.modes import (
|
||||
PROXY_MODE_TOKEN,
|
||||
is_token_mode,
|
||||
normalize_proxy_mode,
|
||||
read_maturation_inert_reason,
|
||||
)
|
||||
from headroom.proxy.orphan_watchdog import (
|
||||
orphan_grace_seconds,
|
||||
@@ -2037,7 +2038,11 @@ class HeadroomProxy(
|
||||
backend,
|
||||
)
|
||||
|
||||
threading.Thread(target=_warm, name="kompress-warmup", daemon=True).start()
|
||||
from headroom.transforms.kompress_compressor import start_kompress_warmup_thread
|
||||
|
||||
# Registered as the model's loader, so a request during the warm-up
|
||||
# doesn't start a second load thread.
|
||||
start_kompress_warmup_thread(compressor.config.model_id, _warm)
|
||||
return True
|
||||
|
||||
async def startup(self):
|
||||
@@ -2092,6 +2097,25 @@ class HeadroomProxy(
|
||||
if self.config.mode == PROXY_MODE_CACHE:
|
||||
logger.info(" Prefix freeze: strict (all prior turns immutable)")
|
||||
logger.info(" Mutations: latest turn only")
|
||||
if self.config.read_maturation:
|
||||
_inert = read_maturation_inert_reason(
|
||||
self.config.mode,
|
||||
quiesce_turns=self.config.read_maturation_quiesce_turns,
|
||||
max_hold_turns=self.config.read_maturation_max_hold_turns,
|
||||
)
|
||||
if _inert:
|
||||
logger.warning(
|
||||
"Read maturation: INERT (%s); use --mode token or disable read_maturation",
|
||||
_inert,
|
||||
)
|
||||
else:
|
||||
logger.info(
|
||||
"Read maturation: ENABLED (quiesce_turns=%d max_hold_turns=%d "
|
||||
"min_size_bytes=%d)",
|
||||
self.config.read_maturation_quiesce_turns,
|
||||
self.config.read_maturation_max_hold_turns,
|
||||
self.config.read_maturation_min_size_bytes,
|
||||
)
|
||||
# Effective compression posture, resolved (not merely requested). The
|
||||
# savings profile reaches the router through two paths — the config
|
||||
# object and the seeded process env — and `setdefault` semantics mean a
|
||||
@@ -2196,6 +2220,12 @@ class HeadroomProxy(
|
||||
self._kompress_status = eager_status["kompress"]
|
||||
if eager_status.get("code_aware") == "enabled":
|
||||
self._code_aware_status = "enabled"
|
||||
kompress_enabled = any(
|
||||
transform.config.enable_kompress
|
||||
for pipeline in (self.anthropic_pipeline, self.openai_pipeline)
|
||||
for transform in pipeline.transforms
|
||||
if isinstance(transform, ContentRouter)
|
||||
)
|
||||
|
||||
# Log component status
|
||||
if self._kompress_status == "enabled":
|
||||
@@ -2205,6 +2235,13 @@ class HeadroomProxy(
|
||||
logger.info("Kompress: DEFERRED (warming in the background after startup)")
|
||||
else:
|
||||
logger.info("Kompress: DEFERRED (model loads on first request)")
|
||||
elif not kompress_enabled and (
|
||||
self.config.optimize
|
||||
or self.config.disable_kompress
|
||||
or self.config.disable_kompress_anthropic is True
|
||||
or self.config.disable_kompress_openai is True
|
||||
):
|
||||
logger.info("Kompress: DISABLED")
|
||||
elif self.config.optimize:
|
||||
logger.info("Kompress: not installed (pip install headroom-ai[ml] for ML compression)")
|
||||
|
||||
@@ -5374,6 +5411,25 @@ def create_app(config: ProxyConfig | None = None) -> FastAPI:
|
||||
# Effective state from the running process. This is the supported
|
||||
# black-box provenance surface for benchmark/qualification tools.
|
||||
"rollout": proxy.config.rollout.to_dict() if proxy.config.rollout else None,
|
||||
"read_maturation": _read_maturation_status(proxy.config),
|
||||
}
|
||||
|
||||
def _read_maturation_status(cfg: ProxyConfig) -> dict[str, Any]:
|
||||
# The rollout snapshot says whether the feature is enabled, not whether
|
||||
# it can act; cache mode leaves it enabled but unable to fire.
|
||||
inert = (
|
||||
read_maturation_inert_reason(
|
||||
cfg.mode,
|
||||
quiesce_turns=cfg.read_maturation_quiesce_turns,
|
||||
max_hold_turns=cfg.read_maturation_max_hold_turns,
|
||||
)
|
||||
if cfg.read_maturation
|
||||
else None
|
||||
)
|
||||
return {
|
||||
"enabled": cfg.read_maturation,
|
||||
"effective": cfg.read_maturation and inert is None,
|
||||
"inert_reason": inert,
|
||||
}
|
||||
|
||||
def _dashboard_config_payload() -> dict[str, Any]:
|
||||
|
||||
@@ -256,19 +256,21 @@ def destination_listed(
|
||||
return (scheme, host.lower(), port) in origins
|
||||
|
||||
|
||||
# RFC 6052 / RFC 8215: these IPv6 prefixes embed an IPv4 address in their low
|
||||
# 32 bits, and `ipaddress` reports the well-known one as globally routable. On a
|
||||
# NAT64 network `64:ff9b::7f00:1` reaches 127.0.0.1, so the embedded address is
|
||||
# what has to be judged. 6to4, Teredo and IPv4-mapped forms are already caught
|
||||
# by the `is_global` test below.
|
||||
_NAT64_PREFIXES = (
|
||||
ipaddress.IPv6Network("64:ff9b::/96"),
|
||||
ipaddress.IPv6Network("64:ff9b:1::/48"),
|
||||
)
|
||||
# RFC 6052 well-known prefix. A DNS64 resolver answers a host that has only an
|
||||
# A record with `64:ff9b::<its IPv4>`, and the NAT64 translator delivers that to
|
||||
# the IPv4 address in the low 32 bits, so the embedded address is what has to
|
||||
# be judged: `64:ff9b::7f00:1` reaches 127.0.0.1. It has to be judged *before*
|
||||
# the category checks, because `ipaddress` calls the whole prefix reserved (it
|
||||
# sits in ::/8) -- judging the IPv6 form rejected every IPv4-only upstream on a
|
||||
# DNS64 network. The local-use prefix (RFC 8215, 64:ff9b:1::/48) is not
|
||||
# unwrapped: where its IPv4 bits sit depends on the operator's prefix length,
|
||||
# so it stays rejected as non-global. 6to4, Teredo and IPv4-mapped forms are
|
||||
# already caught by the `is_global` test below.
|
||||
_NAT64_WELL_KNOWN_PREFIX = ipaddress.IPv6Network("64:ff9b::/96")
|
||||
|
||||
|
||||
def _nat64_embedded_ipv4(addr: ipaddress.IPv6Address) -> ipaddress.IPv4Address | None:
|
||||
if not any(addr in prefix for prefix in _NAT64_PREFIXES):
|
||||
if addr not in _NAT64_WELL_KNOWN_PREFIX:
|
||||
return None
|
||||
try:
|
||||
return ipaddress.IPv4Address(int(addr) & 0xFFFFFFFF)
|
||||
@@ -281,6 +283,10 @@ def _is_internal_address(ip: str) -> bool:
|
||||
addr = ipaddress.ip_address(ip)
|
||||
except ValueError:
|
||||
return True # unparseable (e.g. scoped link-local) -> treat as unsafe
|
||||
if isinstance(addr, ipaddress.IPv6Address):
|
||||
embedded = _nat64_embedded_ipv4(addr)
|
||||
if embedded is not None:
|
||||
return _is_internal_address(str(embedded))
|
||||
if (
|
||||
addr.is_private
|
||||
or addr.is_loopback
|
||||
@@ -298,10 +304,6 @@ def _is_internal_address(ip: str) -> bool:
|
||||
# learns about.
|
||||
if not addr.is_global:
|
||||
return True
|
||||
if isinstance(addr, ipaddress.IPv6Address):
|
||||
embedded = _nat64_embedded_ipv4(addr)
|
||||
if embedded is not None and _is_internal_address(str(embedded)):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
||||
@@ -2742,6 +2742,21 @@ class ContentRouter(Transform):
|
||||
except Exception:
|
||||
return True
|
||||
|
||||
@staticmethod
|
||||
def _kompress_load_in_progress(compressor: Any) -> bool:
|
||||
"""Whether a background thread is still fetching or loading ``compressor``'s model.
|
||||
|
||||
Compressors without ``is_loading`` (the remote one is always ready,
|
||||
test doubles) count as not loading.
|
||||
"""
|
||||
is_loading = getattr(compressor, "is_loading", None)
|
||||
if is_loading is None:
|
||||
return False
|
||||
try:
|
||||
return bool(is_loading())
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def _record_to_toin(
|
||||
self,
|
||||
strategy: CompressionStrategy,
|
||||
@@ -4725,10 +4740,22 @@ class ContentRouter(Transform):
|
||||
if compressor:
|
||||
if not compressor.is_ready():
|
||||
compressor.ensure_background_load()
|
||||
# Surface: warn once per ContentRouter instance so operators
|
||||
# know compression is degraded — model not cached, or
|
||||
# HuggingFace unreachable (corporate firewall, SSL, etc.).
|
||||
if not getattr(self, "_kompress_warned", False):
|
||||
# Surface once per ContentRouter instance that requests pass
|
||||
# through uncompressed. While a thread is still fetching or
|
||||
# loading the model (the post-startup warm-up, or the
|
||||
# download just started above) that is expected, so say it
|
||||
# at INFO. With no loader running, e.g. a failed download
|
||||
# in its retry backoff, compression is degraded: warn and
|
||||
# name the usual causes (_background_download has already
|
||||
# logged the actual error).
|
||||
if self._kompress_load_in_progress(compressor):
|
||||
if not getattr(self, "_kompress_loading_noted", False):
|
||||
logger.info(
|
||||
"Kompress model still loading in the background; "
|
||||
"requests pass through uncompressed until it is ready."
|
||||
)
|
||||
self._kompress_loading_noted = True
|
||||
elif not getattr(self, "_kompress_warned", False) and not compressor.is_ready():
|
||||
logger.warning(
|
||||
"Kompress model not ready; requests will not be "
|
||||
"compressed. Check HuggingFace connectivity or "
|
||||
|
||||
@@ -23,6 +23,7 @@ import os
|
||||
import re
|
||||
import threading
|
||||
import time
|
||||
from collections.abc import Callable, Iterator
|
||||
from dataclasses import dataclass
|
||||
from functools import lru_cache
|
||||
from typing import Any, Literal
|
||||
@@ -797,8 +798,46 @@ def _smoke_run(session: Any) -> None:
|
||||
)
|
||||
|
||||
|
||||
#: Per-stage load cost: stage name -> (wall-clock ms, loading-thread CPU ms).
|
||||
StageTimings = dict[str, tuple[float, float]]
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _timed_stage(stage_ms: StageTimings | None, stage: str) -> Iterator[None]:
|
||||
"""Add the block's wall-clock and thread-CPU milliseconds to ``stage_ms[stage]``.
|
||||
|
||||
Accumulates rather than overwrites, so a stage that runs once per ONNX
|
||||
candidate reports the cost of every attempt, failed ones included. Records
|
||||
on exceptions too. A no-op when ``stage_ms`` is ``None``.
|
||||
|
||||
CPU is this thread's only (``time.thread_time``): work on onnxruntime's own
|
||||
worker threads is not counted, and wall far above CPU means the thread was
|
||||
waiting (disk, the GIL, a lock) rather than working.
|
||||
"""
|
||||
if stage_ms is None:
|
||||
yield
|
||||
return
|
||||
wall_started = time.perf_counter()
|
||||
cpu_started = time.thread_time()
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
wall_ms = (time.perf_counter() - wall_started) * 1000.0
|
||||
cpu_ms = (time.thread_time() - cpu_started) * 1000.0
|
||||
prev_wall, prev_cpu = stage_ms.get(stage, (0.0, 0.0))
|
||||
stage_ms[stage] = (prev_wall + wall_ms, prev_cpu + cpu_ms)
|
||||
|
||||
|
||||
def _format_stage_ms(stage_ms: StageTimings) -> str:
|
||||
return " ".join(f"{stage}={wall:.0f}/{cpu:.0f}" for stage, (wall, cpu) in stage_ms.items())
|
||||
|
||||
|
||||
def _create_onnx_session(
|
||||
model_id: str, providers: list[Any], *, allow_download: bool = True
|
||||
model_id: str,
|
||||
providers: list[Any],
|
||||
*,
|
||||
allow_download: bool = True,
|
||||
stage_ms: StageTimings | None = None,
|
||||
) -> Any:
|
||||
"""Resolve and load the model's ONNX artifact, trying candidates in order.
|
||||
|
||||
@@ -812,6 +851,10 @@ def _create_onnx_session(
|
||||
cache only; if none is cached, :class:`KompressModelNotCached` is raised
|
||||
instead of hitting the network. ``onnxruntime`` is imported only after a
|
||||
candidate resolves, so a cache-only miss never requires it.
|
||||
|
||||
``stage_ms``, when given, accumulates the cost of ``artifact_resolve``,
|
||||
``onnxruntime_import``, ``session_build`` and ``smoke_run`` across every
|
||||
candidate tried. See :func:`_timed_stage`.
|
||||
"""
|
||||
last_err: Exception | None = None
|
||||
cache_miss = False
|
||||
@@ -819,9 +862,10 @@ def _create_onnx_session(
|
||||
ort: Any = None
|
||||
for filename in _onnx_filename_candidates():
|
||||
try:
|
||||
onnx_path = _hf_artifact(
|
||||
model_id, filename, allow_network=allow_download and refused is None
|
||||
)
|
||||
with _timed_stage(stage_ms, "artifact_resolve"):
|
||||
onnx_path = _hf_artifact(
|
||||
model_id, filename, allow_network=allow_download and refused is None
|
||||
)
|
||||
except KompressModelNotCached as exc:
|
||||
# Only _hf_artifact's air-gap translation raises this here. It says
|
||||
# THIS candidate is not cached; a later one may be. Keep looking,
|
||||
@@ -834,16 +878,19 @@ def _create_onnx_session(
|
||||
logger.debug("ONNX artifact %r unavailable for %s: %s", filename, model_id, exc)
|
||||
continue
|
||||
if ort is None:
|
||||
import onnxruntime
|
||||
with _timed_stage(stage_ms, "onnxruntime_import"):
|
||||
import onnxruntime
|
||||
|
||||
ort = onnxruntime
|
||||
try:
|
||||
session = ort.InferenceSession(
|
||||
onnx_path,
|
||||
_onnx_session_options(ort),
|
||||
providers=providers,
|
||||
)
|
||||
_smoke_run(session)
|
||||
with _timed_stage(stage_ms, "session_build"):
|
||||
session = ort.InferenceSession(
|
||||
onnx_path,
|
||||
_onnx_session_options(ort),
|
||||
providers=providers,
|
||||
)
|
||||
with _timed_stage(stage_ms, "smoke_run"):
|
||||
_smoke_run(session)
|
||||
return session
|
||||
except Exception as exc:
|
||||
last_err = exc
|
||||
@@ -878,7 +925,12 @@ def _load_kompress_onnx(
|
||||
if model_id in _kompress_cache:
|
||||
return _kompress_cache[model_id]
|
||||
|
||||
logger.info("Downloading Kompress ONNX model from %s ...", model_id)
|
||||
# Logged before any cache lookup: the artifacts usually come from disk
|
||||
# (startup prefetch), and _hf_artifact goes to the Hub only on a miss.
|
||||
logger.info("Loading Kompress ONNX model from %s ...", model_id)
|
||||
load_started = time.perf_counter()
|
||||
load_cpu_started = time.thread_time()
|
||||
stage_ms: StageTimings = {}
|
||||
|
||||
backend = "onnx_coreml" if use_coreml else "onnx"
|
||||
providers: list[Any]
|
||||
@@ -907,15 +959,26 @@ def _load_kompress_onnx(
|
||||
else:
|
||||
providers = ["CPUExecutionProvider"]
|
||||
|
||||
session = _create_onnx_session(model_id, providers, allow_download=allow_download)
|
||||
session = _create_onnx_session(
|
||||
model_id, providers, allow_download=allow_download, stage_ms=stage_ms
|
||||
)
|
||||
model = _OnnxModel(session)
|
||||
|
||||
from transformers import AutoTokenizer
|
||||
with _timed_stage(stage_ms, "transformers_import"):
|
||||
from transformers import AutoTokenizer
|
||||
|
||||
tokenizer = _load_modernbert_tokenizer(AutoTokenizer, allow_download=allow_download)
|
||||
with _timed_stage(stage_ms, "tokenizer_load"):
|
||||
tokenizer = _load_modernbert_tokenizer(AutoTokenizer, allow_download=allow_download)
|
||||
|
||||
_kompress_cache[model_id] = (model, tokenizer, backend)
|
||||
logger.info("Kompress ONNX loaded: %s backend=%s", model_id, backend)
|
||||
logger.info(
|
||||
"Kompress ONNX loaded: %s backend=%s total_ms=%.0f/%.0f stages_ms(wall/cpu): %s",
|
||||
model_id,
|
||||
backend,
|
||||
(time.perf_counter() - load_started) * 1000.0,
|
||||
(time.thread_time() - load_cpu_started) * 1000.0,
|
||||
_format_stage_ms(stage_ms),
|
||||
)
|
||||
return model, tokenizer, backend
|
||||
|
||||
|
||||
@@ -1341,6 +1404,48 @@ def ensure_background_download(model_id: str = HF_MODEL_ID, device: str = "auto"
|
||||
thread.start()
|
||||
|
||||
|
||||
def is_kompress_load_in_progress(model_id: str = HF_MODEL_ID) -> bool:
|
||||
"""True while a registered thread (prefetch, download or warm-up) is working on ``model_id``."""
|
||||
with _download_threads_lock:
|
||||
thread = _download_threads.get(model_id)
|
||||
return thread is not None and thread.is_alive()
|
||||
|
||||
|
||||
def start_kompress_warmup_thread(model_id: str, warm: Callable[[], None]) -> threading.Thread:
|
||||
"""Run ``warm`` on a daemon ``kompress-warmup`` thread registered as ``model_id``'s loader.
|
||||
|
||||
The proxy's post-startup warm-up loads the model on its own thread. Unless
|
||||
that thread is in the per-model registry, a request arriving mid-warm-up
|
||||
finds the model not ready, sees no live loader, and has
|
||||
:func:`ensure_background_download` start a second thread that only queues
|
||||
on ``_kompress_lock`` and then returns the warm-up's cache entry. Registered
|
||||
before it starts, so the warm-up's initial delay is covered too.
|
||||
|
||||
If a prefetch or download thread is already registered, the warm-up takes
|
||||
its place in the registry and waits for it to finish before running
|
||||
``warm``. Without the wait, a warm-up that failed while a startup prefetch
|
||||
was still downloading would leave the registry pointing at a dead thread,
|
||||
and the next request would start another download next to the hidden
|
||||
prefetch. Waiting also keeps the warm-up from fetching the same files at
|
||||
the same time. Once the warm-up finishes, a failed one included, the next
|
||||
:func:`ensure_background_download` call replaces the dead entry as usual.
|
||||
"""
|
||||
with _download_threads_lock:
|
||||
previous = _download_threads.get(model_id)
|
||||
|
||||
def _run() -> None:
|
||||
# Registry entries are always started threads, so join() is safe;
|
||||
# it returns at once for one that has already finished.
|
||||
if previous is not None:
|
||||
previous.join()
|
||||
warm()
|
||||
|
||||
thread = threading.Thread(target=_run, name="kompress-warmup", daemon=True)
|
||||
_download_threads[model_id] = thread
|
||||
thread.start()
|
||||
return thread
|
||||
|
||||
|
||||
def prefetch_kompress_artifacts(model_id: str = HF_MODEL_ID) -> bool:
|
||||
"""Download the model's ONNX artifact to the local cache. No native init.
|
||||
|
||||
@@ -1751,6 +1856,10 @@ class KompressCompressor(Transform):
|
||||
"""
|
||||
ensure_background_download(self.config.model_id, self.config.device)
|
||||
|
||||
def is_loading(self) -> bool:
|
||||
"""True while a background thread is fetching or loading this model."""
|
||||
return is_kompress_load_in_progress(self.config.model_id)
|
||||
|
||||
def compress(
|
||||
self,
|
||||
content: str,
|
||||
|
||||
Generated
+112
-112
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"name": "headroom-openclaw",
|
||||
"version": "0.39.1",
|
||||
"version": "0.41.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "headroom-openclaw",
|
||||
"version": "0.39.1",
|
||||
"version": "0.41.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"headroom-ai": "^0.39.1"
|
||||
"headroom-ai": "^0.40.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^26.1.1",
|
||||
@@ -509,9 +509,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-project/types": {
|
||||
"version": "0.151.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.151.0.tgz",
|
||||
"integrity": "sha512-J1yXrIlNDZVzE3ada310xeAw7nH8yCAyLPuUIsjKatFPmfn5bS1oW+cM+QsGOtVWd5nhSpbwZWx/rue+r5Z+PA==",
|
||||
"version": "0.153.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.153.0.tgz",
|
||||
"integrity": "sha512-jSNrRIyvPVLL5E1z/tS5zLAprosGz/FuI1PWwEOz59j3E4TTTzSpqKb/RDGqJhhW0QHYISGXxq582wGx6T11Tw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
@@ -520,9 +520,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm-eabi": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.11.tgz",
|
||||
"integrity": "sha512-A5kXfGKvKWWZE0TtPrfsvT+q4Y5d1QG8gGUzpYjGydM+fARM9MuX90PrXYXe0XbsDVgyxxNzHo6giCj90bsFNw==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.13.tgz",
|
||||
"integrity": "sha512-Vu/NICrgdRvUOeaJZIyB2FP63s6fO/4ud5l8dXmxDx9yDyn+mN0y+gsvsVviSli+T361Aqo0h46EuMoobrwawA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -538,9 +538,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.11.tgz",
|
||||
"integrity": "sha512-z6cTycz+iJ4PVkuL4HHW4DfTfoeU/2nqYYuSOrTmH7yHK5Y0LCOnA03V4ZNxavyVaU1oOqUgIg2klN/s+USGOA==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.13.tgz",
|
||||
"integrity": "sha512-6LEoIrGy5vvCd2boNnv2soPSUZj/PRvhp8R/t9KlX+mIZxThIE/ZqxrGXxmuNX0FuvQFvLdZr7S4HrYpYBVhEQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -556,9 +556,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-arm64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.11.tgz",
|
||||
"integrity": "sha512-jShvqNtP6vDC6/A5JOAzbVV+DkgHqhl/ScVCJEbt+TUY6QYz7YnXcrg3sLtFBniro0f/Ld50ZwCWA6f7KYD1nQ==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.13.tgz",
|
||||
"integrity": "sha512-CaJSRzlQ6Q+zkDMVA9OkVxBjVoPRCDEE3v0FSJ9kIQBgRjFApA3Si4ijhbNVUji7ZJt+PfO0e46qy4nPInHUPA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -574,9 +574,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-x64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.11.tgz",
|
||||
"integrity": "sha512-f2i2xiNWq1Z1l2++q2fuhZRdLAT3aqxD6vRNm1RAxpUoBcdqNB3C0s1Bt+K+PbEx2F5F4gQp6hqKkphCY/xF9w==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.13.tgz",
|
||||
"integrity": "sha512-e4r340I5hxSzJkD3YJBxgzq/rJ3wwxwdLLb2FPt1Zpyem20nrQPT11DDEEkazwxaHumH8wpglsp/Ozgj/wT6mw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -592,9 +592,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-freebsd-x64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.11.tgz",
|
||||
"integrity": "sha512-4Ir5FSOKIAMr4r0kExpt1s3bMgzJU3rA45AYOHtQpls0oNeqcYBKrWMlckrYH4KCfGLfkfn1tN1dmZPMVsdXow==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.13.tgz",
|
||||
"integrity": "sha512-hoBWDZ4/K/mJKVMbsgUd1jfpA2DiOrJ54mpegObU9TBHBBrtX4FLIXJJQRDPZ/2Dn91GvPob+Z2hwKJzf4E5SQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -610,9 +610,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm-gnueabihf": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.11.tgz",
|
||||
"integrity": "sha512-/gnRDM+39BROzAN/k1OZjDPnDMcZxB/0EUxKjONO5yVkNEvlsoMDrxGNKgZi/ttFriS2gwlDNzB65pvNbFOXIQ==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.13.tgz",
|
||||
"integrity": "sha512-oF9fZu3vTWnTiVAkDFxU9PJLt1nh20K9RRpuHsR7ZnE2L7XookBbDBVLojCVSLGbvtSlxeUNnjAj6DbNsKyzbg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -628,9 +628,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-PFaK8HwvAHbaKbBcDNQihjMKYvFnA5hiENx/l5tphTDz1E0WFp32l0A7aq7lyUwGsRw/xSrNIy/gIK4thrSCrw==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.13.tgz",
|
||||
"integrity": "sha512-DTpb/+jMiqWMPgphn4ksW1zW+XLJ6dJJ9FMvnIk9I291LhCctMPhMYJrP5t9p6C9qa3KXadDdUEZHBaPh3kNxQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -649,9 +649,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-musl": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.11.tgz",
|
||||
"integrity": "sha512-AskzJUIKRLPxkruR1wLKewGbOw+EYfU/9lOrBFj4AFrEA8hPpKFnODWNu2WLaNs0QNkEb9QIJufmVZZIL/bJlg==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.13.tgz",
|
||||
"integrity": "sha512-xU+Kvv9N2A3SY35zFh1FWWNjxbadE/BKeqnkXe7vScU4GZsw757BlVmDLITZEq8DPpk6m7uoDYkK7P+x/uU5Ow==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -670,9 +670,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-ppc64-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-qlUGAheh2yh8afH7QBgx0PrRHN85hKnNd78x8MeMhXivuevgd8vgf6/CstOzmNKY/lLTHvNTrPy98cLnAugzJw==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.13.tgz",
|
||||
"integrity": "sha512-XMk/hnhh25oQ756Lclb1Q11h4ll0xC0Esa5w4Vzp+mAE2S3AGJgeM0SonrIgY8fHhjarb6hcoTuwoFG0VVP2ig==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -691,9 +691,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-s390x-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-secpEad+0vCbSfn8upFySkDskv+bGPk3THSDS9Y89yc4rb4kzqHp8Dmyd9BkQW4SnhNXBZCl/6CrO//hZahNJQ==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.13.tgz",
|
||||
"integrity": "sha512-U1BoTHYmlywE2n3HUWjzZ+8EQsKr+OwpxYuDWaubx42tUL8QSL7nOqRz/NVHanibbFP3M1Rxuprz/wNcbMKjqw==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -712,9 +712,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-mOVBT3dPpkWm8XBWPmU4bf+U6dYDLeMo/9ojUmis4N0L5uu10qra5vOyngZ7/PSdoE4G9KvRt4bloRxNjLas7A==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.13.tgz",
|
||||
"integrity": "sha512-J4cm80Pc6wEwV5AZ42o62sIQgDk+Y7R2s646jIwuvO+4V46QB58N4vVuMPWCBaNgursXLpmUWJV//WQAkPvHBQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -733,9 +733,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-musl": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.11.tgz",
|
||||
"integrity": "sha512-Is78i9A8Ui4SqcxUwFJ9uMmjDn58IbVTjFWYdQestFEgeuEmHMLGNriXnVJKkwG2YiZjw8cP0zCTyDMdDGtOOg==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.13.tgz",
|
||||
"integrity": "sha512-W0euZS40U4V6JkmEnVCIX9mcsL6cbXQ4X8c2w+MMOIjFg68TXUW+u3RT+2e1t1pv9mg/EP3pDtK3POXdQ7Rxyw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -754,9 +754,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-openharmony-arm64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.11.tgz",
|
||||
"integrity": "sha512-dUCXneZ87INUMyQ0D+C0HrEBNUPNXHaPmU5GTjyKTJEiussw9Kaj5Ln8UztPe4epV/ffvgNBEadksdYhmW6xJA==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.13.tgz",
|
||||
"integrity": "sha512-do/AF/4n9MRshia3a5aXoy8xM2c6mgfT6D7H/dY6my5z+hfCIR4ab7mk4IRj++nsEQpKy39kd0DQnDq+r692tw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -772,9 +772,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-arm64-msvc": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.11.tgz",
|
||||
"integrity": "sha512-jByxb6qfd+bH1xUd0qnfFnb17i9sWBPY2tOavJ0l3tdr3OTu+Kvtm8cd/JV5nFt657b1VqGltxg9olOEfofXWw==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.13.tgz",
|
||||
"integrity": "sha512-6FtUf2cJZobutJdxnGYX8z0vtbgqU0b2v8vfBhkXb9wp2MppMFtkunE+IaOntyi01rkIQoPW2GHABtfzsC0BRQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -790,9 +790,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-x64-msvc": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.11.tgz",
|
||||
"integrity": "sha512-/PzKqzAJ03i19oy2ItPvyvaVjOjBCNnfaJs8yvUdGBKmiESgnrJSQ2awd81QzFbbnAmu7YO9ZnJrDCb9VSJPRA==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.13.tgz",
|
||||
"integrity": "sha512-UKhFaZTeTcbKrb3iU82m17jVcPEAoqDkCN5MBqgPyZSwp/cQmib21crTS0DdH7T1B7wZRWEI89YQAOJMet5yhg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1191,9 +1191,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "26.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.3.tgz",
|
||||
"integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==",
|
||||
"version": "26.6.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz",
|
||||
"integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1577,14 +1577,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/mocker": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.2.tgz",
|
||||
"integrity": "sha512-Z5FS00Q1SJHkB35xATsmWGdQ5WA1/0MV3CDjqyv7GavHv1OfOj145MNfHOlHk7QLes21dKFDHr8EO2zvL+9WGA==",
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.3.tgz",
|
||||
"integrity": "sha512-T8sWAIbkSyAjkwTcaEc3Iu0o9A27X1/kdXrizhZkGuSKScRQtRzclfAMpOTcGdXCsqxeWlpGy3XjqaW8CpLORg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "0.3.31",
|
||||
"@vitest/spy": "5.0.2",
|
||||
"@vitest/spy": "5.0.3",
|
||||
"estree-walker": "^3.0.3",
|
||||
"magic-string": "^1.2.3"
|
||||
},
|
||||
@@ -1605,9 +1605,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/mocker/node_modules/magic-string": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.2.tgz",
|
||||
"integrity": "sha512-vG+rjFRj1PqdIBozIxAGMjPlOhaVe+GXpbttY/iSK7rGcJRMlwNJO7dcUwmUqkymsFLJiNGI06t4D7Fr7yRC9g==",
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.3.tgz",
|
||||
"integrity": "sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1615,9 +1615,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/spy": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.2.tgz",
|
||||
"integrity": "sha512-Ijc7T1nT9efNb5LxvjaBrEqw3f/QwUv5EE0nKqZxgqsaV/FxAAZ8baGylA8X/Z2oS4Lp+K74Jr6dTJsDKxJDeg==",
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.3.tgz",
|
||||
"integrity": "sha512-XhFysQTB8AZ+P4gMi+Lpo99vg2AZi0qKpaB9yXQl37+CaMEAPO3iH/wGVnSyL5MPERiLezpqTVtrR6UZH5GCXg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -1877,9 +1877,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/headroom-ai": {
|
||||
"version": "0.39.1",
|
||||
"resolved": "https://registry.npmjs.org/headroom-ai/-/headroom-ai-0.39.1.tgz",
|
||||
"integrity": "sha512-jMItSdHA444lCXxibw/XlyhPt9vp09LuLgLNVG6/1Ay0lOZEUhrwlezsMMhr98RMgIe9AejhIQef91cvUgiWgA==",
|
||||
"version": "0.40.0",
|
||||
"resolved": "https://registry.npmjs.org/headroom-ai/-/headroom-ai-0.40.0.tgz",
|
||||
"integrity": "sha512-WbvzoywojL0nO+vyzC8Dxzmvq7y6PeBUaZ7pOe377DW1gw3eYKfuxhEGQzsT4G6OtW+SaLOtWOtFsaEdpnatcQ==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
@@ -2273,9 +2273,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.18",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",
|
||||
"integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==",
|
||||
"version": "3.3.20",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
||||
"integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -2366,9 +2366,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.28",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz",
|
||||
"integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==",
|
||||
"version": "8.5.29",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.29.tgz",
|
||||
"integrity": "sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -2387,9 +2387,9 @@
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.18",
|
||||
"nanoid": "^3.3.19",
|
||||
"picocolors": "^1.1.1",
|
||||
"source-map-js": "^1.2.1"
|
||||
"source-map-js": "^1.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
@@ -2463,14 +2463,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rolldown": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.11.tgz",
|
||||
"integrity": "sha512-qpSwIyz0jHQq5qXBTNxFmE6664rJ7O+4TvPFOiOaBSrz8IOHc1koKKSqTM2H6u1UG1+TveuC6vaDHKXFOvb1Kw==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.13.tgz",
|
||||
"integrity": "sha512-/5apOkwWxtACcQtZ5WlrAsKS4JwXVThQPJZ3RqIruRY9UG9M8e0VlXN068xum/JRKA4aIUoJ13ghe/kGCvidiQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "=0.151.0",
|
||||
"@oxc-project/types": "=0.153.0",
|
||||
"@rolldown/pluginutils": "^1.0.0"
|
||||
},
|
||||
"bin": {
|
||||
@@ -2480,21 +2480,21 @@
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rolldown/binding-android-arm-eabi": "1.2.11",
|
||||
"@rolldown/binding-android-arm64": "1.2.11",
|
||||
"@rolldown/binding-darwin-arm64": "1.2.11",
|
||||
"@rolldown/binding-darwin-x64": "1.2.11",
|
||||
"@rolldown/binding-freebsd-x64": "1.2.11",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.2.11",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.2.11",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-x64-musl": "1.2.11",
|
||||
"@rolldown/binding-openharmony-arm64": "1.2.11",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.2.11",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.2.11"
|
||||
"@rolldown/binding-android-arm-eabi": "1.2.13",
|
||||
"@rolldown/binding-android-arm64": "1.2.13",
|
||||
"@rolldown/binding-darwin-arm64": "1.2.13",
|
||||
"@rolldown/binding-darwin-x64": "1.2.13",
|
||||
"@rolldown/binding-freebsd-x64": "1.2.13",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.2.13",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.2.13",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.2.13",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.2.13",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.2.13",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.2.13",
|
||||
"@rolldown/binding-linux-x64-musl": "1.2.13",
|
||||
"@rolldown/binding-openharmony-arm64": "1.2.13",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.2.13",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.2.13"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
@@ -2749,17 +2749,17 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "8.3.1",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.1.tgz",
|
||||
"integrity": "sha512-/bvH9E9tmCXRGp2uXY3WbOldqpTwFkbha/8ANaEQ6VkxhH60KyqLwgZq6lG2y+4uT55x9+9eUHMpQ7uGnOCKjA==",
|
||||
"version": "8.3.4",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.4.tgz",
|
||||
"integrity": "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"lightningcss": "^1.33.0",
|
||||
"picomatch": "^4.0.7",
|
||||
"postcss": "^8.5.28",
|
||||
"rolldown": "~1.2.9",
|
||||
"postcss": "^8.5.29",
|
||||
"rolldown": "~1.2.12",
|
||||
"tinyglobby": "^0.2.17"
|
||||
},
|
||||
"bin": {
|
||||
@@ -2828,14 +2828,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vitest": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.2.tgz",
|
||||
"integrity": "sha512-7MQrx9pDv5aHiUcovIb/70Ys3tgtkUVgCtledvKdCmEO+/1Dicq5ZqoSxOW034m03oqC+oHOKui2dM6qtMLoJg==",
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.3.tgz",
|
||||
"integrity": "sha512-xMw97S3rjdtj5dkVat7jCsqWBpvchs3RlpQctUqwJD0KkERk40vz2fJ77lDwW/Vzh/pk18eItYAzkodhSes3jQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/chai": "^5.2.2",
|
||||
"@vitest/mocker": "5.0.2",
|
||||
"@vitest/mocker": "5.0.3",
|
||||
"chai": "^6.2.2",
|
||||
"es-module-lexer": "^2.3.2",
|
||||
"expect-type": "^1.4.0",
|
||||
@@ -2846,7 +2846,7 @@
|
||||
"tinybench": "^6.1.4",
|
||||
"tinyexec": "^1.3.0",
|
||||
"tinyglobby": "^0.2.17",
|
||||
"why-is-node-running": "^3.2.1"
|
||||
"why-is-node-running": "3.2.1"
|
||||
},
|
||||
"bin": {
|
||||
"vitest": "vitest.mjs"
|
||||
@@ -2861,12 +2861,12 @@
|
||||
"@edge-runtime/vm": "*",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@types/node": "^22.0.0 || >=24.0.0",
|
||||
"@vitest/browser-playwright": "5.0.2",
|
||||
"@vitest/browser-preview": "5.0.2",
|
||||
"@vitest/browser-playwright": "5.0.3",
|
||||
"@vitest/browser-preview": "5.0.3",
|
||||
"@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",
|
||||
"@vitest/coverage-istanbul": "5.0.2",
|
||||
"@vitest/coverage-v8": "5.0.2",
|
||||
"@vitest/ui": "5.0.2",
|
||||
"@vitest/coverage-istanbul": "5.0.3",
|
||||
"@vitest/coverage-v8": "5.0.3",
|
||||
"@vitest/ui": "5.0.3",
|
||||
"happy-dom": "*",
|
||||
"jsdom": "*",
|
||||
"vite": "^6.4.0 || ^7.0.0 || ^8.0.0"
|
||||
@@ -2931,9 +2931,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/why-is-node-running": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.2.tgz",
|
||||
"integrity": "sha512-NKUzAelcoCXhXL4dJzKIwXeR8iEVqsA0Lq6Vnd0UXvgaKbzVo4ZTHROF2Jidrv+SgxOQ03fMinnNhzZATxOD3A==",
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz",
|
||||
"integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"typecheck": "node node_modules/@typescript/native/bin/tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"headroom-ai": "^0.39.1"
|
||||
"headroom-ai": "^0.40.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"openclaw": "*"
|
||||
|
||||
Generated
+284
-323
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@opencode-ai/plugin": "^1.18.2",
|
||||
"headroom-ai": "^0.39.1"
|
||||
"headroom-ai": "^0.40.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@ai-sdk/openai-compatible": "*",
|
||||
|
||||
+11
-2
@@ -69,6 +69,15 @@ dependencies = [
|
||||
# cert store), where IT installs corporate TLS-inspection roots (Zscaler,
|
||||
# Netskope). Pure Python, no deps; the same library pip uses by default.
|
||||
"truststore>=0.10.0",
|
||||
# Not imported directly: huggingface-hub (via litellm -> tokenizers, so in
|
||||
# every install) uses it for Hub downloads. Before 1.6.0 its worker threads
|
||||
# could re-initialize or re-enter Python while the interpreter shut down
|
||||
# after a download, crashing the process at exit (SIGSEGV in
|
||||
# Py_InitializeEx, or a fatal TstateNULL error). Declared here rather than
|
||||
# as a uv constraint so the floor reaches the published wheel's metadata
|
||||
# and pip upgrades an older copy. Same platform marker as huggingface-hub's
|
||||
# own hf-xet requirement, so it never installs where hf-xet would not.
|
||||
"hf-xet>=1.6.0; platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
@@ -83,7 +92,7 @@ proxy = [
|
||||
"openai>=2.14.0", # OpenAI API format support
|
||||
# The server still uses the v1 low-level Server decorator API. Keep this
|
||||
# cap until the SDK 2.x port lands (GH #2658 / regression GH #2977).
|
||||
"mcp>=1.28.1,<2.0.0", # MCP server (headroom_compress, retrieve, stats)
|
||||
"mcp>=1.30.0,<2.0.0", # MCP server (headroom_compress, retrieve, stats)
|
||||
"magika>=0.6.0; python_version<'3.14' or sys_platform != 'darwin' or platform_machine != 'x86_64'", # ML detection needs ORT wheels
|
||||
"zstandard>=0.20.0", # Decompress zstd request bodies (Codex, etc.)
|
||||
"websockets>=13.0", # WebSocket proxy for /v1/responses (Codex gpt-5.4+)
|
||||
@@ -247,7 +256,7 @@ autogen = [
|
||||
]
|
||||
# MCP server for Claude Code integration
|
||||
mcp = [
|
||||
"mcp>=1.28.1,<2.0.0",
|
||||
"mcp>=1.30.0,<2.0.0",
|
||||
"httpx>=0.24.0",
|
||||
"starlette>=0.27.0",
|
||||
"uvicorn>=0.23.0,<1.0",
|
||||
|
||||
Generated
+146
-146
@@ -1,18 +1,18 @@
|
||||
{
|
||||
"name": "headroom-ai",
|
||||
"version": "0.39.1",
|
||||
"version": "0.41.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "headroom-ai",
|
||||
"version": "0.39.1",
|
||||
"version": "0.41.0",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@ai-sdk/anthropic": "^4.0.53",
|
||||
"@ai-sdk/openai": "^4.0.60",
|
||||
"@ai-sdk/provider": "^4.0.14",
|
||||
"@anthropic-ai/sdk": "^0.129.0",
|
||||
"@anthropic-ai/sdk": "^0.133.0",
|
||||
"@types/node": "^26.5.0",
|
||||
"ai": "^7.0.59",
|
||||
"dotenv": "^18.0.1",
|
||||
@@ -46,14 +46,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@ai-sdk/anthropic": {
|
||||
"version": "4.0.66",
|
||||
"resolved": "https://registry.npmjs.org/@ai-sdk/anthropic/-/anthropic-4.0.66.tgz",
|
||||
"integrity": "sha512-9iefdGTbc9N9IoZwZ+6Di5aoImtOg3KsP6EyXIAKcl704BQ/5bYxA0h+pRDnuBLveIoTBeVAmQ5ZMMhlPvpUXQ==",
|
||||
"version": "4.0.78",
|
||||
"resolved": "https://registry.npmjs.org/@ai-sdk/anthropic/-/anthropic-4.0.78.tgz",
|
||||
"integrity": "sha512-lVMxa9tLM5WoB72bqxjzWEWQlCwtBTo1L3yIKxAefowWATd+1YKohrINey6wTn8gtGEqyYm79z4DUGJBYauUFw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@ai-sdk/provider": "4.0.19",
|
||||
"@ai-sdk/provider-utils": "5.0.50"
|
||||
"@ai-sdk/provider": "4.0.26",
|
||||
"@ai-sdk/provider-utils": "5.0.58"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
@@ -63,14 +63,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@ai-sdk/gateway": {
|
||||
"version": "4.0.97",
|
||||
"resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-4.0.97.tgz",
|
||||
"integrity": "sha512-YFS9McgEDHXPwXOWlu1JCylkFyDsgPNLwH9jXgMxdiaur3k6SaIUPKCRSciQQ5LbEZOSb4JAaPYYO7B5Cvq7ow==",
|
||||
"version": "4.0.110",
|
||||
"resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-4.0.110.tgz",
|
||||
"integrity": "sha512-5IwnOR6v7KC+D9eddUqsCobXl/FbLUVb2LaQc/uyuQdpP3/n9s0YLc9zl4/W3IS/R2pjHrqUfCzEAeOu7bFLoQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@ai-sdk/provider": "4.0.19",
|
||||
"@ai-sdk/provider-utils": "5.0.50",
|
||||
"@ai-sdk/provider": "4.0.26",
|
||||
"@ai-sdk/provider-utils": "5.0.58",
|
||||
"@vercel/oidc": "3.2.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -81,14 +81,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@ai-sdk/openai": {
|
||||
"version": "4.0.79",
|
||||
"resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-4.0.79.tgz",
|
||||
"integrity": "sha512-uqRlbxy04WhRuLd5dJUYFbpeKfN5Hn/d/K/fmYswbJq6RhuWdWCRoEmuLpFTpdqku9OSQGMerXMVZQi5Ou8/7Q==",
|
||||
"version": "4.0.91",
|
||||
"resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-4.0.91.tgz",
|
||||
"integrity": "sha512-Nk382R6us0GNxI1cGJUXMryz1XHpyrmC3K/Rmqdx9tIsqAlc7UtuO/hC9dd31F41w8uzoS362HJSDXgAI7zKbA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@ai-sdk/provider": "4.0.19",
|
||||
"@ai-sdk/provider-utils": "5.0.50"
|
||||
"@ai-sdk/provider": "4.0.26",
|
||||
"@ai-sdk/provider-utils": "5.0.58"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
@@ -98,9 +98,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@ai-sdk/provider": {
|
||||
"version": "4.0.19",
|
||||
"resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.19.tgz",
|
||||
"integrity": "sha512-ryVZSSfmpEsr4bM8rbt9cSBWal+KGYRrm57C+k/hiPQHMiMahaqg2bPF0MpxSUWY8mGpt7s/ajM6PAqNTMKqPQ==",
|
||||
"version": "4.0.26",
|
||||
"resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.26.tgz",
|
||||
"integrity": "sha512-BZ443uBEq6HuMA+Z4b7Hpm65GpZSo7pWqnYqpf/7tAO3C48JbtvAhOE2JnODFj+jodsZzfRHkAyQb64xuD2tZQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
@@ -111,13 +111,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@ai-sdk/provider-utils": {
|
||||
"version": "5.0.50",
|
||||
"resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-5.0.50.tgz",
|
||||
"integrity": "sha512-qg2LutM5RlUT/tuuFf+VkhFGNZ2sEJHL0oDIrFN/sMoVbDBANglqtGCJUOnBqGMoFBH8IfAXMrFZvbFWx4dMOg==",
|
||||
"version": "5.0.58",
|
||||
"resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-5.0.58.tgz",
|
||||
"integrity": "sha512-iXSwKR/7LpHzAlyrUl+bTinwzmZ3Nmup1viwPisM5Gn5cogRdIG4rV9w1ZDuKFcrXyu/AeVs42E1CX/0aNwrfQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@ai-sdk/provider": "4.0.19",
|
||||
"@ai-sdk/provider": "4.0.26",
|
||||
"@standard-schema/spec": "^1.1.0",
|
||||
"@workflow/serde": "4.1.0",
|
||||
"eventsource-parser": "^3.0.8",
|
||||
@@ -131,9 +131,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@anthropic-ai/sdk": {
|
||||
"version": "0.129.0",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.129.0.tgz",
|
||||
"integrity": "sha512-MH7LB20kNpGLUpPTe2OG5XvL/KhX8HUO9XyBaFjgFk6TLS4Xjt0VPIuMKywe7POKKPslX+QxSlVok9e+8kG5Nw==",
|
||||
"version": "0.133.0",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.133.0.tgz",
|
||||
"integrity": "sha512-jlqUN8p8ESTJj+GJnA4KjzbEfF1waEoGzRT8jwytlYGFFgv+/DUQOxlYGvYw10UzhD1kwLqYzxvA3FrTB2YWuQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -644,9 +644,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-project/types": {
|
||||
"version": "0.151.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.151.0.tgz",
|
||||
"integrity": "sha512-J1yXrIlNDZVzE3ada310xeAw7nH8yCAyLPuUIsjKatFPmfn5bS1oW+cM+QsGOtVWd5nhSpbwZWx/rue+r5Z+PA==",
|
||||
"version": "0.153.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.153.0.tgz",
|
||||
"integrity": "sha512-jSNrRIyvPVLL5E1z/tS5zLAprosGz/FuI1PWwEOz59j3E4TTTzSpqKb/RDGqJhhW0QHYISGXxq582wGx6T11Tw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
@@ -655,9 +655,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm-eabi": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.11.tgz",
|
||||
"integrity": "sha512-A5kXfGKvKWWZE0TtPrfsvT+q4Y5d1QG8gGUzpYjGydM+fARM9MuX90PrXYXe0XbsDVgyxxNzHo6giCj90bsFNw==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.13.tgz",
|
||||
"integrity": "sha512-Vu/NICrgdRvUOeaJZIyB2FP63s6fO/4ud5l8dXmxDx9yDyn+mN0y+gsvsVviSli+T361Aqo0h46EuMoobrwawA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -673,9 +673,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.11.tgz",
|
||||
"integrity": "sha512-z6cTycz+iJ4PVkuL4HHW4DfTfoeU/2nqYYuSOrTmH7yHK5Y0LCOnA03V4ZNxavyVaU1oOqUgIg2klN/s+USGOA==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.13.tgz",
|
||||
"integrity": "sha512-6LEoIrGy5vvCd2boNnv2soPSUZj/PRvhp8R/t9KlX+mIZxThIE/ZqxrGXxmuNX0FuvQFvLdZr7S4HrYpYBVhEQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -691,9 +691,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-arm64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.11.tgz",
|
||||
"integrity": "sha512-jShvqNtP6vDC6/A5JOAzbVV+DkgHqhl/ScVCJEbt+TUY6QYz7YnXcrg3sLtFBniro0f/Ld50ZwCWA6f7KYD1nQ==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.13.tgz",
|
||||
"integrity": "sha512-CaJSRzlQ6Q+zkDMVA9OkVxBjVoPRCDEE3v0FSJ9kIQBgRjFApA3Si4ijhbNVUji7ZJt+PfO0e46qy4nPInHUPA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -709,9 +709,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-x64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.11.tgz",
|
||||
"integrity": "sha512-f2i2xiNWq1Z1l2++q2fuhZRdLAT3aqxD6vRNm1RAxpUoBcdqNB3C0s1Bt+K+PbEx2F5F4gQp6hqKkphCY/xF9w==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.13.tgz",
|
||||
"integrity": "sha512-e4r340I5hxSzJkD3YJBxgzq/rJ3wwxwdLLb2FPt1Zpyem20nrQPT11DDEEkazwxaHumH8wpglsp/Ozgj/wT6mw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -727,9 +727,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-freebsd-x64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.11.tgz",
|
||||
"integrity": "sha512-4Ir5FSOKIAMr4r0kExpt1s3bMgzJU3rA45AYOHtQpls0oNeqcYBKrWMlckrYH4KCfGLfkfn1tN1dmZPMVsdXow==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.13.tgz",
|
||||
"integrity": "sha512-hoBWDZ4/K/mJKVMbsgUd1jfpA2DiOrJ54mpegObU9TBHBBrtX4FLIXJJQRDPZ/2Dn91GvPob+Z2hwKJzf4E5SQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -745,9 +745,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm-gnueabihf": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.11.tgz",
|
||||
"integrity": "sha512-/gnRDM+39BROzAN/k1OZjDPnDMcZxB/0EUxKjONO5yVkNEvlsoMDrxGNKgZi/ttFriS2gwlDNzB65pvNbFOXIQ==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.13.tgz",
|
||||
"integrity": "sha512-oF9fZu3vTWnTiVAkDFxU9PJLt1nh20K9RRpuHsR7ZnE2L7XookBbDBVLojCVSLGbvtSlxeUNnjAj6DbNsKyzbg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -763,9 +763,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-PFaK8HwvAHbaKbBcDNQihjMKYvFnA5hiENx/l5tphTDz1E0WFp32l0A7aq7lyUwGsRw/xSrNIy/gIK4thrSCrw==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.13.tgz",
|
||||
"integrity": "sha512-DTpb/+jMiqWMPgphn4ksW1zW+XLJ6dJJ9FMvnIk9I291LhCctMPhMYJrP5t9p6C9qa3KXadDdUEZHBaPh3kNxQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -784,9 +784,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-musl": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.11.tgz",
|
||||
"integrity": "sha512-AskzJUIKRLPxkruR1wLKewGbOw+EYfU/9lOrBFj4AFrEA8hPpKFnODWNu2WLaNs0QNkEb9QIJufmVZZIL/bJlg==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.13.tgz",
|
||||
"integrity": "sha512-xU+Kvv9N2A3SY35zFh1FWWNjxbadE/BKeqnkXe7vScU4GZsw757BlVmDLITZEq8DPpk6m7uoDYkK7P+x/uU5Ow==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -805,9 +805,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-ppc64-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-qlUGAheh2yh8afH7QBgx0PrRHN85hKnNd78x8MeMhXivuevgd8vgf6/CstOzmNKY/lLTHvNTrPy98cLnAugzJw==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.13.tgz",
|
||||
"integrity": "sha512-XMk/hnhh25oQ756Lclb1Q11h4ll0xC0Esa5w4Vzp+mAE2S3AGJgeM0SonrIgY8fHhjarb6hcoTuwoFG0VVP2ig==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -826,9 +826,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-s390x-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-secpEad+0vCbSfn8upFySkDskv+bGPk3THSDS9Y89yc4rb4kzqHp8Dmyd9BkQW4SnhNXBZCl/6CrO//hZahNJQ==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.13.tgz",
|
||||
"integrity": "sha512-U1BoTHYmlywE2n3HUWjzZ+8EQsKr+OwpxYuDWaubx42tUL8QSL7nOqRz/NVHanibbFP3M1Rxuprz/wNcbMKjqw==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -847,9 +847,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-mOVBT3dPpkWm8XBWPmU4bf+U6dYDLeMo/9ojUmis4N0L5uu10qra5vOyngZ7/PSdoE4G9KvRt4bloRxNjLas7A==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.13.tgz",
|
||||
"integrity": "sha512-J4cm80Pc6wEwV5AZ42o62sIQgDk+Y7R2s646jIwuvO+4V46QB58N4vVuMPWCBaNgursXLpmUWJV//WQAkPvHBQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -868,9 +868,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-musl": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.11.tgz",
|
||||
"integrity": "sha512-Is78i9A8Ui4SqcxUwFJ9uMmjDn58IbVTjFWYdQestFEgeuEmHMLGNriXnVJKkwG2YiZjw8cP0zCTyDMdDGtOOg==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.13.tgz",
|
||||
"integrity": "sha512-W0euZS40U4V6JkmEnVCIX9mcsL6cbXQ4X8c2w+MMOIjFg68TXUW+u3RT+2e1t1pv9mg/EP3pDtK3POXdQ7Rxyw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -889,9 +889,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-openharmony-arm64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.11.tgz",
|
||||
"integrity": "sha512-dUCXneZ87INUMyQ0D+C0HrEBNUPNXHaPmU5GTjyKTJEiussw9Kaj5Ln8UztPe4epV/ffvgNBEadksdYhmW6xJA==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.13.tgz",
|
||||
"integrity": "sha512-do/AF/4n9MRshia3a5aXoy8xM2c6mgfT6D7H/dY6my5z+hfCIR4ab7mk4IRj++nsEQpKy39kd0DQnDq+r692tw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -907,9 +907,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-arm64-msvc": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.11.tgz",
|
||||
"integrity": "sha512-jByxb6qfd+bH1xUd0qnfFnb17i9sWBPY2tOavJ0l3tdr3OTu+Kvtm8cd/JV5nFt657b1VqGltxg9olOEfofXWw==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.13.tgz",
|
||||
"integrity": "sha512-6FtUf2cJZobutJdxnGYX8z0vtbgqU0b2v8vfBhkXb9wp2MppMFtkunE+IaOntyi01rkIQoPW2GHABtfzsC0BRQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -925,9 +925,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-x64-msvc": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.11.tgz",
|
||||
"integrity": "sha512-/PzKqzAJ03i19oy2ItPvyvaVjOjBCNnfaJs8yvUdGBKmiESgnrJSQ2awd81QzFbbnAmu7YO9ZnJrDCb9VSJPRA==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.13.tgz",
|
||||
"integrity": "sha512-UKhFaZTeTcbKrb3iU82m17jVcPEAoqDkCN5MBqgPyZSwp/cQmib21crTS0DdH7T1B7wZRWEI89YQAOJMet5yhg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1340,9 +1340,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "26.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.3.tgz",
|
||||
"integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==",
|
||||
"version": "26.6.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz",
|
||||
"integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1360,14 +1360,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/mocker": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.2.tgz",
|
||||
"integrity": "sha512-Z5FS00Q1SJHkB35xATsmWGdQ5WA1/0MV3CDjqyv7GavHv1OfOj145MNfHOlHk7QLes21dKFDHr8EO2zvL+9WGA==",
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.3.tgz",
|
||||
"integrity": "sha512-T8sWAIbkSyAjkwTcaEc3Iu0o9A27X1/kdXrizhZkGuSKScRQtRzclfAMpOTcGdXCsqxeWlpGy3XjqaW8CpLORg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "0.3.31",
|
||||
"@vitest/spy": "5.0.2",
|
||||
"@vitest/spy": "5.0.3",
|
||||
"estree-walker": "^3.0.3",
|
||||
"magic-string": "^1.2.3"
|
||||
},
|
||||
@@ -1388,9 +1388,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/mocker/node_modules/magic-string": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.2.tgz",
|
||||
"integrity": "sha512-vG+rjFRj1PqdIBozIxAGMjPlOhaVe+GXpbttY/iSK7rGcJRMlwNJO7dcUwmUqkymsFLJiNGI06t4D7Fr7yRC9g==",
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.3.tgz",
|
||||
"integrity": "sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1398,9 +1398,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/spy": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.2.tgz",
|
||||
"integrity": "sha512-Ijc7T1nT9efNb5LxvjaBrEqw3f/QwUv5EE0nKqZxgqsaV/FxAAZ8baGylA8X/Z2oS4Lp+K74Jr6dTJsDKxJDeg==",
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.3.tgz",
|
||||
"integrity": "sha512-XhFysQTB8AZ+P4gMi+Lpo99vg2AZi0qKpaB9yXQl37+CaMEAPO3iH/wGVnSyL5MPERiLezpqTVtrR6UZH5GCXg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -1428,15 +1428,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ai": {
|
||||
"version": "7.0.119",
|
||||
"resolved": "https://registry.npmjs.org/ai/-/ai-7.0.119.tgz",
|
||||
"integrity": "sha512-KlHbkKMmdb2g0DXdkhBXzSvLSkdoAg0MdShhTTOyuoHKJetEUlgjn2juZ05lHY97EqCwBuSK8dgiEeB0ty5xZw==",
|
||||
"version": "7.0.137",
|
||||
"resolved": "https://registry.npmjs.org/ai/-/ai-7.0.137.tgz",
|
||||
"integrity": "sha512-JxrPkSQknxIN/gYqS3UQksExS6eWI23QMPBrKMGXeeFHhru6xFtF4MuMq17WaHD+lXPh0lne6H0BM2Z2VMW9EQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@ai-sdk/gateway": "4.0.97",
|
||||
"@ai-sdk/provider": "4.0.19",
|
||||
"@ai-sdk/provider-utils": "5.0.50"
|
||||
"@ai-sdk/gateway": "4.0.110",
|
||||
"@ai-sdk/provider": "4.0.26",
|
||||
"@ai-sdk/provider-utils": "5.0.58"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
@@ -1571,9 +1571,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "18.0.4",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-18.0.4.tgz",
|
||||
"integrity": "sha512-jGt9uI5BIxpVO15kvy+iEFqNAwxYClKWnkptLjSNPnFLC003Imd0ofr3aEVsbpHdSBdSsbcApNIlz4nbyGMwdA==",
|
||||
"version": "18.0.7",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-18.0.7.tgz",
|
||||
"integrity": "sha512-QEvMEF8ca3GNZJJnAbOgxpj5ULhBvnMcURp+XKrtvqFNPgjBvYoswQ0Jl2cO7JzCjxZjJhr9ZuIEhlrRxMft/Q==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"bin": {
|
||||
@@ -2106,9 +2106,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.18",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",
|
||||
"integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==",
|
||||
"version": "3.3.20",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
||||
"integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -2150,9 +2150,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/openai": {
|
||||
"version": "7.23.0",
|
||||
"resolved": "https://registry.npmjs.org/openai/-/openai-7.23.0.tgz",
|
||||
"integrity": "sha512-0ecOXnFSMNWZq6cUBcTV6Lf93y+fm8BH/+QzFvpoP1UGNOE5pnytRa6HAPGCw+3IS9SIAW7rc1M8yyzN1PiBAQ==",
|
||||
"version": "7.32.0",
|
||||
"resolved": "https://registry.npmjs.org/openai/-/openai-7.32.0.tgz",
|
||||
"integrity": "sha512-avqxu/jl1gsVBCBgFNPr9sTh+wZppQphuhhFy1zEvAJxEaJ4t0ery6hZdOT9kws/EcNTARoQcZs2IT3bliE1SA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
@@ -2237,9 +2237,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.28",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz",
|
||||
"integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==",
|
||||
"version": "8.5.29",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.29.tgz",
|
||||
"integrity": "sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -2258,9 +2258,9 @@
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.18",
|
||||
"nanoid": "^3.3.19",
|
||||
"picocolors": "^1.1.1",
|
||||
"source-map-js": "^1.2.1"
|
||||
"source-map-js": "^1.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
@@ -2334,14 +2334,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rolldown": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.11.tgz",
|
||||
"integrity": "sha512-qpSwIyz0jHQq5qXBTNxFmE6664rJ7O+4TvPFOiOaBSrz8IOHc1koKKSqTM2H6u1UG1+TveuC6vaDHKXFOvb1Kw==",
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.13.tgz",
|
||||
"integrity": "sha512-/5apOkwWxtACcQtZ5WlrAsKS4JwXVThQPJZ3RqIruRY9UG9M8e0VlXN068xum/JRKA4aIUoJ13ghe/kGCvidiQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "=0.151.0",
|
||||
"@oxc-project/types": "=0.153.0",
|
||||
"@rolldown/pluginutils": "^1.0.0"
|
||||
},
|
||||
"bin": {
|
||||
@@ -2351,21 +2351,21 @@
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rolldown/binding-android-arm-eabi": "1.2.11",
|
||||
"@rolldown/binding-android-arm64": "1.2.11",
|
||||
"@rolldown/binding-darwin-arm64": "1.2.11",
|
||||
"@rolldown/binding-darwin-x64": "1.2.11",
|
||||
"@rolldown/binding-freebsd-x64": "1.2.11",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.2.11",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.2.11",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-x64-musl": "1.2.11",
|
||||
"@rolldown/binding-openharmony-arm64": "1.2.11",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.2.11",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.2.11"
|
||||
"@rolldown/binding-android-arm-eabi": "1.2.13",
|
||||
"@rolldown/binding-android-arm64": "1.2.13",
|
||||
"@rolldown/binding-darwin-arm64": "1.2.13",
|
||||
"@rolldown/binding-darwin-x64": "1.2.13",
|
||||
"@rolldown/binding-freebsd-x64": "1.2.13",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.2.13",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.2.13",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.2.13",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.2.13",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.2.13",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.2.13",
|
||||
"@rolldown/binding-linux-x64-musl": "1.2.13",
|
||||
"@rolldown/binding-openharmony-arm64": "1.2.13",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.2.13",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.2.13"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
@@ -2648,17 +2648,17 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "8.3.1",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.1.tgz",
|
||||
"integrity": "sha512-/bvH9E9tmCXRGp2uXY3WbOldqpTwFkbha/8ANaEQ6VkxhH60KyqLwgZq6lG2y+4uT55x9+9eUHMpQ7uGnOCKjA==",
|
||||
"version": "8.3.4",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.4.tgz",
|
||||
"integrity": "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"lightningcss": "^1.33.0",
|
||||
"picomatch": "^4.0.7",
|
||||
"postcss": "^8.5.28",
|
||||
"rolldown": "~1.2.9",
|
||||
"postcss": "^8.5.29",
|
||||
"rolldown": "~1.2.12",
|
||||
"tinyglobby": "^0.2.17"
|
||||
},
|
||||
"bin": {
|
||||
@@ -2727,14 +2727,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vitest": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.2.tgz",
|
||||
"integrity": "sha512-7MQrx9pDv5aHiUcovIb/70Ys3tgtkUVgCtledvKdCmEO+/1Dicq5ZqoSxOW034m03oqC+oHOKui2dM6qtMLoJg==",
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.3.tgz",
|
||||
"integrity": "sha512-xMw97S3rjdtj5dkVat7jCsqWBpvchs3RlpQctUqwJD0KkERk40vz2fJ77lDwW/Vzh/pk18eItYAzkodhSes3jQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/chai": "^5.2.2",
|
||||
"@vitest/mocker": "5.0.2",
|
||||
"@vitest/mocker": "5.0.3",
|
||||
"chai": "^6.2.2",
|
||||
"es-module-lexer": "^2.3.2",
|
||||
"expect-type": "^1.4.0",
|
||||
@@ -2745,7 +2745,7 @@
|
||||
"tinybench": "^6.1.4",
|
||||
"tinyexec": "^1.3.0",
|
||||
"tinyglobby": "^0.2.17",
|
||||
"why-is-node-running": "^3.2.1"
|
||||
"why-is-node-running": "3.2.1"
|
||||
},
|
||||
"bin": {
|
||||
"vitest": "vitest.mjs"
|
||||
@@ -2760,12 +2760,12 @@
|
||||
"@edge-runtime/vm": "*",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@types/node": "^22.0.0 || >=24.0.0",
|
||||
"@vitest/browser-playwright": "5.0.2",
|
||||
"@vitest/browser-preview": "5.0.2",
|
||||
"@vitest/browser-playwright": "5.0.3",
|
||||
"@vitest/browser-preview": "5.0.3",
|
||||
"@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",
|
||||
"@vitest/coverage-istanbul": "5.0.2",
|
||||
"@vitest/coverage-v8": "5.0.2",
|
||||
"@vitest/ui": "5.0.2",
|
||||
"@vitest/coverage-istanbul": "5.0.3",
|
||||
"@vitest/coverage-v8": "5.0.3",
|
||||
"@vitest/ui": "5.0.3",
|
||||
"happy-dom": "*",
|
||||
"jsdom": "*",
|
||||
"vite": "^6.4.0 || ^7.0.0 || ^8.0.0"
|
||||
@@ -2830,9 +2830,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/why-is-node-running": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.2.tgz",
|
||||
"integrity": "sha512-NKUzAelcoCXhXL4dJzKIwXeR8iEVqsA0Lq6Vnd0UXvgaKbzVo4ZTHROF2Jidrv+SgxOQ03fMinnNhzZATxOD3A==",
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz",
|
||||
"integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
"@ai-sdk/anthropic": "^4.0.53",
|
||||
"@ai-sdk/openai": "^4.0.60",
|
||||
"@ai-sdk/provider": "^4.0.14",
|
||||
"@anthropic-ai/sdk": "^0.129.0",
|
||||
"@anthropic-ai/sdk": "^0.133.0",
|
||||
"@types/node": "^26.5.0",
|
||||
"ai": "^7.0.59",
|
||||
"dotenv": "^18.0.1",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
"""A buffered-CCR turn is a billed call and its usage must reach accounting.
|
||||
|
||||
When a ``stream:true`` request carries the ``headroom_retrieve`` tool, the
|
||||
Anthropic handler rewrites it to ``stream:false`` upstream so it can resolve
|
||||
retrievals server-side, then re-synthesizes SSE for the client. That buffered
|
||||
response carries the same ``usage`` block any non-stream reply does, so the
|
||||
Anthropic handler buffers the whole reply (upstream streams it, the proxy folds
|
||||
the stream into one Message) so it can resolve retrievals server-side, then
|
||||
re-synthesizes SSE for the client. That buffered response carries the same ``usage`` block any non-stream reply does, so the
|
||||
provider's cache-read / cache-write / output counts must land on the outcome.
|
||||
|
||||
If they don't, every cached token on the dominant Claude Code path is invisible:
|
||||
@@ -15,6 +15,7 @@ compression savings on the buffered turns still count in full.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
@@ -25,6 +26,7 @@ pytest.importorskip("fastapi")
|
||||
|
||||
from fastapi.testclient import TestClient # noqa: E402
|
||||
|
||||
from headroom.proxy.anthropic_wire import render_anthropic_sse_response # noqa: E402
|
||||
from headroom.proxy.loopback_guard import require_loopback # noqa: E402
|
||||
from headroom.proxy.server import ProxyConfig, create_app # noqa: E402
|
||||
|
||||
@@ -139,15 +141,19 @@ def test_buffered_ccr_turn_records_provider_usage(monkeypatch, ccr_marker: str)
|
||||
"""A stream:true + headroom_retrieve turn must book the same usage block."""
|
||||
app, outcomes = _app_and_outcomes(monkeypatch)
|
||||
route = respx.post("https://api.anthropic.com/v1/messages").mock(
|
||||
return_value=httpx.Response(200, json=_RESPONSE)
|
||||
return_value=httpx.Response(
|
||||
200,
|
||||
content=b"".join(render_anthropic_sse_response(_RESPONSE)),
|
||||
headers={"content-type": "text/event-stream"},
|
||||
)
|
||||
)
|
||||
|
||||
r = _post(app, stream=True, tools=[_RETRIEVE_TOOL], marker=ccr_marker)
|
||||
|
||||
assert r.status_code == 200
|
||||
# The handler must have buffered it: upstream saw stream:false.
|
||||
# The handler buffered it: upstream was asked for the stream it then folded.
|
||||
sent = route.calls.last.request
|
||||
assert b'"stream": false' in sent.content or b'"stream":false' in sent.content
|
||||
assert json.loads(sent.content)["stream"] is True
|
||||
|
||||
assert outcomes, "an outcome must be recorded"
|
||||
o = outcomes[-1]
|
||||
|
||||
@@ -34,6 +34,17 @@ from headroom.ccr.tool_injection import create_ccr_tool_definition # noqa: E402
|
||||
from headroom.proxy.server import ProxyConfig, create_app # noqa: E402
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _stream_false_leg(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Pin the ``stream: false`` request #3078 is about.
|
||||
|
||||
A first-party buffered turn now asks upstream for a stream and folds it
|
||||
(``test_buffered_ccr_upstream_stream.py``). This request is still what a
|
||||
custom upstream such as Copilot gets, and what the kill switch restores.
|
||||
"""
|
||||
monkeypatch.setenv("HEADROOM_BUFFERED_UPSTREAM_STREAM", "0")
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _store():
|
||||
reset_compression_store()
|
||||
|
||||
@@ -0,0 +1,540 @@
|
||||
"""The buffered CCR request streams from upstream, and the proxy folds the reply.
|
||||
|
||||
The buffered CCR path flips a streaming turn to ``stream: false`` so the whole
|
||||
reply is in hand before server-side retrieval. Sent that way, upstream sends
|
||||
nothing until the generation is complete, and a network that drops HTTP
|
||||
connections idle for ~60s (TLS-inspecting antivirus, VPN, corporate proxy)
|
||||
cut every long turn: three attempts failed at ~60s each and the client got a
|
||||
502 it resent forever. The request now goes out as a stream (as do the CCR,
|
||||
memory and turn-hook continuations built from it) and the event stream is
|
||||
folded back into the Message the buffered path reads.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
import json
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
fastapi = pytest.importorskip("fastapi")
|
||||
httpx = pytest.importorskip("httpx")
|
||||
|
||||
from fastapi.testclient import TestClient # noqa: E402
|
||||
|
||||
from headroom.cache.backends import InMemoryBackend # noqa: E402
|
||||
from headroom.cache.compression_store import ( # noqa: E402
|
||||
get_compression_store,
|
||||
reset_compression_store,
|
||||
)
|
||||
from headroom.ccr.tool_injection import create_ccr_tool_definition # noqa: E402
|
||||
from headroom.proxy.anthropic_wire import fold_anthropic_stream # noqa: E402
|
||||
from headroom.proxy.server import HeadroomProxy, ProxyConfig, create_app # noqa: E402
|
||||
|
||||
URL = "https://api.anthropic.com/v1/messages"
|
||||
|
||||
|
||||
def _sse(*events: dict[str, Any]) -> bytes:
|
||||
return b"".join(
|
||||
f"event: {event['type']}\ndata: {json.dumps(event)}\n\n".encode() for event in events
|
||||
)
|
||||
|
||||
|
||||
def _message_start(model: str = "claude-opus-5") -> dict[str, Any]:
|
||||
return {
|
||||
"type": "message_start",
|
||||
"message": {
|
||||
"id": "msg_1",
|
||||
"type": "message",
|
||||
"role": "assistant",
|
||||
"model": model,
|
||||
"content": [],
|
||||
"stop_reason": None,
|
||||
"stop_sequence": None,
|
||||
"usage": {
|
||||
"input_tokens": 25,
|
||||
"cache_creation_input_tokens": 0,
|
||||
"cache_read_input_tokens": 100,
|
||||
"output_tokens": 1,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def _text_turn(text: str) -> list[dict[str, Any]]:
|
||||
return [
|
||||
_message_start(),
|
||||
{"type": "content_block_start", "index": 0, "content_block": {"type": "text", "text": ""}},
|
||||
{"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": text}},
|
||||
{"type": "content_block_stop", "index": 0},
|
||||
{
|
||||
"type": "message_delta",
|
||||
"delta": {"stop_reason": "end_turn", "stop_sequence": None},
|
||||
"usage": {"output_tokens": 7},
|
||||
},
|
||||
{"type": "message_stop"},
|
||||
]
|
||||
|
||||
|
||||
# A turn exercising every delta the fold accumulates, with the members only a
|
||||
# stream carries: a thinking block's ``estimated_tokens`` placeholder, a delta's
|
||||
# progress count, interleaved pings, and a null usage count in message_delta.
|
||||
EVERY_DELTA = [
|
||||
_message_start(),
|
||||
{
|
||||
"type": "content_block_start",
|
||||
"index": 0,
|
||||
"content_block": {
|
||||
"type": "thinking",
|
||||
"thinking": "",
|
||||
"signature": "",
|
||||
"estimated_tokens": None,
|
||||
},
|
||||
},
|
||||
{"type": "ping"},
|
||||
{
|
||||
"type": "content_block_delta",
|
||||
"index": 0,
|
||||
"delta": {"type": "thinking_delta", "thinking": "Let me ", "estimated_tokens": 3},
|
||||
},
|
||||
{
|
||||
"type": "content_block_delta",
|
||||
"index": 0,
|
||||
"delta": {"type": "thinking_delta", "thinking": "check."},
|
||||
},
|
||||
{
|
||||
"type": "content_block_delta",
|
||||
"index": 0,
|
||||
"delta": {"type": "signature_delta", "signature": "sig-1"},
|
||||
},
|
||||
{"type": "content_block_stop", "index": 0},
|
||||
{
|
||||
"type": "content_block_start",
|
||||
"index": 1,
|
||||
"content_block": {"type": "redacted_thinking", "data": "opaque"},
|
||||
},
|
||||
{"type": "content_block_stop", "index": 1},
|
||||
{"type": "content_block_start", "index": 2, "content_block": {"type": "text", "text": ""}},
|
||||
{"type": "content_block_delta", "index": 2, "delta": {"type": "text_delta", "text": "Paris"}},
|
||||
{
|
||||
"type": "content_block_delta",
|
||||
"index": 2,
|
||||
"delta": {
|
||||
"type": "citations_delta",
|
||||
"citation": {
|
||||
"type": "char_location",
|
||||
"cited_text": "Paris",
|
||||
"document_index": 0,
|
||||
"document_title": "Atlas",
|
||||
"start_char_index": 0,
|
||||
"end_char_index": 5,
|
||||
},
|
||||
},
|
||||
},
|
||||
{"type": "content_block_delta", "index": 2, "delta": {"type": "text_delta", "text": " it is."}},
|
||||
{"type": "content_block_stop", "index": 2},
|
||||
{
|
||||
"type": "content_block_start",
|
||||
"index": 3,
|
||||
"content_block": {"type": "tool_use", "id": "toolu_1", "name": "Read", "input": {}},
|
||||
},
|
||||
{
|
||||
"type": "content_block_delta",
|
||||
"index": 3,
|
||||
"delta": {"type": "input_json_delta", "partial_json": '{"file_pa'},
|
||||
},
|
||||
{
|
||||
"type": "content_block_delta",
|
||||
"index": 3,
|
||||
"delta": {"type": "input_json_delta", "partial_json": 'th": "a.py"}'},
|
||||
},
|
||||
{"type": "content_block_stop", "index": 3},
|
||||
{"type": "ping"},
|
||||
{
|
||||
"type": "message_delta",
|
||||
"delta": {"stop_reason": "tool_use", "stop_sequence": None},
|
||||
"usage": {"output_tokens": 42, "input_tokens": None},
|
||||
},
|
||||
{"type": "message_stop"},
|
||||
]
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# The fold
|
||||
# --------------------------------------------------------------------------- #
|
||||
def test_fold_matches_the_anthropic_sdk_accumulator() -> None:
|
||||
streaming = pytest.importorskip("anthropic.lib.streaming._messages")
|
||||
accumulate = streaming.accumulate_event
|
||||
# anthropic 1.x keeps each tool block's partial JSON in a buffer the caller
|
||||
# owns (``json_bufs``); 0.x kept it on the block. Same accumulation either way.
|
||||
buffers: dict[str, Any] = (
|
||||
{"json_bufs": {}} if "json_bufs" in inspect.signature(accumulate).parameters else {}
|
||||
)
|
||||
snapshot = None
|
||||
for event in EVERY_DELTA:
|
||||
snapshot = accumulate(event=event, current_snapshot=snapshot, **buffers)
|
||||
assert snapshot is not None
|
||||
|
||||
folded = fold_anthropic_stream(_sse(*EVERY_DELTA))
|
||||
|
||||
assert folded is not None
|
||||
# The SDK keeps nulls (``stop_sequence``, the thinking placeholder); the
|
||||
# non-streaming Message drops the placeholder, so compare without them.
|
||||
assert {k: v for k, v in folded.items() if v is not None} == snapshot.model_dump(
|
||||
exclude_none=True
|
||||
)
|
||||
assert folded["usage"]["input_tokens"] == 25, "a null delta count must not erase it"
|
||||
|
||||
|
||||
def test_fold_keeps_stream_only_members_out_of_blocks() -> None:
|
||||
"""The proxy resends folded blocks; Anthropic 400s on any extra member."""
|
||||
folded = fold_anthropic_stream(_sse(*EVERY_DELTA))
|
||||
|
||||
assert folded is not None
|
||||
assert folded["content"][0] == {
|
||||
"type": "thinking",
|
||||
"thinking": "Let me check.",
|
||||
"signature": "sig-1",
|
||||
}
|
||||
assert folded["content"][1] == {"type": "redacted_thinking", "data": "opaque"}
|
||||
assert "estimated_tokens" not in json.dumps(folded)
|
||||
|
||||
|
||||
def test_fold_reports_a_truncated_stream() -> None:
|
||||
assert fold_anthropic_stream(_sse(*EVERY_DELTA[:-2])) is None
|
||||
assert fold_anthropic_stream(_sse(*EVERY_DELTA[:5])) is None # a block left open
|
||||
|
||||
|
||||
def test_fold_returns_an_in_band_error_event() -> None:
|
||||
error = {"type": "error", "error": {"type": "overloaded_error", "message": "Overloaded"}}
|
||||
|
||||
assert fold_anthropic_stream(_sse(*EVERY_DELTA[:7], error)) == error
|
||||
|
||||
|
||||
def test_fold_refuses_a_delta_it_does_not_know() -> None:
|
||||
unknown = {"type": "content_block_delta", "index": 2, "delta": {"type": "future_delta"}}
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
fold_anthropic_stream(_sse(*EVERY_DELTA[:10], unknown, *EVERY_DELTA[10:]))
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# The send helper
|
||||
# --------------------------------------------------------------------------- #
|
||||
@pytest.fixture()
|
||||
def proxy() -> HeadroomProxy:
|
||||
return HeadroomProxy(ProxyConfig(optimize=False, cache_enabled=False, image_optimize=False))
|
||||
|
||||
|
||||
class _Upstream:
|
||||
"""Answers a stream:true request with ``stream_reply``, anything else with JSON."""
|
||||
|
||||
def __init__(self, stream_reply: httpx.Response) -> None:
|
||||
self.stream_reply = stream_reply
|
||||
self.calls: list[tuple[dict[str, str], dict[str, Any]]] = []
|
||||
|
||||
async def __call__(self, headers: dict[str, str], body: dict[str, Any]) -> httpx.Response:
|
||||
self.calls.append((dict(headers), json.loads(json.dumps(body))))
|
||||
if body.get("stream"):
|
||||
return self.stream_reply
|
||||
return httpx.Response(200, json={"type": "message", "content": [], "via": "json"})
|
||||
|
||||
|
||||
def _stream_reply(*events: dict[str, Any]) -> httpx.Response:
|
||||
return httpx.Response(200, content=_sse(*events), headers={"content-type": "text/event-stream"})
|
||||
|
||||
|
||||
async def _send(
|
||||
proxy: HeadroomProxy, upstream: _Upstream, *, url: str = URL, body: dict | None = None
|
||||
) -> httpx.Response:
|
||||
return await proxy._send_buffered_as_stream(
|
||||
upstream,
|
||||
{"Accept": "application/json", "x-api-key": "k"},
|
||||
body if body is not None else {"model": "m", "stream": False, "messages": []},
|
||||
url=url,
|
||||
request_id="t",
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_a_buffered_request_streams_and_folds(proxy) -> None:
|
||||
upstream = _Upstream(_stream_reply(*_text_turn("hello")))
|
||||
body = {"model": "m", "stream": False, "messages": []}
|
||||
|
||||
response = await _send(proxy, upstream, body=body)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json()["content"] == [{"type": "text", "text": "hello"}]
|
||||
assert len(upstream.calls) == 1
|
||||
headers, sent = upstream.calls[0]
|
||||
assert sent["stream"] is True
|
||||
assert [v for k, v in headers.items() if k.lower() == "accept"] == ["text/event-stream"]
|
||||
assert body["stream"] is False, "the caller's body is not mutated"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
("env", "url", "stream"),
|
||||
[
|
||||
("0", URL, False), # kill switch
|
||||
("1", "https://gateway.example/v1/messages", False), # not first-party
|
||||
("1", URL, True), # already a stream
|
||||
],
|
||||
)
|
||||
async def test_requests_it_should_not_touch_go_out_unchanged(
|
||||
proxy, monkeypatch, env: str, url: str, stream: bool
|
||||
) -> None:
|
||||
monkeypatch.setenv("HEADROOM_BUFFERED_UPSTREAM_STREAM", env)
|
||||
upstream = _Upstream(_stream_reply(*_text_turn("hello")))
|
||||
body = {"model": "m", "stream": stream, "messages": []}
|
||||
|
||||
await _send(proxy, upstream, url=url, body=body)
|
||||
|
||||
assert upstream.calls == [({"Accept": "application/json", "x-api-key": "k"}, body)]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_a_propagated_kill_switch_keeps_the_request_non_streaming(proxy) -> None:
|
||||
# `headroom wrap` pushes this knob to a reused proxy, so the rollback works
|
||||
# without the proxy's own environment or a restart.
|
||||
from headroom.proxy import runtime_env
|
||||
|
||||
assert runtime_env.explicit_env({"HEADROOM_BUFFERED_UPSTREAM_STREAM": "0"}) == {
|
||||
"HEADROOM_BUFFERED_UPSTREAM_STREAM": "0"
|
||||
}
|
||||
upstream = _Upstream(_stream_reply(*_text_turn("hello")))
|
||||
body = {"model": "m", "stream": False, "messages": []}
|
||||
runtime_env.set_overrides({"HEADROOM_BUFFERED_UPSTREAM_STREAM": "0"})
|
||||
try:
|
||||
response = await _send(proxy, upstream, body=body)
|
||||
finally:
|
||||
runtime_env.clear_overrides()
|
||||
|
||||
assert upstream.calls == [({"Accept": "application/json", "x-api-key": "k"}, body)]
|
||||
assert response.json()["via"] == "json"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"reply",
|
||||
[
|
||||
httpx.Response(529, json={"type": "error", "error": {"type": "overloaded_error"}}),
|
||||
httpx.Response(200, json={"type": "message", "content": []}), # answered JSON anyway
|
||||
],
|
||||
)
|
||||
async def test_a_reply_that_is_not_an_event_stream_is_returned_as_is(proxy, reply) -> None:
|
||||
upstream = _Upstream(reply)
|
||||
|
||||
assert await _send(proxy, upstream) is reply
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_an_in_band_error_comes_back_with_its_status(proxy) -> None:
|
||||
error = {"type": "error", "error": {"type": "overloaded_error", "message": "Overloaded"}}
|
||||
upstream = _Upstream(_stream_reply(_message_start(), error))
|
||||
|
||||
response = await _send(proxy, upstream)
|
||||
|
||||
assert response.status_code == 529
|
||||
assert response.json() == error
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_a_truncated_stream_is_a_502(proxy) -> None:
|
||||
upstream = _Upstream(_stream_reply(*_text_turn("hello")[:-2]))
|
||||
|
||||
response = await _send(proxy, upstream)
|
||||
|
||||
assert response.status_code == 502
|
||||
assert response.json()["error"]["type"] == "upstream_protocol_error"
|
||||
assert len(upstream.calls) == 1
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_a_stream_it_cannot_fold_is_sent_again_as_stream_false(proxy) -> None:
|
||||
unknown = {"type": "content_block_delta", "index": 0, "delta": {"type": "future_delta"}}
|
||||
events = _text_turn("hello")
|
||||
upstream = _Upstream(_stream_reply(*events[:3], unknown, *events[3:]))
|
||||
|
||||
response = await _send(proxy, upstream)
|
||||
|
||||
assert response.json()["via"] == "json"
|
||||
assert [sent["stream"] for _, sent in upstream.calls] == [True, False]
|
||||
assert upstream.calls[1][0]["Accept"] == "application/json"
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Through the handler
|
||||
# --------------------------------------------------------------------------- #
|
||||
@pytest.fixture(autouse=True)
|
||||
def _store():
|
||||
reset_compression_store()
|
||||
get_compression_store(backend=InMemoryBackend())
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
reset_compression_store()
|
||||
|
||||
|
||||
def _config() -> ProxyConfig:
|
||||
return ProxyConfig(
|
||||
optimize=False,
|
||||
cache_enabled=False,
|
||||
rate_limit_enabled=False,
|
||||
memory_enabled=False,
|
||||
ccr_inject_tool=True,
|
||||
ccr_handle_responses=True,
|
||||
ccr_context_tracking=False,
|
||||
image_optimize=False,
|
||||
)
|
||||
|
||||
|
||||
class _ContinuationClient:
|
||||
"""Stands in for ``http_client``; the CCR continuation posts through it."""
|
||||
|
||||
def __init__(self, reply: httpx.Response) -> None:
|
||||
self.reply = reply
|
||||
self.calls: list[tuple[dict[str, str], dict[str, Any]]] = []
|
||||
|
||||
async def post(self, url, *, content=None, headers=None, timeout=None): # noqa: ANN001
|
||||
self.calls.append((dict(headers or {}), json.loads(content)))
|
||||
return self.reply
|
||||
|
||||
async def aclose(self) -> None:
|
||||
return None
|
||||
|
||||
|
||||
def _accept(headers: dict[str, str]) -> list[str]:
|
||||
return [v for k, v in headers.items() if k.lower() == "accept"]
|
||||
|
||||
|
||||
def test_the_buffered_turn_and_its_ccr_continuation_stream_upstream() -> None:
|
||||
store = get_compression_store()
|
||||
marker = store.store(
|
||||
original=json.dumps({"secret": "retrieved answer"}),
|
||||
compressed="{}",
|
||||
original_item_count=1,
|
||||
)
|
||||
retrieve_turn = [
|
||||
_message_start(),
|
||||
{
|
||||
"type": "content_block_start",
|
||||
"index": 0,
|
||||
"content_block": {
|
||||
"type": "thinking",
|
||||
"thinking": "",
|
||||
"signature": "",
|
||||
"estimated_tokens": None,
|
||||
},
|
||||
},
|
||||
{
|
||||
"type": "content_block_delta",
|
||||
"index": 0,
|
||||
"delta": {"type": "thinking_delta", "thinking": "I need it."},
|
||||
},
|
||||
{
|
||||
"type": "content_block_delta",
|
||||
"index": 0,
|
||||
"delta": {"type": "signature_delta", "signature": "sig"},
|
||||
},
|
||||
{"type": "content_block_stop", "index": 0},
|
||||
{
|
||||
"type": "content_block_start",
|
||||
"index": 1,
|
||||
"content_block": {
|
||||
"type": "tool_use",
|
||||
"id": "toolu_ccr",
|
||||
"name": "headroom_retrieve",
|
||||
"input": {},
|
||||
},
|
||||
},
|
||||
{
|
||||
"type": "content_block_delta",
|
||||
"index": 1,
|
||||
"delta": {"type": "input_json_delta", "partial_json": json.dumps({"hash": marker})},
|
||||
},
|
||||
{"type": "content_block_stop", "index": 1},
|
||||
{
|
||||
"type": "message_delta",
|
||||
"delta": {"stop_reason": "tool_use", "stop_sequence": None},
|
||||
"usage": {"output_tokens": 9},
|
||||
},
|
||||
{"type": "message_stop"},
|
||||
]
|
||||
sent: list[tuple[dict[str, str], dict[str, Any]]] = []
|
||||
|
||||
app = create_app(_config())
|
||||
with TestClient(app) as client:
|
||||
proxy = client.app.state.proxy
|
||||
|
||||
async def _fake_retry(method, url, headers, body, stream=False, **kwargs): # noqa: ANN001
|
||||
sent.append((dict(headers), json.loads(json.dumps(body))))
|
||||
return _stream_reply(*retrieve_turn)
|
||||
|
||||
proxy._retry_request = _fake_retry # type: ignore[assignment]
|
||||
continuation = _ContinuationClient(_stream_reply(*_text_turn("the answer")))
|
||||
proxy.http_client = continuation
|
||||
|
||||
resp = client.post(
|
||||
"/v1/messages",
|
||||
headers={"x-api-key": "k", "anthropic-version": "2023-06-01"},
|
||||
json={
|
||||
"model": "claude-opus-5",
|
||||
"max_tokens": 64,
|
||||
"stream": True,
|
||||
"tools": [create_ccr_tool_definition("anthropic")],
|
||||
"messages": [{"role": "user", "content": f"use <<ccr:{marker}>>"}],
|
||||
},
|
||||
)
|
||||
|
||||
assert resp.status_code == 200, resp.text
|
||||
assert "the answer" in resp.text
|
||||
assert "headroom_retrieve" not in resp.text
|
||||
[(headers, body)] = sent
|
||||
assert body["stream"] is True
|
||||
assert _accept(headers) == ["text/event-stream"]
|
||||
[(cont_headers, cont_body)] = continuation.calls
|
||||
assert cont_body["stream"] is True
|
||||
assert _accept(cont_headers) == ["text/event-stream"]
|
||||
# The folded turn is resent as history: no stream-only member may ride along.
|
||||
assert cont_body["messages"][-2]["content"][0] == {
|
||||
"type": "thinking",
|
||||
"thinking": "I need it.",
|
||||
"signature": "sig",
|
||||
}
|
||||
|
||||
|
||||
def test_a_client_stream_false_request_is_left_alone() -> None:
|
||||
marker = get_compression_store().store(
|
||||
original=json.dumps({"earlier": "tool output"}),
|
||||
compressed="{}",
|
||||
original_item_count=1,
|
||||
)
|
||||
sent: list[tuple[dict[str, str], dict[str, Any], dict[str, Any]]] = []
|
||||
app = create_app(_config())
|
||||
with TestClient(app) as client:
|
||||
proxy = client.app.state.proxy
|
||||
|
||||
async def _fake_retry(method, url, headers, body, stream=False, **kwargs): # noqa: ANN001
|
||||
sent.append((dict(headers), json.loads(json.dumps(body)), kwargs))
|
||||
return httpx.Response(200, json=fold_anthropic_stream(_sse(*_text_turn("ok"))))
|
||||
|
||||
proxy._retry_request = _fake_retry # type: ignore[assignment]
|
||||
resp = client.post(
|
||||
"/v1/messages",
|
||||
headers={"x-api-key": "k", "anthropic-version": "2023-06-01"},
|
||||
json={
|
||||
"model": "claude-opus-5",
|
||||
"max_tokens": 64,
|
||||
"stream": False,
|
||||
"tools": [create_ccr_tool_definition("anthropic")],
|
||||
"messages": [{"role": "user", "content": f"use <<ccr:{marker}>>"}],
|
||||
},
|
||||
)
|
||||
|
||||
assert resp.status_code == 200, resp.text
|
||||
[(headers, body, kwargs)] = sent
|
||||
assert body["stream"] is False
|
||||
assert _accept(headers) == ["application/json"]
|
||||
assert kwargs["original_body_bytes"] is not None
|
||||
+189
-138
@@ -1,22 +1,25 @@
|
||||
"""Tests for CCR batch result processor.
|
||||
|
||||
These tests verify that:
|
||||
1. BatchResultProcessor class initialization works correctly
|
||||
1. Native tool schemas permit real CCR batch continuations
|
||||
2. Result parsing for Anthropic, OpenAI, and Google batch formats
|
||||
3. CCR tool call detection in batch results
|
||||
4. Continuation call handling works for all providers
|
||||
5. Error cases and edge cases are handled gracefully
|
||||
"""
|
||||
|
||||
import json
|
||||
import re
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from headroom.cache import compression_store as compression_store_module
|
||||
from headroom.cache.compression_store import CompressionStore, set_request_compression_store
|
||||
from headroom.ccr import batch_store as batch_store_module
|
||||
from headroom.ccr.batch_processor import (
|
||||
BatchResultProcessor,
|
||||
BatchResultProcessorConfig,
|
||||
ProcessedBatchResult,
|
||||
process_batch_results,
|
||||
)
|
||||
from headroom.ccr.batch_store import (
|
||||
@@ -28,107 +31,6 @@ from headroom.ccr.batch_store import (
|
||||
from headroom.ccr.tool_injection import CCR_TOOL_NAME
|
||||
|
||||
|
||||
class TestBatchResultProcessorConfig:
|
||||
"""Test BatchResultProcessorConfig dataclass."""
|
||||
|
||||
def test_default_config(self):
|
||||
"""Default config values."""
|
||||
config = BatchResultProcessorConfig()
|
||||
|
||||
assert config.enabled is True
|
||||
assert config.continuation_timeout == 120
|
||||
assert config.max_continuation_rounds == 3
|
||||
|
||||
def test_custom_config(self):
|
||||
"""Custom config values."""
|
||||
config = BatchResultProcessorConfig(
|
||||
enabled=False,
|
||||
continuation_timeout=60,
|
||||
max_continuation_rounds=5,
|
||||
)
|
||||
|
||||
assert config.enabled is False
|
||||
assert config.continuation_timeout == 60
|
||||
assert config.max_continuation_rounds == 5
|
||||
|
||||
|
||||
class TestProcessedBatchResult:
|
||||
"""Test ProcessedBatchResult dataclass."""
|
||||
|
||||
def test_default_values(self):
|
||||
"""Default values for ProcessedBatchResult."""
|
||||
result = ProcessedBatchResult(
|
||||
custom_id="req_123",
|
||||
result={"content": "test"},
|
||||
)
|
||||
|
||||
assert result.custom_id == "req_123"
|
||||
assert result.result == {"content": "test"}
|
||||
assert result.was_processed is False
|
||||
assert result.continuation_rounds == 0
|
||||
assert result.error is None
|
||||
|
||||
def test_processed_result(self):
|
||||
"""ProcessedBatchResult with CCR processing."""
|
||||
result = ProcessedBatchResult(
|
||||
custom_id="req_456",
|
||||
result={"content": "processed"},
|
||||
was_processed=True,
|
||||
continuation_rounds=2,
|
||||
)
|
||||
|
||||
assert result.was_processed is True
|
||||
assert result.continuation_rounds == 2
|
||||
|
||||
def test_error_result(self):
|
||||
"""ProcessedBatchResult with error."""
|
||||
result = ProcessedBatchResult(
|
||||
custom_id="req_789",
|
||||
result={"content": "partial"},
|
||||
error="Retrieval failed",
|
||||
)
|
||||
|
||||
assert result.error == "Retrieval failed"
|
||||
|
||||
|
||||
class TestBatchResultProcessorInit:
|
||||
"""Test BatchResultProcessor initialization."""
|
||||
|
||||
def test_default_initialization(self):
|
||||
"""Initialize with default config."""
|
||||
http_client = MagicMock(spec=httpx.AsyncClient)
|
||||
processor = BatchResultProcessor(http_client)
|
||||
|
||||
assert processor.http_client == http_client
|
||||
assert processor.config.enabled is True
|
||||
assert processor.config.continuation_timeout == 120
|
||||
assert processor.ccr_handler is not None
|
||||
|
||||
def test_custom_config_initialization(self):
|
||||
"""Initialize with custom config."""
|
||||
http_client = MagicMock(spec=httpx.AsyncClient)
|
||||
config = BatchResultProcessorConfig(
|
||||
enabled=False,
|
||||
continuation_timeout=60,
|
||||
)
|
||||
processor = BatchResultProcessor(http_client, config)
|
||||
|
||||
assert processor.config.enabled is False
|
||||
assert processor.config.continuation_timeout == 60
|
||||
|
||||
def test_api_urls_set(self):
|
||||
"""API URLs are set for all providers."""
|
||||
http_client = MagicMock(spec=httpx.AsyncClient)
|
||||
processor = BatchResultProcessor(http_client)
|
||||
|
||||
assert "anthropic" in processor.api_urls
|
||||
assert "openai" in processor.api_urls
|
||||
assert "google" in processor.api_urls
|
||||
assert processor.api_urls["anthropic"] == "https://api.anthropic.com"
|
||||
assert processor.api_urls["openai"] == "https://api.openai.com"
|
||||
assert processor.api_urls["google"] == "https://generativelanguage.googleapis.com"
|
||||
|
||||
|
||||
class TestCustomIdExtraction:
|
||||
"""Test _get_custom_id method for different providers."""
|
||||
|
||||
@@ -684,47 +586,196 @@ class TestContinuationCalls:
|
||||
assert call_args.kwargs["json"]["model"] == "gpt-4"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_google_continuation_call(self):
|
||||
"""Test Google continuation call format."""
|
||||
mock_response = MagicMock()
|
||||
mock_response.json.return_value = {
|
||||
"candidates": [{"content": {"parts": [{"text": "Final answer"}]}}]
|
||||
}
|
||||
mock_response.raise_for_status = MagicMock()
|
||||
@pytest.mark.parametrize("client_tools", ["functions", "siblings", "none"])
|
||||
async def test_google_batch_create_to_results_retains_injected_native_tools(
|
||||
self, monkeypatch, tmp_path, client_tools
|
||||
):
|
||||
from starlette.requests import Request
|
||||
|
||||
http_client = AsyncMock(spec=httpx.AsyncClient)
|
||||
http_client.post.return_value = mock_response
|
||||
from headroom.providers.openai import OpenAIProvider
|
||||
from headroom.proxy.server import HeadroomProxy, ProxyConfig
|
||||
from headroom.transforms.content_router import ContentRouter, ContentRouterConfig
|
||||
from headroom.transforms.pipeline import TransformPipeline
|
||||
|
||||
processor = BatchResultProcessor(http_client)
|
||||
monkeypatch.setenv("HEADROOM_WORKSPACE_DIR", str(tmp_path))
|
||||
original_records = [
|
||||
f"Record {i}: amount={i * 13}, owner=account-{i}, unique source information "
|
||||
"with a detailed transaction description."
|
||||
for i in range(200)
|
||||
]
|
||||
original = json.dumps(original_records, indent=2)
|
||||
store = CompressionStore(enable_feedback=False)
|
||||
previous_store = compression_store_module._request_ccr_store.get()
|
||||
set_request_compression_store(store)
|
||||
monkeypatch.setattr(batch_store_module, "_batch_context_store", BatchContextStore())
|
||||
tools = [] if client_tools == "none" else [{"googleSearch": {}}, {"codeExecution": {}}]
|
||||
if client_tools == "functions":
|
||||
tools.insert(
|
||||
0,
|
||||
{
|
||||
"functionDeclarations": [
|
||||
{
|
||||
"name": "lookup",
|
||||
"description": "Look up one record.",
|
||||
"parameters": {"type": "OBJECT"},
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
forwarded = None
|
||||
|
||||
request_context = BatchRequestContext(
|
||||
custom_id="req_1",
|
||||
messages=[{"role": "user", "content": "Hello"}],
|
||||
model="gemini-pro",
|
||||
system_instruction="Be helpful.",
|
||||
def admit_wire_request(request):
|
||||
nonlocal forwarded
|
||||
body = json.loads(request.content)
|
||||
if request.url.path.endswith(":batchGenerateContent"):
|
||||
forwarded = body["batch"]["input_config"]["requests"]["requests"][0]["request"]
|
||||
return httpx.Response(200, json={"name": "batches/native-tools"})
|
||||
recovered = [
|
||||
part["functionResponse"]["response"].get("original_content")
|
||||
for content in body["contents"]
|
||||
for part in content["parts"]
|
||||
if "functionResponse" in part
|
||||
]
|
||||
declarations = [
|
||||
declaration
|
||||
for tool in body.get("tools", [])
|
||||
for declaration in tool.get("functionDeclarations", [])
|
||||
]
|
||||
expected_names = (
|
||||
{CCR_TOOL_NAME, "lookup"} if client_tools == "functions" else {CCR_TOOL_NAME}
|
||||
)
|
||||
admitted = (
|
||||
{declaration.get("name") for declaration in declarations} == expected_names
|
||||
and body.get("tools") == forwarded.get("tools")
|
||||
and all(
|
||||
all(declaration in declarations for declaration in tool["functionDeclarations"])
|
||||
if "functionDeclarations" in tool
|
||||
else tool in body["tools"]
|
||||
for tool in tools
|
||||
)
|
||||
and any(
|
||||
isinstance(value, str) and json.loads(value) == original_records
|
||||
for value in recovered
|
||||
)
|
||||
)
|
||||
return httpx.Response(
|
||||
200 if admitted else 400,
|
||||
json={
|
||||
"candidates": [
|
||||
{"content": {"role": "model", "parts": [{"text": "All records recovered"}]}}
|
||||
]
|
||||
}
|
||||
if admitted
|
||||
else {"error": {"message": "Missing effective native tools or original records"}},
|
||||
)
|
||||
|
||||
proxy = HeadroomProxy(
|
||||
ProxyConfig(
|
||||
optimize=True,
|
||||
cache_enabled=False,
|
||||
rate_limit_enabled=False,
|
||||
cost_tracking_enabled=False,
|
||||
log_requests=False,
|
||||
retry_enabled=False,
|
||||
image_optimize=False,
|
||||
)
|
||||
)
|
||||
batch_context = BatchContext(
|
||||
batch_id="batch_123",
|
||||
provider="google",
|
||||
api_key="google_api_key",
|
||||
proxy.openai_pipeline = TransformPipeline(
|
||||
provider=OpenAIProvider(),
|
||||
transforms=[
|
||||
ContentRouter(
|
||||
ContentRouterConfig(
|
||||
skip_user_messages=False,
|
||||
protect_analysis_context=False,
|
||||
enable_kompress=False,
|
||||
smart_crusher_max_items_after_crush=12,
|
||||
smart_crusher_with_compaction=False,
|
||||
)
|
||||
)
|
||||
],
|
||||
)
|
||||
payload = json.dumps(
|
||||
{
|
||||
"batch": {
|
||||
"input_config": {
|
||||
"requests": {
|
||||
"requests": [
|
||||
{
|
||||
"metadata": {"key": "request"},
|
||||
"request": {
|
||||
"contents": [
|
||||
{"role": "user", "parts": [{"text": original}]}
|
||||
],
|
||||
"tools": tools,
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
).encode()
|
||||
chunks = iter(
|
||||
[
|
||||
{"type": "http.request", "body": payload[:100], "more_body": True},
|
||||
{"type": "http.request", "body": payload[100:], "more_body": False},
|
||||
]
|
||||
)
|
||||
|
||||
await processor._google_continuation(
|
||||
[{"role": "user", "content": "Hello"}],
|
||||
[{"name": "test_tool", "parameters": {}}],
|
||||
request_context,
|
||||
batch_context,
|
||||
async def receive():
|
||||
return next(chunks, {"type": "http.disconnect"})
|
||||
|
||||
request = Request(
|
||||
{
|
||||
"type": "http",
|
||||
"method": "POST",
|
||||
"path": "/v1beta/models/gemini-2.5-flash:batchGenerateContent",
|
||||
"query_string": b"",
|
||||
"headers": [(b"content-type", b"application/json")],
|
||||
"scheme": "http",
|
||||
"server": ("127.0.0.1", 80),
|
||||
},
|
||||
receive,
|
||||
)
|
||||
|
||||
# Verify API call
|
||||
http_client.post.assert_called_once()
|
||||
call_args = http_client.post.call_args
|
||||
|
||||
assert "generativelanguage.googleapis.com" in call_args.args[0]
|
||||
assert "gemini-pro" in call_args.args[0]
|
||||
assert "key=google_api_key" in call_args.args[0]
|
||||
assert "contents" in call_args.kwargs["json"]
|
||||
assert "systemInstruction" in call_args.kwargs["json"]
|
||||
try:
|
||||
async with httpx.AsyncClient(
|
||||
transport=httpx.MockTransport(admit_wire_request)
|
||||
) as client:
|
||||
proxy.http_client = client
|
||||
created = await proxy.handle_google_batch_create(request, "gemini-2.5-flash")
|
||||
assert created.status_code == 200
|
||||
hash_key = re.search(
|
||||
r"(?:<<ccr:|Retrieve (?:more|original): hash=)([a-f0-9]{12,24})",
|
||||
json.dumps(forwarded),
|
||||
).group(1)
|
||||
response = {
|
||||
"candidates": [
|
||||
{
|
||||
"content": {
|
||||
"role": "model",
|
||||
"parts": [
|
||||
{
|
||||
"functionCall": {
|
||||
"name": CCR_TOOL_NAME,
|
||||
"args": {"hash": hash_key},
|
||||
}
|
||||
}
|
||||
],
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
processed = await BatchResultProcessor(client).process_results(
|
||||
"batches/native-tools",
|
||||
[{"metadata": {"key": "request"}, "response": response}],
|
||||
"google",
|
||||
)
|
||||
assert processed[0].result["response"]["candidates"][0]["content"]["parts"] == [
|
||||
{"text": "All records recovered"}
|
||||
]
|
||||
finally:
|
||||
set_request_compression_store(previous_store)
|
||||
proxy._compression_executor.shutdown(wait=True)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_continuation_with_tools(self):
|
||||
|
||||
@@ -175,7 +175,8 @@ def test_signed_thinking_history_skips_the_buffered_ccr_path(
|
||||
assert calls["stream_body"]["stream"] is True
|
||||
else:
|
||||
assert "buffered_body" in calls, "expected the buffered CCR path"
|
||||
assert calls["buffered_body"]["stream"] is False
|
||||
# The buffered request itself streams; the proxy folds the reply.
|
||||
assert calls["buffered_body"]["stream"] is True
|
||||
|
||||
|
||||
@pytest.mark.parametrize("upstream_delay", [0.0, 1.2], ids=["prompt", "past-keepalive"])
|
||||
@@ -278,7 +279,8 @@ def test_buffering_is_gated_on_a_redeemable_marker(
|
||||
assert resp.status_code == 200, resp.text
|
||||
if expect_buffered:
|
||||
assert "buffered_body" in calls, "a redeemable marker must still buffer"
|
||||
assert calls["buffered_body"]["stream"] is False
|
||||
# The buffered request itself streams; the proxy folds the reply.
|
||||
assert calls["buffered_body"]["stream"] is True
|
||||
else:
|
||||
assert "stream_body" in calls, "nothing to retrieve — the client must keep streaming"
|
||||
assert "buffered_body" not in calls
|
||||
|
||||
@@ -230,6 +230,39 @@ def test_perf_json_format(runner, monkeypatch):
|
||||
assert data["overhead"]["optimization_ms"]["p95_ms"] == 11.8
|
||||
|
||||
|
||||
def test_perf_json_survives_litellm_provider_banner(tmp_path):
|
||||
"""Pricing an unknown model makes litellm print() its "Provider List"
|
||||
banner to stdout unless suppressed. The perf CLI imports no module that
|
||||
suppresses it, so the pricing module has to.
|
||||
|
||||
Runs in a fresh interpreter: the flag is set at import time, and
|
||||
reloading the module in-process would leave stale class references
|
||||
behind for later tests.
|
||||
"""
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
pytest.importorskip("litellm")
|
||||
script = (
|
||||
"import json, litellm\n"
|
||||
"assert not litellm.suppress_debug_info\n"
|
||||
"from headroom.perf.analyzer import build_perf_summary, PerfReport, PerfRecord\n"
|
||||
"rec = PerfRecord(timestamp='2026-06-05 10:00:00,000', request_id='hr_1',\n"
|
||||
" model='no-such-model-banner-probe', num_messages=1, tokens_before=10,\n"
|
||||
" tokens_after=5, tokens_saved=5, cache_read=0, cache_write=0,\n"
|
||||
" cache_hit_pct=0, optimization_ms=1.0, transforms=[])\n"
|
||||
"print(json.dumps(build_perf_summary(PerfReport(perf_records=[rec]))))\n"
|
||||
)
|
||||
env = {k: v for k, v in os.environ.items() if k != "LITELLM_SUPPRESS_DEBUG_INFO"}
|
||||
env["HOME"] = str(tmp_path)
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-c", script], capture_output=True, text=True, env=env, timeout=120
|
||||
)
|
||||
assert result.returncode == 0, result.stderr
|
||||
assert "Provider List" not in result.stdout
|
||||
assert json.loads(result.stdout)["total_requests"] == 1
|
||||
|
||||
|
||||
def test_perf_json_raw_is_array(runner, monkeypatch):
|
||||
_patch_report(monkeypatch, _sample_report())
|
||||
result = runner.invoke(main, ["perf", "--format", "json", "--raw"])
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
"""A Kompress model that is still loading is expected, not a connectivity problem.
|
||||
|
||||
The router used to log "Kompress model not ready ... Check HuggingFace
|
||||
connectivity" at WARNING on the first request after every proxy start, because
|
||||
the post-startup warm-up takes ~20 s and requests arrive meanwhile. It now says
|
||||
"still loading" at INFO while a loader thread runs, and keeps the WARNING for
|
||||
when nothing is loading the model (e.g. a failed download in its retry backoff).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import threading
|
||||
|
||||
import pytest
|
||||
|
||||
from headroom.transforms import kompress_compressor as kc
|
||||
from headroom.transforms.content_router import ContentRouter, ContentRouterConfig
|
||||
|
||||
_LOGGER = "headroom.transforms.content_router"
|
||||
_CONTENT = "some plain text that the ML model would compress. " * 4
|
||||
|
||||
|
||||
class _NotReadyKompress:
|
||||
def __init__(self, *, loading: bool) -> None:
|
||||
self.loading = loading
|
||||
self.background_loads = 0
|
||||
|
||||
def is_ready(self) -> bool:
|
||||
return False
|
||||
|
||||
def ensure_background_load(self) -> None:
|
||||
self.background_loads += 1
|
||||
|
||||
def is_loading(self) -> bool:
|
||||
return self.loading
|
||||
|
||||
|
||||
def _router(monkeypatch: pytest.MonkeyPatch, compressor: object) -> ContentRouter:
|
||||
router = ContentRouter(
|
||||
ContentRouterConfig(
|
||||
relevance_split=False,
|
||||
lossless_then_lossy=False,
|
||||
ccr_inject_marker=False,
|
||||
)
|
||||
)
|
||||
monkeypatch.setattr(router, "_get_kompress", lambda: compressor)
|
||||
return router
|
||||
|
||||
|
||||
def _logged(caplog: pytest.LogCaptureFixture, level: int, text: str) -> int:
|
||||
return sum(
|
||||
1
|
||||
for r in caplog.records
|
||||
if r.name == _LOGGER and r.levelno == level and text in r.getMessage()
|
||||
)
|
||||
|
||||
|
||||
def test_still_loading_is_info_not_a_connectivity_warning(monkeypatch, caplog):
|
||||
compressor = _NotReadyKompress(loading=True)
|
||||
router = _router(monkeypatch, compressor)
|
||||
|
||||
with caplog.at_level(logging.INFO, logger=_LOGGER):
|
||||
for _ in range(3):
|
||||
assert router._try_ml_compressor(_CONTENT, "ctx")[0] == _CONTENT
|
||||
|
||||
assert _logged(caplog, logging.INFO, "still loading in the background") == 1
|
||||
assert _logged(caplog, logging.WARNING, "Check HuggingFace connectivity") == 0
|
||||
assert compressor.background_loads == 3
|
||||
|
||||
|
||||
def test_no_loader_running_still_warns_once(monkeypatch, caplog):
|
||||
router = _router(monkeypatch, _NotReadyKompress(loading=False))
|
||||
|
||||
with caplog.at_level(logging.INFO, logger=_LOGGER):
|
||||
for _ in range(3):
|
||||
router._try_ml_compressor(_CONTENT, "ctx")
|
||||
|
||||
assert _logged(caplog, logging.WARNING, "Check HuggingFace connectivity") == 1
|
||||
assert _logged(caplog, logging.INFO, "still loading in the background") == 0
|
||||
|
||||
|
||||
def test_warns_once_the_load_ends_without_a_model(monkeypatch, caplog):
|
||||
"""A warm-up that fails leaves no loader running: then it is degraded."""
|
||||
compressor = _NotReadyKompress(loading=True)
|
||||
router = _router(monkeypatch, compressor)
|
||||
|
||||
with caplog.at_level(logging.INFO, logger=_LOGGER):
|
||||
router._try_ml_compressor(_CONTENT, "ctx")
|
||||
compressor.loading = False
|
||||
router._try_ml_compressor(_CONTENT, "ctx")
|
||||
|
||||
assert _logged(caplog, logging.INFO, "still loading in the background") == 1
|
||||
assert _logged(caplog, logging.WARNING, "Check HuggingFace connectivity") == 1
|
||||
|
||||
|
||||
def test_compressor_without_is_loading_keeps_the_warning(monkeypatch, caplog):
|
||||
class _Legacy:
|
||||
def is_ready(self) -> bool:
|
||||
return False
|
||||
|
||||
def ensure_background_load(self) -> None:
|
||||
pass
|
||||
|
||||
router = _router(monkeypatch, _Legacy())
|
||||
|
||||
with caplog.at_level(logging.INFO, logger=_LOGGER):
|
||||
router._try_ml_compressor(_CONTENT, "ctx")
|
||||
|
||||
assert _logged(caplog, logging.WARNING, "Check HuggingFace connectivity") == 1
|
||||
|
||||
|
||||
def test_registered_warm_up_thread_counts_as_loading():
|
||||
"""The real signal: the warm-up thread is the model's registered loader."""
|
||||
model_id = "test/not-ready-log-model"
|
||||
release = threading.Event()
|
||||
try:
|
||||
thread = kc.start_kompress_warmup_thread(model_id, lambda: release.wait(5))
|
||||
assert kc.is_kompress_load_in_progress(model_id)
|
||||
release.set()
|
||||
thread.join(timeout=5)
|
||||
assert not kc.is_kompress_load_in_progress(model_id)
|
||||
finally:
|
||||
release.set()
|
||||
with kc._download_threads_lock:
|
||||
kc._download_threads.pop(model_id, None)
|
||||
@@ -154,3 +154,30 @@ def test_a_live_thread_is_never_duplicated(monkeypatch):
|
||||
finally:
|
||||
gate.set()
|
||||
_drain()
|
||||
|
||||
|
||||
def test_warm_up_waits_for_a_live_loader_it_replaces(monkeypatch):
|
||||
"""A startup prefetch still downloading stays covered, even if the warm-up fails."""
|
||||
started = _spawned(monkeypatch, fails=False)
|
||||
prefetch_done = threading.Event()
|
||||
prefetch = threading.Thread(target=prefetch_done.wait, args=(10,), daemon=True)
|
||||
with kc._download_threads_lock:
|
||||
prefetch.start()
|
||||
kc._download_threads["some/model"] = prefetch
|
||||
|
||||
# A warm-up that returns without caching the model stands in for a failed one.
|
||||
warmed = threading.Event()
|
||||
warm_up = kc.start_kompress_warmup_thread("some/model", warmed.set)
|
||||
try:
|
||||
kc.ensure_background_download("some/model")
|
||||
assert not warmed.wait(0.2), "warm-up ran while the prefetch was still live"
|
||||
assert started == [], "a request started a download beside the live prefetch"
|
||||
finally:
|
||||
prefetch_done.set()
|
||||
warm_up.join(timeout=10)
|
||||
assert warmed.is_set()
|
||||
|
||||
# Both are done and the model is still not cached: a request may load it now.
|
||||
kc.ensure_background_download("some/model")
|
||||
_drain()
|
||||
assert started == ["some/model"]
|
||||
|
||||
@@ -609,6 +609,71 @@ def test_all_artifacts_failing_at_run_raises_rather_than_returning_a_dead_sessio
|
||||
kc._create_onnx_session("org/model", ["CPUExecutionProvider"])
|
||||
|
||||
|
||||
# ── Load-stage timings: say where a slow warm-up spent its time ────────────────
|
||||
|
||||
|
||||
def _install_ticking_clock(monkeypatch):
|
||||
"""Each clock reading is 1s after the last, so every timed stage costs 1000ms."""
|
||||
|
||||
def ticking_clock():
|
||||
now = [0.0]
|
||||
|
||||
def tick() -> float:
|
||||
now[0] += 1.0
|
||||
return now[0]
|
||||
|
||||
return staticmethod(tick)
|
||||
|
||||
clock = type("_Clock", (), {"perf_counter": ticking_clock(), "thread_time": ticking_clock()})
|
||||
monkeypatch.setattr(kc, "time", clock)
|
||||
|
||||
|
||||
def test_stage_timings_count_every_candidate_attempt(monkeypatch):
|
||||
"""A candidate rejected at smoke-run still costs time, so it shows in the totals."""
|
||||
_install_fake_ort(monkeypatch, run_fails_for={"int8-wo"})
|
||||
_install_ticking_clock(monkeypatch)
|
||||
stage_ms: kc.StageTimings = {}
|
||||
|
||||
kc._create_onnx_session("org/model", ["CPUExecutionProvider"], stage_ms=stage_ms)
|
||||
|
||||
# int8-wo resolved, built and smoke-run (rejected); fp32 the same (accepted).
|
||||
# onnxruntime is imported once, on the first resolved candidate.
|
||||
assert stage_ms == {
|
||||
"artifact_resolve": (2000.0, 2000.0),
|
||||
"onnxruntime_import": (1000.0, 1000.0),
|
||||
"session_build": (2000.0, 2000.0),
|
||||
"smoke_run": (2000.0, 2000.0),
|
||||
}
|
||||
|
||||
|
||||
def test_onnx_load_logs_every_stage(monkeypatch, caplog):
|
||||
import sys
|
||||
from types import SimpleNamespace
|
||||
|
||||
_install_fake_ort(monkeypatch, run_fails_for=set())
|
||||
monkeypatch.setitem(sys.modules, "transformers", SimpleNamespace(AutoTokenizer=object()))
|
||||
monkeypatch.setattr(kc, "_kompress_cache", {})
|
||||
monkeypatch.setattr(
|
||||
kc, "_load_modernbert_tokenizer", lambda _auto, *, allow_download: "tokenizer"
|
||||
)
|
||||
|
||||
with caplog.at_level("INFO", logger=kc.logger.name):
|
||||
kc._load_kompress_onnx("org/model")
|
||||
|
||||
loaded = [r.getMessage() for r in caplog.records if "Kompress ONNX loaded" in r.getMessage()]
|
||||
assert len(loaded) == 1
|
||||
for stage in (
|
||||
"artifact_resolve=",
|
||||
"onnxruntime_import=",
|
||||
"session_build=",
|
||||
"smoke_run=",
|
||||
"transformers_import=",
|
||||
"tokenizer_load=",
|
||||
):
|
||||
assert stage in loaded[0]
|
||||
assert "Downloading" not in caplog.text
|
||||
|
||||
|
||||
# ── Failure latch: a broken model stops costing us every request ───────────────
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,11 @@ def test_all_shipping_mcp_extras_exclude_incompatible_sdk_v2() -> None:
|
||||
|
||||
for extra in ("proxy", "mcp"):
|
||||
requirement = _mcp_requirement(optional[extra])
|
||||
assert requirement.specifier.contains("1.28.1")
|
||||
assert requirement.specifier.contains("1.30.0")
|
||||
# CVE-2026-59951: Streamable HTTP sessions never reclaimed before 1.30.0.
|
||||
assert not requirement.specifier.contains("1.29.1"), (
|
||||
f"the {extra!r} extra admits an MCP SDK affected by CVE-2026-59951"
|
||||
)
|
||||
assert not requirement.specifier.contains("2.0.0"), (
|
||||
f"the {extra!r} extra admits MCP SDK 2.x before the server port in #2658"
|
||||
)
|
||||
|
||||
@@ -156,9 +156,10 @@ def _upstream_stream_field(*, ccr_handle_responses: bool) -> object:
|
||||
|
||||
def test_client_offered_tool_still_buffers_when_handling_is_on(_store) -> None: # noqa: ANN001
|
||||
"""The behaviour being switched off — pinned so the switch is meaningful."""
|
||||
assert _upstream_stream_field(ccr_handle_responses=True) is False
|
||||
# Only the buffered path sends through `_retry_request`, and its request streams.
|
||||
assert _upstream_stream_field(ccr_handle_responses=True) is True
|
||||
|
||||
|
||||
def test_client_offered_tool_does_not_buffer_under_no_ccr(_store) -> None: # noqa: ANN001
|
||||
"""With the switch honoured, the turn keeps streaming despite the tool."""
|
||||
assert _upstream_stream_field(ccr_handle_responses=False) is not False
|
||||
assert _upstream_stream_field(ccr_handle_responses=False) is None
|
||||
|
||||
@@ -141,7 +141,7 @@ def test_streaming_headroom_retrieve_is_intercepted_and_returned_as_sse() -> Non
|
||||
async def _fake_retry(method, url, headers, body, stream=False, **kwargs): # noqa: ANN001
|
||||
initial_bodies.append(json.loads(json.dumps(body)))
|
||||
assert stream is False
|
||||
assert body["stream"] is False
|
||||
assert body["stream"] is True
|
||||
return httpx.Response(200, json=initial_response)
|
||||
|
||||
proxy._retry_request = _fake_retry # type: ignore[assignment]
|
||||
@@ -167,10 +167,10 @@ def test_streaming_headroom_retrieve_is_intercepted_and_returned_as_sse() -> Non
|
||||
assert "text/event-stream" in resp.headers["content-type"]
|
||||
assert "retrieved answer is now available" in resp.text
|
||||
assert "headroom_retrieve" not in resp.text
|
||||
assert initial_bodies and initial_bodies[0]["stream"] is False
|
||||
assert initial_bodies and initial_bodies[0]["stream"] is True
|
||||
assert len(continuation_client.post_calls) == 1
|
||||
continuation_body = json.loads(continuation_client.post_calls[0]["content"].decode())
|
||||
assert continuation_body["stream"] is False
|
||||
assert continuation_body["stream"] is True
|
||||
continuation_headers = {
|
||||
key.lower(): value for key, value in continuation_client.post_calls[0]["headers"].items()
|
||||
}
|
||||
@@ -232,7 +232,7 @@ def test_streaming_with_headroom_retrieve_available_but_unused_returns_sse() ->
|
||||
async def _fake_retry(method, url, headers, body, stream=False, **kwargs): # noqa: ANN001
|
||||
initial_bodies.append(json.loads(json.dumps(body)))
|
||||
assert stream is False
|
||||
assert body["stream"] is False
|
||||
assert body["stream"] is True
|
||||
return httpx.Response(200, json=text_response)
|
||||
|
||||
proxy._retry_request = _fake_retry # type: ignore[assignment]
|
||||
@@ -253,7 +253,7 @@ def test_streaming_with_headroom_retrieve_available_but_unused_returns_sse() ->
|
||||
assert "text/event-stream" in resp.headers["content-type"]
|
||||
assert "plain answer" in resp.text
|
||||
assert "headroom_retrieve" not in resp.text
|
||||
assert initial_bodies and initial_bodies[0]["stream"] is False
|
||||
assert initial_bodies and initial_bodies[0]["stream"] is True
|
||||
assert continuation_client.post_calls == []
|
||||
proxy._stream_response.assert_not_awaited()
|
||||
|
||||
@@ -311,7 +311,7 @@ def test_mixed_ccr_and_client_tool_serves_retrieval_then_streams_reissued_tool()
|
||||
proxy.http_client = continuation_client
|
||||
|
||||
async def _fake_retry(method, url, headers, body, stream=False, **kwargs): # noqa: ANN001
|
||||
assert body["stream"] is False
|
||||
assert body["stream"] is True
|
||||
return httpx.Response(200, json=initial_response)
|
||||
|
||||
proxy._retry_request = _fake_retry # type: ignore[assignment]
|
||||
@@ -393,7 +393,7 @@ def test_mixed_turn_streams_the_continuation_or_the_turn_on_failure(status_code:
|
||||
proxy.http_client = continuation_client
|
||||
|
||||
async def _fake_retry(method, url, headers, body, stream=False, **kwargs): # noqa: ANN001
|
||||
assert body["stream"] is False
|
||||
assert body["stream"] is True
|
||||
return httpx.Response(200, json=initial_response)
|
||||
|
||||
proxy._retry_request = _fake_retry # type: ignore[assignment]
|
||||
|
||||
@@ -14,10 +14,14 @@ from types import SimpleNamespace
|
||||
import pytest
|
||||
|
||||
from headroom.proxy.server import HeadroomProxy
|
||||
from headroom.transforms import kompress_compressor as kc
|
||||
|
||||
_MODEL_ID = "test/warmup-model"
|
||||
|
||||
|
||||
class _Kompress:
|
||||
def __init__(self) -> None:
|
||||
self.config = SimpleNamespace(model_id=_MODEL_ID)
|
||||
self.preloaded = threading.Event()
|
||||
|
||||
def preload(self, *, allow_download: bool = True) -> str:
|
||||
@@ -37,6 +41,16 @@ def _no_delay(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.delenv("HEADROOM_KOMPRESS_WARMUP", raising=False)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _clean_registry():
|
||||
yield
|
||||
with kc._download_threads_lock:
|
||||
thread = kc._download_threads.pop(_MODEL_ID, None)
|
||||
kc._download_failures.pop(_MODEL_ID, None)
|
||||
if thread is not None:
|
||||
thread.join(timeout=5)
|
||||
|
||||
|
||||
def test_warms_on_a_background_thread(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr("platform.libc_ver", lambda: ("glibc", "2.35"))
|
||||
monkeypatch.delenv("PYTEST_CURRENT_TEST", raising=False)
|
||||
@@ -74,3 +88,41 @@ def test_test_processes_do_not_warm_unless_forced(monkeypatch: pytest.MonkeyPatc
|
||||
monkeypatch.setattr("platform.libc_ver", lambda: ("glibc", "2.35"))
|
||||
monkeypatch.setenv("PYTEST_CURRENT_TEST", "x")
|
||||
assert HeadroomProxy._start_kompress_background_warmup(_proxy_with(_Kompress())) is False
|
||||
|
||||
|
||||
def test_request_during_warm_up_does_not_start_a_second_loader(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
"""The warm-up is the model's registered loader until it finishes."""
|
||||
monkeypatch.setattr("platform.libc_ver", lambda: ("glibc", "2.35"))
|
||||
monkeypatch.delenv("PYTEST_CURRENT_TEST", raising=False)
|
||||
monkeypatch.setattr(kc, "_kompress_cache", {})
|
||||
loads: list[str] = []
|
||||
monkeypatch.setattr(
|
||||
kc,
|
||||
"_load_kompress",
|
||||
lambda model_id, device, allow_download=True: (
|
||||
loads.append(model_id) or (None, None, "onnx")
|
||||
),
|
||||
)
|
||||
release = threading.Event()
|
||||
|
||||
class _SlowKompress(_Kompress):
|
||||
def preload(self, *, allow_download: bool = True) -> str:
|
||||
self.preloaded.set()
|
||||
release.wait(5)
|
||||
raise OSError("warm-up failed")
|
||||
|
||||
kompress = _SlowKompress()
|
||||
assert HeadroomProxy._start_kompress_background_warmup(_proxy_with(kompress)) is True
|
||||
assert kompress.preloaded.wait(5)
|
||||
|
||||
kc.ensure_background_download(_MODEL_ID)
|
||||
assert loads == []
|
||||
|
||||
# Once the warm-up is over (here, failed), a request still starts its own load.
|
||||
release.set()
|
||||
kc._download_threads[_MODEL_ID].join(timeout=5)
|
||||
kc.ensure_background_download(_MODEL_ID)
|
||||
kc._download_threads[_MODEL_ID].join(timeout=5)
|
||||
assert loads == [_MODEL_ID]
|
||||
|
||||
@@ -23,9 +23,20 @@ import headroom.proxy.server as server_mod
|
||||
from headroom.proxy.server import ProxyConfig, create_app
|
||||
|
||||
|
||||
def _make_proxy(*, optimize: bool):
|
||||
def _make_proxy(
|
||||
*,
|
||||
optimize: bool,
|
||||
disable_kompress: bool = False,
|
||||
disable_kompress_anthropic: bool | None = None,
|
||||
disable_kompress_openai: bool | None = None,
|
||||
compressors: set[str] | None = None,
|
||||
):
|
||||
config = ProxyConfig(
|
||||
optimize=optimize,
|
||||
disable_kompress=disable_kompress,
|
||||
disable_kompress_anthropic=disable_kompress_anthropic,
|
||||
disable_kompress_openai=disable_kompress_openai,
|
||||
compressors=compressors,
|
||||
cache_enabled=False,
|
||||
rate_limit_enabled=False,
|
||||
cost_tracking_enabled=False,
|
||||
@@ -155,3 +166,120 @@ async def test_startup_reports_deferred_kompress(caplog):
|
||||
assert not any("Kompress: not installed" in message for message in caplog.messages)
|
||||
finally:
|
||||
await proxy.shutdown()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("optimize", [True, False])
|
||||
async def test_startup_reports_disabled_kompress(caplog, monkeypatch, optimize):
|
||||
proxy = _make_proxy(optimize=optimize, disable_kompress=True)
|
||||
monkeypatch.setattr(proxy, "_eager_preload_transforms", lambda: ({}, []))
|
||||
|
||||
try:
|
||||
server_mod.logger.addHandler(caplog.handler)
|
||||
try:
|
||||
with caplog.at_level(logging.INFO, logger=server_mod.logger.name):
|
||||
await proxy.startup()
|
||||
finally:
|
||||
server_mod.logger.removeHandler(caplog.handler)
|
||||
|
||||
assert "Kompress: DISABLED" in caplog.messages
|
||||
assert (
|
||||
"Kompress: not installed (pip install headroom-ai[ml] for ML compression)"
|
||||
not in caplog.messages
|
||||
)
|
||||
finally:
|
||||
await proxy.shutdown()
|
||||
|
||||
|
||||
async def test_startup_keeps_not_installed_message_when_kompress_is_missing(caplog, monkeypatch):
|
||||
proxy = _make_proxy(optimize=True)
|
||||
monkeypatch.setattr(proxy, "_eager_preload_transforms", lambda: ({}, []))
|
||||
|
||||
try:
|
||||
server_mod.logger.addHandler(caplog.handler)
|
||||
try:
|
||||
with caplog.at_level(logging.INFO, logger=server_mod.logger.name):
|
||||
await proxy.startup()
|
||||
finally:
|
||||
server_mod.logger.removeHandler(caplog.handler)
|
||||
|
||||
assert (
|
||||
"Kompress: not installed (pip install headroom-ai[ml] for ML compression)"
|
||||
in caplog.messages
|
||||
)
|
||||
finally:
|
||||
await proxy.shutdown()
|
||||
|
||||
|
||||
async def test_startup_keeps_missing_message_when_provider_override_enables_kompress(
|
||||
caplog, monkeypatch
|
||||
):
|
||||
proxy = _make_proxy(
|
||||
optimize=True,
|
||||
disable_kompress=True,
|
||||
disable_kompress_anthropic=False,
|
||||
)
|
||||
monkeypatch.setattr(proxy, "_eager_preload_transforms", lambda: ({}, []))
|
||||
|
||||
try:
|
||||
server_mod.logger.addHandler(caplog.handler)
|
||||
try:
|
||||
with caplog.at_level(logging.INFO, logger=server_mod.logger.name):
|
||||
await proxy.startup()
|
||||
finally:
|
||||
server_mod.logger.removeHandler(caplog.handler)
|
||||
|
||||
assert "Kompress: DISABLED" not in caplog.messages
|
||||
assert (
|
||||
"Kompress: not installed (pip install headroom-ai[ml] for ML compression)"
|
||||
in caplog.messages
|
||||
)
|
||||
finally:
|
||||
await proxy.shutdown()
|
||||
|
||||
|
||||
async def test_startup_reports_disabled_when_both_providers_disable_kompress(caplog, monkeypatch):
|
||||
proxy = _make_proxy(
|
||||
optimize=True,
|
||||
disable_kompress_anthropic=True,
|
||||
disable_kompress_openai=True,
|
||||
)
|
||||
monkeypatch.setattr(proxy, "_eager_preload_transforms", lambda: ({}, []))
|
||||
|
||||
try:
|
||||
server_mod.logger.addHandler(caplog.handler)
|
||||
try:
|
||||
with caplog.at_level(logging.INFO, logger=server_mod.logger.name):
|
||||
await proxy.startup()
|
||||
finally:
|
||||
server_mod.logger.removeHandler(caplog.handler)
|
||||
|
||||
assert "Kompress: DISABLED" in caplog.messages
|
||||
assert (
|
||||
"Kompress: not installed (pip install headroom-ai[ml] for ML compression)"
|
||||
not in caplog.messages
|
||||
)
|
||||
finally:
|
||||
await proxy.shutdown()
|
||||
|
||||
|
||||
async def test_startup_reports_disabled_when_compressor_selection_omits_kompress(
|
||||
caplog, monkeypatch
|
||||
):
|
||||
proxy = _make_proxy(optimize=True, compressors={"smart_crusher"})
|
||||
monkeypatch.setattr(proxy, "_eager_preload_transforms", lambda: ({}, []))
|
||||
|
||||
try:
|
||||
server_mod.logger.addHandler(caplog.handler)
|
||||
try:
|
||||
with caplog.at_level(logging.INFO, logger=server_mod.logger.name):
|
||||
await proxy.startup()
|
||||
finally:
|
||||
server_mod.logger.removeHandler(caplog.handler)
|
||||
|
||||
assert "Kompress: DISABLED" in caplog.messages
|
||||
assert (
|
||||
"Kompress: not installed (pip install headroom-ai[ml] for ML compression)"
|
||||
not in caplog.messages
|
||||
)
|
||||
finally:
|
||||
await proxy.shutdown()
|
||||
|
||||
@@ -1004,62 +1004,6 @@ async def test_download_and_upload_openai_file_helpers() -> None:
|
||||
assert await handler._upload_openai_file("{}", "bad.jsonl", {}) is None
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_store_google_batch_context_persists_transformed_requests(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
stored_contexts: list[object] = []
|
||||
|
||||
class FakeBatchContext:
|
||||
def __init__(self, **kwargs) -> None: # noqa: ANN003
|
||||
self.kwargs = kwargs
|
||||
self.requests: list[object] = []
|
||||
|
||||
def add_request(self, request) -> None: # noqa: ANN001
|
||||
self.requests.append(request)
|
||||
|
||||
class FakeBatchRequestContext:
|
||||
def __init__(self, **kwargs) -> None: # noqa: ANN003
|
||||
self.kwargs = kwargs
|
||||
|
||||
class FakeStore:
|
||||
async def store(self, context) -> None: # noqa: ANN001
|
||||
stored_contexts.append(context)
|
||||
|
||||
monkeypatch.setitem(
|
||||
sys.modules,
|
||||
"headroom.ccr",
|
||||
SimpleNamespace(
|
||||
BatchContext=FakeBatchContext,
|
||||
BatchRequestContext=FakeBatchRequestContext,
|
||||
get_batch_context_store=lambda: FakeStore(),
|
||||
),
|
||||
)
|
||||
|
||||
handler = DummyBatchHandler()
|
||||
await handler._store_google_batch_context(
|
||||
"batches/123",
|
||||
[
|
||||
{
|
||||
"metadata": {"key": "req-1"},
|
||||
"request": {
|
||||
"contents": [{"parts": [{"text": "hello"}]}],
|
||||
"systemInstruction": {"parts": [{"text": "system"}]},
|
||||
"tools": [{"name": "tool"}],
|
||||
},
|
||||
}
|
||||
],
|
||||
"gemini-2.0",
|
||||
"api-key",
|
||||
)
|
||||
|
||||
context = stored_contexts[0]
|
||||
assert context.kwargs["batch_id"] == "batches/123"
|
||||
assert context.requests[0].kwargs["custom_id"] == "req-1"
|
||||
assert context.requests[0].kwargs["messages"] == [{"role": "user", "content": "hello"}]
|
||||
assert context.requests[0].kwargs["system_instruction"] == "system"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_handle_google_batch_results_passes_through_early_exit_cases(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
@@ -1299,11 +1243,6 @@ async def test_handle_google_batch_create_success_and_failure_paths(
|
||||
|
||||
monkeypatch.setitem(sys.modules, "headroom.ccr", SimpleNamespace(CCRToolInjector=FakeInjector))
|
||||
|
||||
stored: list[tuple[str, list[dict[str, object]], str, str | None]] = []
|
||||
|
||||
async def fake_store(batch_name, requests_list, model, api_key): # noqa: ANN001
|
||||
stored.append((batch_name, requests_list, model, api_key))
|
||||
|
||||
async def fake_retry(method, url, headers, body, **kwargs): # noqa: ANN001
|
||||
return FakeResponse(
|
||||
status_code=200,
|
||||
@@ -1333,7 +1272,6 @@ async def test_handle_google_batch_create_success_and_failure_paths(
|
||||
|
||||
monkeypatch.setattr("headroom.proxy.helpers._read_request_json", good_payload)
|
||||
monkeypatch.setattr(handler, "_retry_request", fake_retry)
|
||||
monkeypatch.setattr(handler, "_store_google_batch_context", fake_store)
|
||||
|
||||
response = await handler.handle_google_batch_create(
|
||||
FakeRequest("{}", headers={"x-goog-api-key": "secret"}),
|
||||
@@ -1343,9 +1281,6 @@ async def test_handle_google_batch_create_success_and_failure_paths(
|
||||
assert dict(response.headers)["x-upstream"] == "1"
|
||||
assert handler.metrics.record_calls[-1]["provider"] == "google"
|
||||
assert handler.metrics.record_calls[-1]["tokens_saved"] == 60
|
||||
assert stored[0][0] == "batches/123"
|
||||
assert stored[0][2:] == ("gemini-pro", "secret")
|
||||
assert stored[0][1][0]["metadata"] == {"key": "req-1"}
|
||||
|
||||
async def broken_retry(method, url, headers, body, **kwargs): # noqa: ANN001
|
||||
raise RuntimeError("forward failed")
|
||||
@@ -1673,59 +1608,6 @@ async def test_batch_helper_methods_and_openai_file_error_branches() -> None:
|
||||
assert await handler._upload_openai_file("{}", "missing-id.jsonl", {}) is None
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_store_google_batch_context_without_system_text(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
stored_contexts: list[object] = []
|
||||
|
||||
class FakeBatchContext:
|
||||
def __init__(self, **kwargs) -> None: # noqa: ANN003
|
||||
self.kwargs = kwargs
|
||||
self.requests: list[object] = []
|
||||
|
||||
def add_request(self, request) -> None: # noqa: ANN001
|
||||
self.requests.append(request)
|
||||
|
||||
class FakeBatchRequestContext:
|
||||
def __init__(self, **kwargs) -> None: # noqa: ANN003
|
||||
self.kwargs = kwargs
|
||||
|
||||
class FakeStore:
|
||||
async def store(self, context) -> None: # noqa: ANN001
|
||||
stored_contexts.append(context)
|
||||
|
||||
handler = DummyBatchHandler()
|
||||
monkeypatch.setitem(
|
||||
sys.modules,
|
||||
"headroom.ccr",
|
||||
SimpleNamespace(
|
||||
BatchContext=FakeBatchContext,
|
||||
BatchRequestContext=FakeBatchRequestContext,
|
||||
get_batch_context_store=lambda: FakeStore(),
|
||||
),
|
||||
)
|
||||
|
||||
await handler._store_google_batch_context(
|
||||
"batches/456",
|
||||
[
|
||||
{
|
||||
"request": {
|
||||
"contents": [{"parts": [{"text": "hello"}]}],
|
||||
"systemInstruction": {"parts": ["bad"]},
|
||||
}
|
||||
}
|
||||
],
|
||||
"gemini-2.0",
|
||||
None,
|
||||
)
|
||||
|
||||
context = stored_contexts[0]
|
||||
assert context.kwargs["api_key"] is None
|
||||
assert context.requests[0].kwargs["custom_id"] == ""
|
||||
assert context.requests[0].kwargs["system_instruction"] is None
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_compress_batch_jsonl_skips_blank_lines_and_preserves_tools_when_not_injected(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
|
||||
@@ -295,7 +295,8 @@ def test_buffered_ccr_turn_does_not_write_the_response_cache():
|
||||
|
||||
assert resp.status_code == 200, resp.text
|
||||
# The conversion really happened — otherwise this test proves nothing.
|
||||
assert forwarded_bodies and forwarded_bodies[0]["stream"] is False
|
||||
# Buffered: the request streams upstream and the proxy folds the reply.
|
||||
assert forwarded_bodies and forwarded_bodies[0]["stream"] is True
|
||||
# ...and nothing was written to the response cache.
|
||||
proxy.cache.set.assert_not_awaited()
|
||||
reset_compression_store()
|
||||
|
||||
@@ -277,3 +277,50 @@ def test_stats_preserves_default_smart_crusher_compaction_state() -> None:
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json()["config"]["smart_crusher_with_compaction"] is None
|
||||
|
||||
|
||||
def _read_maturation_app(mode: str, quiesce_turns: int = 5):
|
||||
return create_app(
|
||||
ProxyConfig(
|
||||
mode=mode,
|
||||
read_maturation=True,
|
||||
read_maturation_quiesce_turns=quiesce_turns,
|
||||
optimize=False,
|
||||
cache_enabled=False,
|
||||
rate_limit_enabled=False,
|
||||
cost_tracking_enabled=False,
|
||||
log_requests=False,
|
||||
ccr_inject_tool=False,
|
||||
ccr_handle_responses=False,
|
||||
ccr_context_tracking=False,
|
||||
http2=False,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("mode", "quiesce_turns", "effective", "startup_level"),
|
||||
[
|
||||
("cache", 5, False, "WARNING"),
|
||||
("token", 5, True, "INFO"),
|
||||
# A zero threshold matures a Read in the still-mutable latest turn.
|
||||
("cache", 0, True, "INFO"),
|
||||
],
|
||||
)
|
||||
def test_read_maturation_reports_whether_it_can_fire(
|
||||
mode, quiesce_turns, effective, startup_level, caplog
|
||||
):
|
||||
"""Cache mode freezes a Read before it can quiesce, so enabled maturation
|
||||
never fires there; startup and /stats must say so instead of reporting a
|
||||
silently inert feature as on."""
|
||||
app = _read_maturation_app(mode, quiesce_turns)
|
||||
|
||||
with caplog.at_level("INFO", logger="headroom.proxy"):
|
||||
with TestClient(app, base_url="http://127.0.0.1", client=("127.0.0.1", 12345)) as client:
|
||||
payload = client.get("/stats").json()["read_maturation"]
|
||||
|
||||
assert payload["enabled"] is True
|
||||
assert payload["effective"] is effective
|
||||
assert (payload["inert_reason"] is None) is effective
|
||||
banner = [r for r in caplog.records if r.getMessage().startswith("Read maturation:")]
|
||||
assert [r.levelname for r in banner] == [startup_level]
|
||||
|
||||
@@ -42,7 +42,16 @@ def test_blocks_internal_and_invalid(url: str) -> None:
|
||||
assert is_safe_upstream_url(url) is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize("url", ["https://8.8.8.8/v1", "https://1.1.1.1/", "wss://9.9.9.9/rt"])
|
||||
@pytest.mark.parametrize(
|
||||
"url",
|
||||
[
|
||||
"https://8.8.8.8/v1",
|
||||
"https://1.1.1.1/",
|
||||
"wss://9.9.9.9/rt",
|
||||
# NAT64 well-known prefix embedding 8.8.8.8: the translator delivers it there.
|
||||
"https://[64:ff9b::808:808]/v1",
|
||||
],
|
||||
)
|
||||
def test_allows_public(url: str) -> None:
|
||||
assert is_safe_upstream_url(url) is True
|
||||
|
||||
@@ -63,7 +72,12 @@ def test_allows_public(url: str) -> None:
|
||||
("6to4 embedding loopback", "http://[2002:7f00:1::]/"),
|
||||
("6to4 embedding RFC1918", "http://[2002:a00:1::]/"),
|
||||
("NAT64 embedding loopback", "http://[64:ff9b::7f00:1]/"),
|
||||
("NAT64 embedding RFC1918", "http://[64:ff9b::a00:1]/"),
|
||||
("NAT64 embedding metadata", "http://[64:ff9b::a9fe:a9fe]/"),
|
||||
("NAT64 local-use prefix", "http://[64:ff9b:1::7f00:1]/"),
|
||||
# Local-use embedding depends on the operator's prefix length, so the
|
||||
# low 32 bits are not reliably the destination: never unwrapped.
|
||||
("NAT64 local-use prefix embedding a public IPv4", "http://[64:ff9b:1::808:808]/"),
|
||||
("teredo", "http://[2001:0::7f00:1]/"),
|
||||
("IPv4-mapped metadata", "http://[::ffff:169.254.169.254]/"),
|
||||
("IPv4-mapped loopback", "http://[::ffff:127.0.0.1]/"),
|
||||
@@ -582,6 +596,33 @@ def test_a_check_pins_every_address_it_accepted(monkeypatch: pytest.MonkeyPatch)
|
||||
assert upstream_guard.validated_addresses("multi.homed.example") == ("8.8.8.8", "1.1.1.1")
|
||||
|
||||
|
||||
def test_a_dns64_answer_for_a_public_host_is_accepted_and_pinned(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
"""On a DNS64 network an IPv4-only host also gets a synthesized `64:ff9b::` AAAA.
|
||||
|
||||
Judging that AAAA as reserved rejected every IPv4-only upstream there, and
|
||||
the OpenAI handler then sent the request -- key included -- to the
|
||||
configured upstream instead.
|
||||
"""
|
||||
from headroom.proxy import upstream_guard
|
||||
|
||||
def dns64_answer(*args: object, **kwargs: object) -> list[object]:
|
||||
return [
|
||||
(None, None, None, None, ("8.8.8.8", 443)),
|
||||
(None, None, None, None, ("64:ff9b::808:808", 443, 0, 0)),
|
||||
]
|
||||
|
||||
monkeypatch.setattr(socket, "getaddrinfo", dns64_answer)
|
||||
upstream_guard.clear_validated_addresses()
|
||||
|
||||
assert is_safe_upstream_url("https://ipv4-only.example/v1") is True
|
||||
assert upstream_guard.validated_addresses("ipv4-only.example") == (
|
||||
"8.8.8.8",
|
||||
"64:ff9b::808:808",
|
||||
)
|
||||
|
||||
|
||||
def test_a_rejected_or_allowlisted_destination_pins_nothing(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
|
||||
@@ -1504,6 +1504,7 @@ source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "ast-grep-cli" },
|
||||
{ name = "click" },
|
||||
{ name = "hf-xet", marker = "platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'" },
|
||||
{ name = "litellm" },
|
||||
{ name = "opentelemetry-api" },
|
||||
{ name = "pydantic" },
|
||||
@@ -1776,6 +1777,7 @@ requires-dist = [
|
||||
{ name = "headroom-ai", extras = ["proxy", "code", "ml", "memory", "relevance", "image", "reports", "otel", "evals", "voice", "html", "mcp", "spreadsheet"], marker = "extra == 'all'" },
|
||||
{ name = "headroom-ai", extras = ["proxy", "code", "relevance", "reports", "otel", "html", "mcp", "spreadsheet"], marker = "extra == 'sandbox'" },
|
||||
{ name = "headroom-ai", extras = ["voice"], marker = "extra == 'voice-train'" },
|
||||
{ name = "hf-xet", marker = "platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'", specifier = ">=1.6.0" },
|
||||
{ name = "hnswlib", marker = "extra == 'dev'", specifier = ">=0.8.0" },
|
||||
{ name = "hnswlib", marker = "extra == 'vector'", specifier = ">=0.8.0" },
|
||||
{ name = "httpx", marker = "extra == 'mcp'", specifier = ">=0.24.0" },
|
||||
@@ -1792,8 +1794,8 @@ requires-dist = [
|
||||
{ name = "litellm", specifier = ">=1.96.2,<2.0" },
|
||||
{ name = "litellm", marker = "extra == 'dev'", specifier = ">=1.96.2,<2.0" },
|
||||
{ name = "magika", marker = "(python_full_version < '3.14' and extra == 'proxy') or (platform_machine != 'x86_64' and extra == 'proxy') or (sys_platform != 'darwin' and extra == 'proxy')", specifier = ">=0.6.0" },
|
||||
{ name = "mcp", marker = "extra == 'mcp'", specifier = ">=1.28.1,<2.0.0" },
|
||||
{ name = "mcp", marker = "extra == 'proxy'", specifier = ">=1.28.1,<2.0.0" },
|
||||
{ name = "mcp", marker = "extra == 'mcp'", specifier = ">=1.30.0,<2.0.0" },
|
||||
{ name = "mcp", marker = "extra == 'proxy'", specifier = ">=1.30.0,<2.0.0" },
|
||||
{ name = "mem0ai", marker = "extra == 'memory-stack'", specifier = ">=2.0.0,<3.0" },
|
||||
{ name = "mypy", marker = "extra == 'dev'", specifier = ">=1.0.0" },
|
||||
{ name = "neo4j", marker = "extra == 'memory-stack'", specifier = ">=5.20.0,<7.0" },
|
||||
@@ -1869,34 +1871,26 @@ provides-extras = ["proxy", "proxy-prod", "code", "ml", "memory", "vector", "mem
|
||||
|
||||
[[package]]
|
||||
name = "hf-xet"
|
||||
version = "1.5.0"
|
||||
version = "1.6.0"
|
||||
source = { registry = "https://pypi.org/simple/" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/74/d8/5c06fc76461418326a7decf8367480c35be11a41fd938633929c60a9ec6b/hf_xet-1.5.0.tar.gz", hash = "sha256:e0fb0a34d9f406eed88233e829a67ec016bec5af19e480eac65a233ea289a948", size = 837196, upload-time = "2026-05-06T06:18:15.583Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/1b/ab/522a2ab67f27971a9d48ca666d4fca85ef7d5282d142e31fd087e27b1bbe/hf_xet-1.6.0.tar.gz", hash = "sha256:2e58454a340b3556dfa4972d5451aff4fba8dd42a236600ba1a1d2b1514f0fef", size = 920527, upload-time = "2026-08-03T22:33:13.243Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/68/9b/6912c99070915a4f28119e3c5b52a9abd1eec0ad5cb293b8c967a0c6f5a2/hf_xet-1.5.0-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:7d70fe2ce97b9db73b9c9b9c81fe3693640aec83416a966c446afea54acfae3c", size = 4023383, upload-time = "2026-05-06T06:17:53.947Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0f/6d/9563cfde59b5d8128a9c7ec972a087f4c782e4f7bac5a85234edfd5d5e49/hf_xet-1.5.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:73a0dae8c71de3b0633a45c73f4a4a5ed09e94b43441d82981a781d4f12baa42", size = 3792751, upload-time = "2026-05-06T06:17:51.791Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/07/a5/ed5a0cf35b49a0571af5a8f53416dad1877a718c021c9937c3a53cb45781/hf_xet-1.5.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a60290ec57e9b71767fba7c3645ddafdd0759974b540441510c629c6db6db24a", size = 4456058, upload-time = "2026-05-06T06:17:40.735Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/60/fb/3ae8bf2a7a37a4197d0195d7247fd25b3952e15cb8a599e285dfaa6f52b3/hf_xet-1.5.0-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:e5de0f6deada0dada870bb376a11bcd1f08abf3a968a6d118f33e72d1b1eb480", size = 4250783, upload-time = "2026-05-06T06:17:38.412Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a2/9b/8bae40d4d91525085137196e84eb0ed49cf65b5e96e5c3ecdadd8bd0fac2/hf_xet-1.5.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:c799d49f1a5544a0ef7591c0ee75e0d6b93d6f56dc7a4979f59f7518d2872216", size = 4445594, upload-time = "2026-05-06T06:18:04.219Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/13/59/c74efbbd4e8728172b2cc72a2bc014d2947a4b7bdced932fbd3f5da1a4e5/hf_xet-1.5.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:2baea1b0b989e5c152fe81425f7745ddc8901280ba3d97c98d8cdece7b706c60", size = 4663995, upload-time = "2026-05-06T06:18:06.1Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/73/32/8e1e0410af64cda9b139d1dcebdc993a8ff9c8c7c0e2696ae356d75ccc0d/hf_xet-1.5.0-cp313-cp313t-win_amd64.whl", hash = "sha256:526345b3ed45f374f6317349df489167606736c876241ba984105afe7fd4839d", size = 3966608, upload-time = "2026-05-06T06:18:19.74Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fc/34/a8febc8f4edbea8b3e21b02ebc8b628679b84ba7e45cde624a7736b51500/hf_xet-1.5.0-cp313-cp313t-win_arm64.whl", hash = "sha256:786d28e2eb8315d5035544b9d137b4a842d600c434bb91bf7d0d953cce906ad4", size = 3796946, upload-time = "2026-05-06T06:18:17.568Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/20/8fc8996afe5815fa1a6be8e9e5c02f24500f409d599e905800d498a4e14d/hf_xet-1.5.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:872d5601e6deea30d15865ede55d29eac6daf5a534ab417b99b6ef6b076dd96c", size = 4023495, upload-time = "2026-05-06T06:18:01.94Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/32/6a/93d84463c00cecb561a7508aa6303e35ee2894294eac14245526924415fe/hf_xet-1.5.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:9929561f5abf4581c8ea79587881dfef6b8abb2a0d8a51915936fc2a614f4e73", size = 3792731, upload-time = "2026-05-06T06:18:00.021Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/5a/8ec8e0c863b382d00b3c2e2af6ded6b06371be617144a625903a6d562f4b/hf_xet-1.5.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f7b7bbae318e583a86fb21e5a4a175d6721d628a2874f4bd022d0e660c32a682", size = 4456738, upload-time = "2026-05-06T06:17:49.574Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c5/ca/f7effa1a67717da2bcc6b6c28f71c6ca648c77acaec4e2c32f40cbe16d85/hf_xet-1.5.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:cf7b2dc6f31a4ea754bb50f74cde482dcf5d366d184076d8530b9872787f3761", size = 4251622, upload-time = "2026-05-06T06:17:47.096Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/65/f2/19247dba3e231cf77dec59ddfb878f00057635ff773d099c9b59d37812c3/hf_xet-1.5.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8dbcbab554c9ef158ef2c991545c3e970ddd8cc7acdcd0a78c5a41095dab4ded", size = 4445667, upload-time = "2026-05-06T06:18:11.983Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7f/64/6f116801a3bcfb6f59f5c251f48cadc47ea54026441c4a385079286a94fa/hf_xet-1.5.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5906bf7718d3636dc13402914736abe723492cb730f744834f5f5b67d3a12702", size = 4664619, upload-time = "2026-05-06T06:18:13.771Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5c/e8/069542d37946ed08669b127e1496fa99e78196d71de8d41eda5e9f1b7a58/hf_xet-1.5.0-cp314-cp314t-win_amd64.whl", hash = "sha256:5f3dc2248fc01cc0a00cd392ab497f1ca373fcbc7e3f2da1f452480b384e839e", size = 3966802, upload-time = "2026-05-06T06:18:28.162Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f9/91/fc6fdec27b14d04e88c386ac0a0129732b53fa23f7c4a78f4b83a039c567/hf_xet-1.5.0-cp314-cp314t-win_arm64.whl", hash = "sha256:b285cea1b5bab46b758772716ba8d6854a1a0310fed1c249d678a8b38601e5a0", size = 3797168, upload-time = "2026-05-06T06:18:26.287Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3d/fb/69ff198a82cae7eb1a69fb84d93b3a3e4816564d76817fe541ddc96874eb/hf_xet-1.5.0-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:dad0dc84e941b8ba3c860659fe1fdc35c049d47cce293f003287757e971a8f56", size = 4030814, upload-time = "2026-05-06T06:17:57.933Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9b/ff/edcc2b40162bef3ff78e14ab637e5f3b89243d6aee72f5949d3bb6a5af83/hf_xet-1.5.0-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:fd6e5a9b0fdac4ed03ed45ef79254a655b1aaab514a02202617fbf643f5fdf7a", size = 3798444, upload-time = "2026-05-06T06:17:55.79Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/49/4d/103f76b04310e5e57656696cc184690d20c466af0bca3ca88f8c8ea5d4f3/hf_xet-1.5.0-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3531b1823a0e6d77d80f9ed15ca0e00f0d115094f8ac033d5cae88f4564cc949", size = 4465986, upload-time = "2026-05-06T06:17:44.886Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c4/a2/546f47f464737b3edbab6f8ddb57f2599b93d2cbb66f06abb475ccb48651/hf_xet-1.5.0-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:9a0ee58cd18d5ea799f7ed11290bbccbe56bdd8b1d97ca74b9cc49a3945d7a3b", size = 4259865, upload-time = "2026-05-06T06:17:42.639Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/95/7f/1be593c1f28613be2e196473481cd81bfc5910795e30a34e8f744f6cac4f/hf_xet-1.5.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1e60df5a42e9bed8628b6416af2cba4cba57ae9f02de226a06b020d98e1aab18", size = 4459835, upload-time = "2026-05-06T06:18:08.026Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/aa/b2/703569fc881f3284487e68cda7b42179978480da3c438042a6bbbb4a671c/hf_xet-1.5.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:4b35549ce62601b84da4ff9b24d970032ace3d4430f52d91bcbb26c901d6c690", size = 4672414, upload-time = "2026-05-06T06:18:09.864Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/af/37/1b6def445c567286b50aa3b33828158e135b1be44938dde59f11382a500c/hf_xet-1.5.0-cp37-abi3-win_amd64.whl", hash = "sha256:2806c7c17b4d23f8d88f7c4814f838c3b6150773fe339c20af23e1cfaf2797e4", size = 3977238, upload-time = "2026-05-06T06:18:23.621Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/62/94/3b66b148778ee100dcfd69c2ca22b57b41b44d3063ceec934f209e9184ce/hf_xet-1.5.0-cp37-abi3-win_arm64.whl", hash = "sha256:b6c9df403040248c76d808d3e047d64db2d923bae593eb244c41e425cf6cd7be", size = 3806916, upload-time = "2026-05-06T06:18:21.7Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/41/62/3c062f593bd92ef4e77a0ef39541e3d82a0a1d3947c8a777a02a13a27828/hf_xet-1.6.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:70cbb9c896901600128cb9b6f06e132954fbede1db30f31f7c6c63f84cb7c31d", size = 4074584, upload-time = "2026-08-03T22:32:47.364Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bb/1e/c0ad437dd267a8e435bef594acf781bbc3874ff0b6435b4962d03ecf7cc4/hf_xet-1.6.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:23379c2f9ec8696d952b16414a2bae72cad86a52df869b050698ba60f538c675", size = 3867381, upload-time = "2026-08-03T22:32:49.049Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d5/ee/7c0d7b6ab336167531b1c30af2af003f054af4c749becbd7209ae33a77c3/hf_xet-1.6.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f2f7278c05c22fd60cb436cda1269649b3e81db65ecdc8496e5e164aa4143e7b", size = 4453982, upload-time = "2026-08-03T22:32:50.568Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/63/06/ad8eab1c9525246650cbaa821caa3cdbaca734ab1a5b8c91bea09cbd8d69/hf_xet-1.6.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:948f15d3a9545cfe5932f6bd8b440f6ae630aee108f14b7bd6c561f7c2dcc522", size = 4249445, upload-time = "2026-08-03T22:32:52.391Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d8/26/1eee8aedb0dafc1ab9717dc9ac602cde33361b232dc06803f1f6ed18b58c/hf_xet-1.6.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5153e6bb103ad49d6ea9f1b2e230db5a2ea32551ad09a706d2f61d7c7c80d80e", size = 4451099, upload-time = "2026-08-03T22:32:54.114Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/67/57/0b88af1f194ab6c9c650547d9cc06bfeaab836ae4dcdb331676bfb8be95a/hf_xet-1.6.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:35cec30d75c6f9eb9c16a77cef68e85a103b72e24d4b473714ec9ff06428bab9", size = 4664712, upload-time = "2026-08-03T22:32:55.547Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/53/a0/26b717a9d1840e8abf48dcec64b5ed8fbe472671d38ad28d30e147132b33/hf_xet-1.6.0-cp314-cp314t-win_amd64.whl", hash = "sha256:5789835d7c6bc9436962853192082374297fb72d7eff7e7762ec25ceb7e25338", size = 4025906, upload-time = "2026-08-03T22:32:57.391Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/49/f6/4a9966633c6fef83af997e2cff68ec1963676d412bdfd096df2a93b8e185/hf_xet-1.6.0-cp314-cp314t-win_arm64.whl", hash = "sha256:75765820ce4700db3750c94acc8fe27c5fae4c9ec000a0dbac3ca082acf97765", size = 3849221, upload-time = "2026-08-03T22:32:59.123Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a2/50/7afa2c9c787405864fc47a0d1bbc02c62e9101947ed43c1f43899fc7d91d/hf_xet-1.6.0-cp38-abi3-macosx_10_12_x86_64.whl", hash = "sha256:633dc0cd71d32da58ab8c03ad38e2fac452c15c2b0a2866ebf6ededfe0a5061d", size = 4071729, upload-time = "2026-08-03T22:33:00.721Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4b/69/55b8dcf636142ae660fec1869fcac14c4da2e8412e14d6eee1523be77e9f/hf_xet-1.6.0-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:f0906082d9932ae0c0057fa194041c22b4e2cdb46b2592ef3b91f020d62a081a", size = 3876287, upload-time = "2026-08-03T22:33:02.251Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/67/4e/a28359bf1c1ecf11eba22123168c138698f7cb576ac678f5a2e16cd5da08/hf_xet-1.6.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d62671bb130879cef0ee4c9ebe47a14af6c66ec53e6d84dc15936e5ffdfac82f", size = 4464663, upload-time = "2026-08-03T22:33:03.802Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9a/69/1f0cbc2fb22ae6082d094f743d1b8945a3f36f6089cb95f42b7ee348cda7/hf_xet-1.6.0-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:0e6e21fa3cdfcdcd76748564bf593870a5e013f47d97cf10aed63aa222cff5b7", size = 4262538, upload-time = "2026-08-03T22:33:05.287Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/3a/4f4f2301ade26e404462d3336fa11f7958d914cabbabdd6e03c3c5d5658c/hf_xet-1.6.0-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:4fc74352a17015bd0ee90038bc9efe38db894cde45f268b6712b04fce8cd0acb", size = 4460520, upload-time = "2026-08-03T22:33:06.81Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ab/5f/311725e2a905534dfee2dcb5b08414f249147f1f12252bfc2bd24caa075c/hf_xet-1.6.0-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:8fb4f71cba6129110c3374a33f919001ff130488fc23553698e34cc1c2a1198c", size = 4675937, upload-time = "2026-08-03T22:33:08.616Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/98/b7/8c59a66d15205024662f1d66968136f13893f96df1ddc5087e2e281fc95f/hf_xet-1.6.0-cp38-abi3-win_amd64.whl", hash = "sha256:fb4fadde1b2b70bf4c0c14a6dccbe7194b1c28947fefd5bbe3fed9d940676c3b", size = 4033128, upload-time = "2026-08-03T22:33:10.171Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/73/63/ca511b6f802f28cf3489b280fe77475bcca8de85e81a6299d7916b5b5555/hf_xet-1.6.0-cp38-abi3-win_arm64.whl", hash = "sha256:3dc3e35441ba395006af5aaacc40ef2e603c51ef46c3530b9156185f00935ea3", size = 3859359, upload-time = "2026-08-03T22:33:11.725Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2770,7 +2764,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "mcp"
|
||||
version = "1.28.1"
|
||||
version = "1.30.0"
|
||||
source = { registry = "https://pypi.org/simple/" }
|
||||
dependencies = [
|
||||
{ name = "anyio" },
|
||||
@@ -2788,9 +2782,9 @@ dependencies = [
|
||||
{ name = "typing-inspection" },
|
||||
{ name = "uvicorn", marker = "sys_platform != 'emscripten'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/6e/77/9450b8f251a13affb6281997d0523c4615f8a8b35d0b21ff30db3a5aac9d/mcp-1.28.1.tar.gz", hash = "sha256:d51e36a5f5644faea4f85ea649bfffa6bc6c26770d42798ad6a3de3d2ba69683", size = 638501, upload-time = "2026-06-26T12:57:29.093Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ba/93/0142dc84a666daf8ad51a34268f34c12fd6fda4f3810c4be2504eecc8212/mcp-1.30.0.tar.gz", hash = "sha256:445414625fce5c295faa505bb11bacece661ab6f4028d57c935db57820b7a3e4", size = 680511, upload-time = "2026-09-07T14:34:15.845Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e2/5e/d118fce19f87a2e7d8101c35c8ae0ec289098a4df0ff244cec23e415aca0/mcp-1.28.1-py3-none-any.whl", hash = "sha256:2726bca5e7193f61c5dde8b12500a6de2d9acf6d1a1c0be9e8c2e706437991df", size = 222620, upload-time = "2026-06-26T12:57:27.218Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f5/f4/e58bc33317c92a0203664daaf00bf6f41166cc0149e5d6870a03f7cd004a/mcp-1.30.0-py3-none-any.whl", hash = "sha256:666edb5009503e1047c9d60346a756f94b261f05cc2625f23d41c728ffc484d0", size = 234581, upload-time = "2026-09-07T14:34:14.266Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
Reference in New Issue
Block a user