@psnext/slingcli 2.5.20260623-1 → 2.5.20260705-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@aws/lambda-invoke-store/README.md +25 -1
- package/node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js +12 -0
- package/node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js +12 -0
- package/node_modules/@aws/lambda-invoke-store/dist-types/invoke-store.d.ts +6 -0
- package/node_modules/@aws/lambda-invoke-store/package.json +1 -1
- package/node_modules/@aws-sdk/core/account-id-endpoint.d.ts +1 -3
- package/node_modules/@aws-sdk/core/client.d.ts +1 -3
- package/node_modules/@aws-sdk/core/httpAuthSchemes.d.ts +1 -3
- package/node_modules/@aws-sdk/core/package.json +10 -17
- package/node_modules/@aws-sdk/core/protocols.d.ts +1 -3
- package/node_modules/@aws-sdk/core/util.d.ts +1 -3
- package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +172 -1
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +3 -51
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-http/package.json +8 -10
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
- package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +58 -3
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -8
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-websocket/package.json +7 -7
- package/node_modules/@aws-sdk/nested-clients/cognito-identity.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +13 -25
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +13 -17
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +12 -15
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +12 -15
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +13 -25
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/commandBuilder.js +6 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/commands/GetIdCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/index.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.native.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.shared.js +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commandBuilder.js +8 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +2 -17
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/index.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.browser.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.native.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commandBuilder.js +6 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/index.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.browser.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.native.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.shared.js +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commandBuilder.js +6 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/index.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.browser.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.native.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.shared.js +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commandBuilder.js +6 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js +2 -14
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/index.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.browser.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.native.js +0 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/commandBuilder.d.ts +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/commands/GetIdCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commandBuilder.d.ts +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/commandBuilder.d.ts +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/commands/GetRoleCredentialsCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/commandBuilder.d.ts +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/commands/CreateTokenCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commandBuilder.d.ts +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commands/AssumeRoleCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/commandBuilder.d.ts +46 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.d.ts +7 -16
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/commands/GetIdCommand.d.ts +7 -16
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/commandBuilder.d.ts +42 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/commandBuilder.d.ts +42 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/commands/GetRoleCredentialsCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/commandBuilder.d.ts +42 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/commands/CreateTokenCommand.d.ts +3 -8
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/commandBuilder.d.ts +46 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/commands/AssumeRoleCommand.d.ts +7 -16
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.d.ts +7 -16
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +8 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.shared.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +3 -51
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -3
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -3
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +4 -4
- package/node_modules/@aws-sdk/nested-clients/package.json +8 -10
- package/node_modules/@aws-sdk/nested-clients/signin.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/sso-oidc.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/sso.d.ts +1 -3
- package/node_modules/@aws-sdk/nested-clients/sts.d.ts +1 -3
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -4
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +236 -3
- package/node_modules/@aws-sdk/xml-builder/package.json +3 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +10 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +9 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +20 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +2 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +51 -47
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +11 -17
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +25 -11
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare.js +0 -18
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +8 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +8 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +68 -43
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +38 -29
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +189 -204
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +26 -35
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +4 -6
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +11 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +19 -4
- package/node_modules/@earendil-works/pi-ai/dist/compat.js +81 -7
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +60 -45
- package/node_modules/@earendil-works/pi-ai/dist/images-models.js +7 -3
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/legacy-api-aliases.js +49 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.js +7 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js +149 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.js +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js +18 -34
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js +39 -9
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js +85 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.js +13 -13
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +1 -20
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js +20 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.js +72 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js +23 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +16 -16
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js +90 -17
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +390 -102
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js +39 -20
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +389 -80
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js +7 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js +15 -15
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.js +6 -6
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.js +6 -6
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +109 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +95 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.js +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +15 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +87 -0
- package/node_modules/@earendil-works/pi-ai/package.json +1 -33
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +13 -25
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +50 -34
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +13 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +11 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +11 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +33 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js +28 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +2 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +15 -18
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +0 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +96 -73
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +19 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/timings.js +24 -14
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +20 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +12 -25
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +20 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +23 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js +52 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/extension-editor.js +12 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/session-selector.js +14 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js +60 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +19 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +180 -155
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +14 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +16 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/rpc-entry.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-convert.js +21 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-process.js +83 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/mime.js +41 -0
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -12
- package/node_modules/@earendil-works/pi-coding-agent/package.json +8 -5
- package/node_modules/@earendil-works/pi-orchestrator/dist/cli.js +136 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/config.js +55 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/handler.js +105 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/index.js +11 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/ipc/client.js +56 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/ipc/protocol.js +12 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/ipc/server.js +145 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/radius.js +365 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/rpc-process.js +168 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/serve.js +70 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/storage.js +58 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/supervisor.js +290 -0
- package/node_modules/@earendil-works/pi-orchestrator/dist/types.js +2 -0
- package/node_modules/@earendil-works/pi-orchestrator/package.json +45 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +3 -0
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.browser.js +358 -145
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js +462 -142
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.native.js +358 -145
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +18 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +108 -63
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +11 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +11 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +5 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +30 -36
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +85 -137
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +30 -36
- package/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Js.js +30 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Node.js +24 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/index.browser.js +7 -1
- package/node_modules/@smithy/core/dist-es/submodules/checksum/index.js +7 -1
- package/node_modules/@smithy/core/dist-es/submodules/checksum/index.native.js +7 -1
- package/node_modules/@smithy/core/dist-es/submodules/checksum/md5/Md5Js.js +92 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/md5/Md5Node.js +29 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Js.js +179 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Node.js +59 -0
- package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256WebCrypto.js +71 -0
- package/node_modules/@smithy/core/dist-es/submodules/client/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/client-command-builder.js +17 -0
- package/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/config.js +6 -1
- package/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/getInstanceMetadataRegion.js +92 -0
- package/node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/constants.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/resolveDefaultsModeConfig.js +3 -56
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js +5 -3
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js +7 -6
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -1
- package/node_modules/@smithy/core/dist-es/submodules/serde/concatBytes.js +15 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/checksum/ChecksumStream.js +35 -27
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/headStream.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js +12 -38
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js +18 -33
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.browser.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.js +3 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/crc32/Crc32Js.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/crc32/Crc32Node.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/index.browser.d.ts +7 -1
- package/node_modules/@smithy/core/dist-types/submodules/checksum/index.d.ts +7 -1
- package/node_modules/@smithy/core/dist-types/submodules/checksum/index.native.d.ts +7 -1
- package/node_modules/@smithy/core/dist-types/submodules/checksum/md5/Md5Js.d.ts +19 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/md5/Md5Node.d.ts +17 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256Js.d.ts +28 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256Node.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256WebCrypto.d.ts +22 -0
- package/node_modules/@smithy/core/dist-types/submodules/client/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/client-command-builder.d.ts +22 -0
- package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/command.d.ts +5 -6
- package/node_modules/@smithy/core/dist-types/submodules/config/config-resolver/regionConfig/getInstanceMetadataRegion.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/submodules/config/defaults-mode/constants.d.ts +12 -0
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/index.browser.d.ts +4 -5
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/index.d.ts +4 -5
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.d.ts +3 -4
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/endpointMiddleware.d.ts +1 -2
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/getEndpointPlugin.d.ts +1 -2
- package/node_modules/@smithy/core/dist-types/submodules/serde/concatBytes.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.browser.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.native.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/checksum/ChecksumStream.d.ts +29 -12
- package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/stream-collector.browser.d.ts +8 -2
- package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/stream-collector.d.ts +4 -1
- package/node_modules/@smithy/core/package.json +5 -5
- package/node_modules/@smithy/credential-provider-imds/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +2 -55
- package/node_modules/@smithy/fetch-http-handler/dist-es/index.js +2 -2
- package/node_modules/@smithy/fetch-http-handler/dist-types/index.d.ts +2 -2
- package/node_modules/@smithy/fetch-http-handler/package.json +4 -4
- package/node_modules/@smithy/signature-v4/package.json +3 -4
- package/node_modules/@smithy/types/dist-types/index.d.ts +1 -0
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.d.ts +64 -25
- package/node_modules/@types/node/crypto.d.ts +18 -5
- package/node_modules/@types/node/diagnostics_channel.d.ts +254 -23
- package/node_modules/@types/node/dns.d.ts +1 -1
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +3 -0
- package/node_modules/@types/node/fs.d.ts +21 -6
- package/node_modules/@types/node/http.d.ts +25 -0
- package/node_modules/@types/node/index.d.ts +1 -0
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/process.d.ts +14 -1
- package/node_modules/@types/node/quic.d.ts +92 -11
- package/node_modules/@types/node/sqlite.d.ts +55 -0
- package/node_modules/@types/node/stream/iter.d.ts +150 -0
- package/node_modules/@types/node/stream.d.ts +32 -0
- package/node_modules/@types/node/test.d.ts +112 -2
- package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
- package/node_modules/@types/node/util.d.ts +19 -2
- package/node_modules/@types/node/v8.d.ts +84 -2
- package/node_modules/@types/node/worker_threads.d.ts +8 -7
- package/node_modules/brace-expansion/dist/commonjs/index.js +24 -14
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js +24 -14
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
- package/node_modules/brace-expansion/package.json +2 -2
- package/node_modules/google-auth-library/build/src/auth/googleauth.js +1 -1
- package/node_modules/google-auth-library/package.json +4 -4
- package/node_modules/protobufjs/dist/light/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/light/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.js +5 -2
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +1 -1
- package/node_modules/protobufjs/src/parse.js +3 -0
- package/package.json +7 -6
- package/slingshot/index.js +293 -295
- package/node_modules/@aws-crypto/crc32/CHANGELOG.md +0 -100
- package/node_modules/@aws-crypto/crc32/LICENSE +0 -201
- package/node_modules/@aws-crypto/crc32/README.md +0 -16
- package/node_modules/@aws-crypto/crc32/build/main/aws_crc32.d.ts +0 -7
- package/node_modules/@aws-crypto/crc32/build/main/aws_crc32.js +0 -31
- package/node_modules/@aws-crypto/crc32/build/main/aws_crc32.js.map +0 -1
- package/node_modules/@aws-crypto/crc32/build/main/index.d.ts +0 -7
- package/node_modules/@aws-crypto/crc32/build/main/index.js +0 -108
- package/node_modules/@aws-crypto/crc32/build/main/index.js.map +0 -1
- package/node_modules/@aws-crypto/crc32/build/module/aws_crc32.d.ts +0 -7
- package/node_modules/@aws-crypto/crc32/build/module/aws_crc32.js +0 -28
- package/node_modules/@aws-crypto/crc32/build/module/aws_crc32.js.map +0 -1
- package/node_modules/@aws-crypto/crc32/build/module/index.d.ts +0 -7
- package/node_modules/@aws-crypto/crc32/build/module/index.js +0 -103
- package/node_modules/@aws-crypto/crc32/build/module/index.js.map +0 -1
- package/node_modules/@aws-crypto/crc32/package.json +0 -32
- package/node_modules/@aws-crypto/crc32/src/aws_crc32.ts +0 -24
- package/node_modules/@aws-crypto/crc32/src/index.ts +0 -92
- package/node_modules/@aws-crypto/crc32/tsconfig.json +0 -9
- package/node_modules/@aws-crypto/crc32/tsconfig.module.json +0 -7
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +0 -869
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +0 -862
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +0 -42
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.browser.js +0 -27
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +0 -71
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +0 -49
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js +0 -13
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.browser.js +0 -2
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -7
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js +0 -29
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +0 -25
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -7
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +0 -57
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +0 -234
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.js +0 -44
- package/node_modules/@smithy/core/dist-es/submodules/checksum/md5-js/constants.js +0 -3
- package/node_modules/@smithy/core/dist-es/submodules/checksum/md5-js/md5.js +0 -168
- package/node_modules/@smithy/core/dist-types/submodules/checksum/md5-js/constants.d.ts +0 -12
- package/node_modules/@smithy/core/dist-types/submodules/checksum/md5-js/md5.d.ts +0 -16
- package/node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js +0 -53
- package/node_modules/@smithy/fetch-http-handler/dist-types/stream-collector.d.ts +0 -2
- /package/node_modules/@smithy/{core/dist-es/submodules/endpoints/middleware-endpoint/types.js → types/dist-es/endpoints/EndpointParameterInstructions.js} +0 -0
- /package/node_modules/@smithy/{core/dist-types/submodules/endpoints/middleware-endpoint/types.d.ts → types/dist-types/endpoints/EndpointParameterInstructions.d.ts} +0 -0
|
@@ -7,6 +7,7 @@ export const XAI_MODELS = {
|
|
|
7
7
|
api: "openai-completions",
|
|
8
8
|
provider: "xai",
|
|
9
9
|
baseUrl: "https://api.x.ai/v1",
|
|
10
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false },
|
|
10
11
|
reasoning: false,
|
|
11
12
|
input: ["text"],
|
|
12
13
|
cost: {
|
|
@@ -24,6 +25,7 @@ export const XAI_MODELS = {
|
|
|
24
25
|
api: "openai-completions",
|
|
25
26
|
provider: "xai",
|
|
26
27
|
baseUrl: "https://api.x.ai/v1",
|
|
28
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false },
|
|
27
29
|
reasoning: false,
|
|
28
30
|
input: ["text"],
|
|
29
31
|
cost: {
|
|
@@ -41,6 +43,7 @@ export const XAI_MODELS = {
|
|
|
41
43
|
api: "openai-completions",
|
|
42
44
|
provider: "xai",
|
|
43
45
|
baseUrl: "https://api.x.ai/v1",
|
|
46
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false },
|
|
44
47
|
reasoning: false,
|
|
45
48
|
input: ["text", "image"],
|
|
46
49
|
cost: {
|
|
@@ -58,6 +61,7 @@ export const XAI_MODELS = {
|
|
|
58
61
|
api: "openai-completions",
|
|
59
62
|
provider: "xai",
|
|
60
63
|
baseUrl: "https://api.x.ai/v1",
|
|
64
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false },
|
|
61
65
|
reasoning: true,
|
|
62
66
|
input: ["text", "image"],
|
|
63
67
|
cost: {
|
|
@@ -75,6 +79,7 @@ export const XAI_MODELS = {
|
|
|
75
79
|
api: "openai-completions",
|
|
76
80
|
provider: "xai",
|
|
77
81
|
baseUrl: "https://api.x.ai/v1",
|
|
82
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false },
|
|
78
83
|
reasoning: true,
|
|
79
84
|
input: ["text", "image"],
|
|
80
85
|
cost: {
|
|
@@ -92,6 +97,7 @@ export const XAI_MODELS = {
|
|
|
92
97
|
api: "openai-completions",
|
|
93
98
|
provider: "xai",
|
|
94
99
|
baseUrl: "https://api.x.ai/v1",
|
|
100
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false },
|
|
95
101
|
reasoning: true,
|
|
96
102
|
input: ["text", "image"],
|
|
97
103
|
cost: {
|
|
@@ -109,6 +115,7 @@ export const XAI_MODELS = {
|
|
|
109
115
|
api: "openai-completions",
|
|
110
116
|
provider: "xai",
|
|
111
117
|
baseUrl: "https://api.x.ai/v1",
|
|
118
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false },
|
|
112
119
|
reasoning: false,
|
|
113
120
|
input: ["text"],
|
|
114
121
|
cost: {
|
|
@@ -11,9 +11,9 @@ export const XIAOMI_TOKEN_PLAN_AMS_MODELS = {
|
|
|
11
11
|
reasoning: true,
|
|
12
12
|
input: ["text", "image"],
|
|
13
13
|
cost: {
|
|
14
|
-
input: 0.
|
|
15
|
-
output:
|
|
16
|
-
cacheRead: 0.
|
|
14
|
+
input: 0.14,
|
|
15
|
+
output: 0.28,
|
|
16
|
+
cacheRead: 0.0028,
|
|
17
17
|
cacheWrite: 0,
|
|
18
18
|
},
|
|
19
19
|
contextWindow: 262144,
|
|
@@ -29,9 +29,9 @@ export const XIAOMI_TOKEN_PLAN_AMS_MODELS = {
|
|
|
29
29
|
reasoning: true,
|
|
30
30
|
input: ["text"],
|
|
31
31
|
cost: {
|
|
32
|
-
input:
|
|
33
|
-
output:
|
|
34
|
-
cacheRead: 0.
|
|
32
|
+
input: 0.435,
|
|
33
|
+
output: 0.87,
|
|
34
|
+
cacheRead: 0.0036,
|
|
35
35
|
cacheWrite: 0,
|
|
36
36
|
},
|
|
37
37
|
contextWindow: 1048576,
|
|
@@ -47,9 +47,9 @@ export const XIAOMI_TOKEN_PLAN_AMS_MODELS = {
|
|
|
47
47
|
reasoning: true,
|
|
48
48
|
input: ["text", "image"],
|
|
49
49
|
cost: {
|
|
50
|
-
input: 0.
|
|
51
|
-
output:
|
|
52
|
-
cacheRead: 0.
|
|
50
|
+
input: 0.14,
|
|
51
|
+
output: 0.28,
|
|
52
|
+
cacheRead: 0.0028,
|
|
53
53
|
cacheWrite: 0,
|
|
54
54
|
},
|
|
55
55
|
contextWindow: 1048576,
|
|
@@ -65,9 +65,9 @@ export const XIAOMI_TOKEN_PLAN_AMS_MODELS = {
|
|
|
65
65
|
reasoning: true,
|
|
66
66
|
input: ["text"],
|
|
67
67
|
cost: {
|
|
68
|
-
input:
|
|
69
|
-
output:
|
|
70
|
-
cacheRead: 0.
|
|
68
|
+
input: 0.435,
|
|
69
|
+
output: 0.87,
|
|
70
|
+
cacheRead: 0.0036,
|
|
71
71
|
cacheWrite: 0,
|
|
72
72
|
},
|
|
73
73
|
contextWindow: 1048576,
|
|
@@ -11,9 +11,9 @@ export const XIAOMI_TOKEN_PLAN_CN_MODELS = {
|
|
|
11
11
|
reasoning: true,
|
|
12
12
|
input: ["text", "image"],
|
|
13
13
|
cost: {
|
|
14
|
-
input: 0.
|
|
15
|
-
output:
|
|
16
|
-
cacheRead: 0.
|
|
14
|
+
input: 0.14,
|
|
15
|
+
output: 0.28,
|
|
16
|
+
cacheRead: 0.0028,
|
|
17
17
|
cacheWrite: 0,
|
|
18
18
|
},
|
|
19
19
|
contextWindow: 262144,
|
|
@@ -29,9 +29,9 @@ export const XIAOMI_TOKEN_PLAN_CN_MODELS = {
|
|
|
29
29
|
reasoning: true,
|
|
30
30
|
input: ["text"],
|
|
31
31
|
cost: {
|
|
32
|
-
input:
|
|
33
|
-
output:
|
|
34
|
-
cacheRead: 0.
|
|
32
|
+
input: 0.435,
|
|
33
|
+
output: 0.87,
|
|
34
|
+
cacheRead: 0.0036,
|
|
35
35
|
cacheWrite: 0,
|
|
36
36
|
},
|
|
37
37
|
contextWindow: 1048576,
|
|
@@ -47,9 +47,9 @@ export const XIAOMI_TOKEN_PLAN_CN_MODELS = {
|
|
|
47
47
|
reasoning: true,
|
|
48
48
|
input: ["text", "image"],
|
|
49
49
|
cost: {
|
|
50
|
-
input: 0.
|
|
51
|
-
output:
|
|
52
|
-
cacheRead: 0.
|
|
50
|
+
input: 0.14,
|
|
51
|
+
output: 0.28,
|
|
52
|
+
cacheRead: 0.0028,
|
|
53
53
|
cacheWrite: 0,
|
|
54
54
|
},
|
|
55
55
|
contextWindow: 1048576,
|
|
@@ -65,9 +65,9 @@ export const XIAOMI_TOKEN_PLAN_CN_MODELS = {
|
|
|
65
65
|
reasoning: true,
|
|
66
66
|
input: ["text"],
|
|
67
67
|
cost: {
|
|
68
|
-
input:
|
|
69
|
-
output:
|
|
70
|
-
cacheRead: 0.
|
|
68
|
+
input: 0.435,
|
|
69
|
+
output: 0.87,
|
|
70
|
+
cacheRead: 0.0036,
|
|
71
71
|
cacheWrite: 0,
|
|
72
72
|
},
|
|
73
73
|
contextWindow: 1048576,
|
|
@@ -11,9 +11,9 @@ export const XIAOMI_TOKEN_PLAN_SGP_MODELS = {
|
|
|
11
11
|
reasoning: true,
|
|
12
12
|
input: ["text", "image"],
|
|
13
13
|
cost: {
|
|
14
|
-
input: 0.
|
|
15
|
-
output:
|
|
16
|
-
cacheRead: 0.
|
|
14
|
+
input: 0.14,
|
|
15
|
+
output: 0.28,
|
|
16
|
+
cacheRead: 0.0028,
|
|
17
17
|
cacheWrite: 0,
|
|
18
18
|
},
|
|
19
19
|
contextWindow: 262144,
|
|
@@ -29,9 +29,9 @@ export const XIAOMI_TOKEN_PLAN_SGP_MODELS = {
|
|
|
29
29
|
reasoning: true,
|
|
30
30
|
input: ["text"],
|
|
31
31
|
cost: {
|
|
32
|
-
input:
|
|
33
|
-
output:
|
|
34
|
-
cacheRead: 0.
|
|
32
|
+
input: 0.435,
|
|
33
|
+
output: 0.87,
|
|
34
|
+
cacheRead: 0.0036,
|
|
35
35
|
cacheWrite: 0,
|
|
36
36
|
},
|
|
37
37
|
contextWindow: 1048576,
|
|
@@ -47,9 +47,9 @@ export const XIAOMI_TOKEN_PLAN_SGP_MODELS = {
|
|
|
47
47
|
reasoning: true,
|
|
48
48
|
input: ["text", "image"],
|
|
49
49
|
cost: {
|
|
50
|
-
input: 0.
|
|
51
|
-
output:
|
|
52
|
-
cacheRead: 0.
|
|
50
|
+
input: 0.14,
|
|
51
|
+
output: 0.28,
|
|
52
|
+
cacheRead: 0.0028,
|
|
53
53
|
cacheWrite: 0,
|
|
54
54
|
},
|
|
55
55
|
contextWindow: 1048576,
|
|
@@ -65,9 +65,9 @@ export const XIAOMI_TOKEN_PLAN_SGP_MODELS = {
|
|
|
65
65
|
reasoning: true,
|
|
66
66
|
input: ["text"],
|
|
67
67
|
cost: {
|
|
68
|
-
input:
|
|
69
|
-
output:
|
|
70
|
-
cacheRead: 0.
|
|
68
|
+
input: 0.435,
|
|
69
|
+
output: 0.87,
|
|
70
|
+
cacheRead: 0.0036,
|
|
71
71
|
cacheWrite: 0,
|
|
72
72
|
},
|
|
73
73
|
contextWindow: 1048576,
|
|
@@ -11,9 +11,9 @@ export const XIAOMI_MODELS = {
|
|
|
11
11
|
reasoning: true,
|
|
12
12
|
input: ["text"],
|
|
13
13
|
cost: {
|
|
14
|
-
input: 0.
|
|
15
|
-
output: 0.
|
|
16
|
-
cacheRead: 0.
|
|
14
|
+
input: 0.14,
|
|
15
|
+
output: 0.28,
|
|
16
|
+
cacheRead: 0.0028,
|
|
17
17
|
cacheWrite: 0,
|
|
18
18
|
},
|
|
19
19
|
contextWindow: 262144,
|
|
@@ -29,9 +29,9 @@ export const XIAOMI_MODELS = {
|
|
|
29
29
|
reasoning: true,
|
|
30
30
|
input: ["text", "image"],
|
|
31
31
|
cost: {
|
|
32
|
-
input: 0.
|
|
33
|
-
output:
|
|
34
|
-
cacheRead: 0.
|
|
32
|
+
input: 0.14,
|
|
33
|
+
output: 0.28,
|
|
34
|
+
cacheRead: 0.0028,
|
|
35
35
|
cacheWrite: 0,
|
|
36
36
|
},
|
|
37
37
|
contextWindow: 262144,
|
|
@@ -47,9 +47,9 @@ export const XIAOMI_MODELS = {
|
|
|
47
47
|
reasoning: true,
|
|
48
48
|
input: ["text"],
|
|
49
49
|
cost: {
|
|
50
|
-
input:
|
|
51
|
-
output:
|
|
52
|
-
cacheRead: 0.
|
|
50
|
+
input: 0.435,
|
|
51
|
+
output: 0.87,
|
|
52
|
+
cacheRead: 0.0036,
|
|
53
53
|
cacheWrite: 0,
|
|
54
54
|
},
|
|
55
55
|
contextWindow: 1048576,
|
|
@@ -65,9 +65,9 @@ export const XIAOMI_MODELS = {
|
|
|
65
65
|
reasoning: true,
|
|
66
66
|
input: ["text", "image"],
|
|
67
67
|
cost: {
|
|
68
|
-
input: 0.
|
|
69
|
-
output:
|
|
70
|
-
cacheRead: 0.
|
|
68
|
+
input: 0.14,
|
|
69
|
+
output: 0.28,
|
|
70
|
+
cacheRead: 0.0028,
|
|
71
71
|
cacheWrite: 0,
|
|
72
72
|
},
|
|
73
73
|
contextWindow: 1048576,
|
|
@@ -83,9 +83,9 @@ export const XIAOMI_MODELS = {
|
|
|
83
83
|
reasoning: true,
|
|
84
84
|
input: ["text"],
|
|
85
85
|
cost: {
|
|
86
|
-
input:
|
|
87
|
-
output:
|
|
88
|
-
cacheRead: 0.
|
|
86
|
+
input: 0.435,
|
|
87
|
+
output: 0.87,
|
|
88
|
+
cacheRead: 0.0036,
|
|
89
89
|
cacheWrite: 0,
|
|
90
90
|
},
|
|
91
91
|
contextWindow: 1048576,
|
|
@@ -7,7 +7,7 @@ export const ZAI_CODING_CN_MODELS = {
|
|
|
7
7
|
api: "openai-completions",
|
|
8
8
|
provider: "zai-coding-cn",
|
|
9
9
|
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
|
|
10
|
-
compat: { "supportsDeveloperRole": false, "thinkingFormat": "zai" },
|
|
10
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false, "thinkingFormat": "zai" },
|
|
11
11
|
reasoning: true,
|
|
12
12
|
input: ["text"],
|
|
13
13
|
cost: {
|
|
@@ -25,7 +25,7 @@ export const ZAI_CODING_CN_MODELS = {
|
|
|
25
25
|
api: "openai-completions",
|
|
26
26
|
provider: "zai-coding-cn",
|
|
27
27
|
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
|
|
28
|
-
compat: { "supportsDeveloperRole": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
28
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
29
29
|
reasoning: true,
|
|
30
30
|
input: ["text"],
|
|
31
31
|
cost: {
|
|
@@ -43,7 +43,7 @@ export const ZAI_CODING_CN_MODELS = {
|
|
|
43
43
|
api: "openai-completions",
|
|
44
44
|
provider: "zai-coding-cn",
|
|
45
45
|
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
|
|
46
|
-
compat: { "supportsDeveloperRole": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
46
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
47
47
|
reasoning: true,
|
|
48
48
|
input: ["text"],
|
|
49
49
|
cost: {
|
|
@@ -61,7 +61,7 @@ export const ZAI_CODING_CN_MODELS = {
|
|
|
61
61
|
api: "openai-completions",
|
|
62
62
|
provider: "zai-coding-cn",
|
|
63
63
|
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
|
|
64
|
-
compat: { "supportsDeveloperRole": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
64
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
65
65
|
reasoning: true,
|
|
66
66
|
input: ["text"],
|
|
67
67
|
cost: {
|
|
@@ -79,7 +79,7 @@ export const ZAI_CODING_CN_MODELS = {
|
|
|
79
79
|
api: "openai-completions",
|
|
80
80
|
provider: "zai-coding-cn",
|
|
81
81
|
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
|
|
82
|
-
compat: { "
|
|
82
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": true, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
83
83
|
reasoning: true,
|
|
84
84
|
thinkingLevelMap: { "minimal": null, "low": "high", "medium": "high", "high": "high", "xhigh": "max" },
|
|
85
85
|
input: ["text"],
|
|
@@ -98,7 +98,7 @@ export const ZAI_CODING_CN_MODELS = {
|
|
|
98
98
|
api: "openai-completions",
|
|
99
99
|
provider: "zai-coding-cn",
|
|
100
100
|
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
|
|
101
|
-
compat: { "supportsDeveloperRole": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
101
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
102
102
|
reasoning: true,
|
|
103
103
|
input: ["text", "image"],
|
|
104
104
|
cost: {
|
|
@@ -7,7 +7,7 @@ export const ZAI_MODELS = {
|
|
|
7
7
|
api: "openai-completions",
|
|
8
8
|
provider: "zai",
|
|
9
9
|
baseUrl: "https://api.z.ai/api/coding/paas/v4",
|
|
10
|
-
compat: { "supportsDeveloperRole": false, "thinkingFormat": "zai" },
|
|
10
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false, "thinkingFormat": "zai" },
|
|
11
11
|
reasoning: true,
|
|
12
12
|
input: ["text"],
|
|
13
13
|
cost: {
|
|
@@ -25,7 +25,7 @@ export const ZAI_MODELS = {
|
|
|
25
25
|
api: "openai-completions",
|
|
26
26
|
provider: "zai",
|
|
27
27
|
baseUrl: "https://api.z.ai/api/coding/paas/v4",
|
|
28
|
-
compat: { "supportsDeveloperRole": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
28
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
29
29
|
reasoning: true,
|
|
30
30
|
input: ["text"],
|
|
31
31
|
cost: {
|
|
@@ -43,7 +43,7 @@ export const ZAI_MODELS = {
|
|
|
43
43
|
api: "openai-completions",
|
|
44
44
|
provider: "zai",
|
|
45
45
|
baseUrl: "https://api.z.ai/api/coding/paas/v4",
|
|
46
|
-
compat: { "supportsDeveloperRole": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
46
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
47
47
|
reasoning: true,
|
|
48
48
|
input: ["text"],
|
|
49
49
|
cost: {
|
|
@@ -61,7 +61,7 @@ export const ZAI_MODELS = {
|
|
|
61
61
|
api: "openai-completions",
|
|
62
62
|
provider: "zai",
|
|
63
63
|
baseUrl: "https://api.z.ai/api/coding/paas/v4",
|
|
64
|
-
compat: { "supportsDeveloperRole": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
64
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
65
65
|
reasoning: true,
|
|
66
66
|
input: ["text"],
|
|
67
67
|
cost: {
|
|
@@ -79,7 +79,7 @@ export const ZAI_MODELS = {
|
|
|
79
79
|
api: "openai-completions",
|
|
80
80
|
provider: "zai",
|
|
81
81
|
baseUrl: "https://api.z.ai/api/coding/paas/v4",
|
|
82
|
-
compat: { "
|
|
82
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": true, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
83
83
|
reasoning: true,
|
|
84
84
|
thinkingLevelMap: { "minimal": null, "low": "high", "medium": "high", "high": "high", "xhigh": "max" },
|
|
85
85
|
input: ["text"],
|
|
@@ -98,7 +98,7 @@ export const ZAI_MODELS = {
|
|
|
98
98
|
api: "openai-completions",
|
|
99
99
|
provider: "zai",
|
|
100
100
|
baseUrl: "https://api.z.ai/api/coding/paas/v4",
|
|
101
|
-
compat: { "supportsDeveloperRole": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
101
|
+
compat: { "supportsStore": false, "supportsDeveloperRole": false, "supportsReasoningEffort": false, "thinkingFormat": "zai", "zaiToolStream": true },
|
|
102
102
|
reasoning: true,
|
|
103
103
|
input: ["text", "image"],
|
|
104
104
|
cost: {
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Shared normalization for provider HTTP error objects.
|
|
2
|
+
//
|
|
3
|
+
// Endpoints behind a proxy / gateway may return a non-2xx response whose body
|
|
4
|
+
// the provider SDK cannot fold into `error.message`. The SDK error object still
|
|
5
|
+
// carries the HTTP status and the raw/parsed body, but under SDK-specific field
|
|
6
|
+
// names. Provider catch blocks that read only `error.message` therefore drop
|
|
7
|
+
// the body and surface opaque messages like `"403 status code (no body)"` or
|
|
8
|
+
// collapse to `"Unknown: UnknownError"`.
|
|
9
|
+
//
|
|
10
|
+
// `normalizeProviderError` probes the known SDK field shapes (Mistral,
|
|
11
|
+
// `openai`, `@google/genai`, AWS Bedrock) and returns a struct each provider
|
|
12
|
+
// composes into its display string. The `messageCarriesBody` flag captures the
|
|
13
|
+
// Anthropic / `@google/genai` happy path where the SDK already folded the body
|
|
14
|
+
// into the message, so providers can preserve it without double-printing.
|
|
15
|
+
export const MAX_PROVIDER_ERROR_BODY_CHARS = 4000;
|
|
16
|
+
export function normalizeProviderError(error) {
|
|
17
|
+
if (!(error instanceof Error)) {
|
|
18
|
+
return { message: safeJsonStringify(error), messageCarriesBody: false };
|
|
19
|
+
}
|
|
20
|
+
const sdkError = error;
|
|
21
|
+
const status = extractStatus(sdkError);
|
|
22
|
+
const body = extractBody(sdkError);
|
|
23
|
+
const messageCarriesBody = body === undefined || error.message.includes(body);
|
|
24
|
+
return {
|
|
25
|
+
status,
|
|
26
|
+
body,
|
|
27
|
+
message: error.message,
|
|
28
|
+
messageCarriesBody,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Probe the HTTP status, first numeric hit wins, in SDK-field order:
|
|
33
|
+
* `statusCode` (Mistral) → `status` (`openai`, `@google/genai`) →
|
|
34
|
+
* `$metadata.httpStatusCode` (Bedrock) → `$response.statusCode` (Bedrock).
|
|
35
|
+
*/
|
|
36
|
+
function extractStatus(error) {
|
|
37
|
+
if (typeof error.statusCode === "number")
|
|
38
|
+
return error.statusCode;
|
|
39
|
+
if (typeof error.status === "number")
|
|
40
|
+
return error.status;
|
|
41
|
+
if (typeof error.$metadata?.httpStatusCode === "number")
|
|
42
|
+
return error.$metadata.httpStatusCode;
|
|
43
|
+
if (typeof error.$response?.statusCode === "number")
|
|
44
|
+
return error.$response.statusCode;
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Probe the raw body reason, first usable hit wins, in SDK-field order:
|
|
49
|
+
* `body` string (Mistral) → `error` parsed JSON body object (`openai` SDK's
|
|
50
|
+
* `this.error`) → `$response.body` (Bedrock). Empty objects are treated as no
|
|
51
|
+
* body so an empty parsed body does not surface as `"{}"`. The chosen body is
|
|
52
|
+
* truncated to the cap.
|
|
53
|
+
*/
|
|
54
|
+
function extractBody(error) {
|
|
55
|
+
const bodyText = pickBodyText(error);
|
|
56
|
+
if (bodyText === undefined)
|
|
57
|
+
return undefined;
|
|
58
|
+
const trimmed = bodyText.trim();
|
|
59
|
+
if (trimmed.length === 0)
|
|
60
|
+
return undefined;
|
|
61
|
+
return truncateErrorText(trimmed, MAX_PROVIDER_ERROR_BODY_CHARS);
|
|
62
|
+
}
|
|
63
|
+
function pickBodyText(error) {
|
|
64
|
+
if (typeof error.body === "string")
|
|
65
|
+
return error.body;
|
|
66
|
+
if (isNonEmptyObject(error.error))
|
|
67
|
+
return safeJsonStringify(error.error);
|
|
68
|
+
const responseBody = error.$response?.body;
|
|
69
|
+
if (typeof responseBody === "string")
|
|
70
|
+
return responseBody;
|
|
71
|
+
if (isNonEmptyObject(responseBody))
|
|
72
|
+
return safeJsonStringify(responseBody);
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
function isNonEmptyObject(value) {
|
|
76
|
+
return typeof value === "object" && value !== null && Object.keys(value).length > 0;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Compose a display string from a normalized error. When the message already
|
|
80
|
+
* carries the body (Anthropic / `@google/genai` happy path) or no body/status
|
|
81
|
+
* was extracted, the message is returned unchanged. Otherwise the status and
|
|
82
|
+
* body are surfaced, with an optional provider prefix.
|
|
83
|
+
*
|
|
84
|
+
* - no prefix: `"<status>: <body>"`
|
|
85
|
+
* - prefix: `"<prefix> (<status>): <body>"`
|
|
86
|
+
*/
|
|
87
|
+
export function formatProviderError(norm, prefix) {
|
|
88
|
+
if (norm.messageCarriesBody || norm.status === undefined || norm.body === undefined) {
|
|
89
|
+
return prefix !== undefined && norm.status !== undefined
|
|
90
|
+
? `${prefix} (${norm.status}): ${norm.message}`
|
|
91
|
+
: norm.message;
|
|
92
|
+
}
|
|
93
|
+
return prefix !== undefined ? `${prefix} (${norm.status}): ${norm.body}` : `${norm.status}: ${norm.body}`;
|
|
94
|
+
}
|
|
95
|
+
export function truncateErrorText(text, maxChars) {
|
|
96
|
+
if (text.length <= maxChars)
|
|
97
|
+
return text;
|
|
98
|
+
return `${text.slice(0, maxChars)}... [truncated ${text.length - maxChars} chars]`;
|
|
99
|
+
}
|
|
100
|
+
export function safeJsonStringify(value) {
|
|
101
|
+
try {
|
|
102
|
+
const serialized = JSON.stringify(value);
|
|
103
|
+
return serialized === undefined ? String(value) : serialized;
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return String(value);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=error-body.js.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const CHARS_PER_TOKEN = 4;
|
|
2
|
+
const ESTIMATED_IMAGE_CHARS = 4800;
|
|
3
|
+
export function calculateContextTokens(usage) {
|
|
4
|
+
return usage.totalTokens || usage.input + usage.output + usage.cacheRead + usage.cacheWrite;
|
|
5
|
+
}
|
|
6
|
+
function safeJsonStringify(value) {
|
|
7
|
+
try {
|
|
8
|
+
return JSON.stringify(value) ?? "undefined";
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return "[unserializable]";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function estimateTextAndImageContentChars(content) {
|
|
15
|
+
if (typeof content === "string")
|
|
16
|
+
return content.length;
|
|
17
|
+
let chars = 0;
|
|
18
|
+
for (const block of content)
|
|
19
|
+
chars += block.type === "text" ? block.text.length : ESTIMATED_IMAGE_CHARS;
|
|
20
|
+
return chars;
|
|
21
|
+
}
|
|
22
|
+
export function estimateTextTokens(text) {
|
|
23
|
+
return Math.ceil(text.length / CHARS_PER_TOKEN);
|
|
24
|
+
}
|
|
25
|
+
export function estimateTextAndImageContentTokens(content) {
|
|
26
|
+
return Math.ceil(estimateTextAndImageContentChars(content) / CHARS_PER_TOKEN);
|
|
27
|
+
}
|
|
28
|
+
export function estimateMessageTokens(message) {
|
|
29
|
+
let chars = 0;
|
|
30
|
+
if (message.role === "user")
|
|
31
|
+
return estimateTextAndImageContentTokens(message.content);
|
|
32
|
+
if (message.role === "toolResult")
|
|
33
|
+
return estimateTextAndImageContentTokens(message.content);
|
|
34
|
+
for (const block of message.content) {
|
|
35
|
+
if (block.type === "text") {
|
|
36
|
+
chars += block.text.length;
|
|
37
|
+
}
|
|
38
|
+
else if (block.type === "thinking") {
|
|
39
|
+
chars += block.thinking.length;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
chars += block.name.length + safeJsonStringify(block.arguments).length;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return Math.ceil(chars / CHARS_PER_TOKEN);
|
|
46
|
+
}
|
|
47
|
+
function getLastAssistantUsageInfo(messages) {
|
|
48
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
49
|
+
const message = messages[i];
|
|
50
|
+
if (message.role !== "assistant")
|
|
51
|
+
continue;
|
|
52
|
+
const assistant = message;
|
|
53
|
+
if (assistant.stopReason === "aborted" || assistant.stopReason === "error")
|
|
54
|
+
continue;
|
|
55
|
+
if (calculateContextTokens(assistant.usage) > 0)
|
|
56
|
+
return { usage: assistant.usage, index: i };
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
function estimateMessages(messages) {
|
|
61
|
+
const usageInfo = getLastAssistantUsageInfo(messages);
|
|
62
|
+
if (usageInfo) {
|
|
63
|
+
const usageTokens = calculateContextTokens(usageInfo.usage);
|
|
64
|
+
let trailingTokens = 0;
|
|
65
|
+
for (let i = usageInfo.index + 1; i < messages.length; i++) {
|
|
66
|
+
trailingTokens += estimateMessageTokens(messages[i]);
|
|
67
|
+
}
|
|
68
|
+
return { tokens: usageTokens + trailingTokens, usageTokens, trailingTokens, lastUsageIndex: usageInfo.index };
|
|
69
|
+
}
|
|
70
|
+
let tokens = 0;
|
|
71
|
+
for (const message of messages)
|
|
72
|
+
tokens += estimateMessageTokens(message);
|
|
73
|
+
return { tokens, usageTokens: 0, trailingTokens: tokens, lastUsageIndex: null };
|
|
74
|
+
}
|
|
75
|
+
function isMessageArray(value) {
|
|
76
|
+
return Array.isArray(value);
|
|
77
|
+
}
|
|
78
|
+
export function estimateContextTokens(context) {
|
|
79
|
+
if (isMessageArray(context))
|
|
80
|
+
return estimateMessages(context);
|
|
81
|
+
const estimate = estimateMessages(context.messages);
|
|
82
|
+
if (estimate.lastUsageIndex !== null)
|
|
83
|
+
return estimate;
|
|
84
|
+
let prefixTokens = context.systemPrompt ? estimateTextTokens(context.systemPrompt) : 0;
|
|
85
|
+
if (context.tools && context.tools.length > 0) {
|
|
86
|
+
prefixTokens += estimateTextTokens(safeJsonStringify(context.tools));
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
tokens: estimate.tokens + prefixTokens,
|
|
90
|
+
usageTokens: estimate.usageTokens,
|
|
91
|
+
trailingTokens: estimate.trailingTokens + prefixTokens,
|
|
92
|
+
lastUsageIndex: estimate.lastUsageIndex,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=estimate.js.map
|
|
@@ -5,4 +5,14 @@ export function headersToRecord(headers) {
|
|
|
5
5
|
}
|
|
6
6
|
return result;
|
|
7
7
|
}
|
|
8
|
+
export function providerHeadersToRecord(headers) {
|
|
9
|
+
if (!headers)
|
|
10
|
+
return undefined;
|
|
11
|
+
const result = {};
|
|
12
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
13
|
+
if (value !== null)
|
|
14
|
+
result[key] = value;
|
|
15
|
+
}
|
|
16
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
17
|
+
}
|
|
8
18
|
//# sourceMappingURL=headers.js.map
|
|
@@ -29,6 +29,12 @@ export async function pollOAuthDeviceCodeFlow(options) {
|
|
|
29
29
|
: Number.POSITIVE_INFINITY;
|
|
30
30
|
let intervalMs = Math.max(MINIMUM_INTERVAL_MS, Math.floor((options.intervalSeconds ?? DEFAULT_POLL_INTERVAL_SECONDS) * 1000));
|
|
31
31
|
let slowDownResponses = 0;
|
|
32
|
+
if (options.waitBeforeFirstPoll) {
|
|
33
|
+
const remainingMs = deadline - Date.now();
|
|
34
|
+
if (remainingMs > 0) {
|
|
35
|
+
await abortableSleep(Math.min(intervalMs, remainingMs), options.signal, CANCEL_MESSAGE);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
32
38
|
while (Date.now() < deadline) {
|
|
33
39
|
if (options.signal?.aborted) {
|
|
34
40
|
throw new Error(CANCEL_MESSAGE);
|
|
@@ -42,8 +48,15 @@ export async function pollOAuthDeviceCodeFlow(options) {
|
|
|
42
48
|
}
|
|
43
49
|
if (result.status === "slow_down") {
|
|
44
50
|
slowDownResponses += 1;
|
|
45
|
-
//
|
|
46
|
-
|
|
51
|
+
// Use the server-provided interval when given (GitHub reports the new required minimum
|
|
52
|
+
// in `interval`); trusting only a client-tracked value risks polling early forever under
|
|
53
|
+
// WSL/VM clock drift. Otherwise apply RFC 8628 section 3.5: increase by 5 seconds.
|
|
54
|
+
intervalMs =
|
|
55
|
+
typeof result.intervalSeconds === "number" &&
|
|
56
|
+
Number.isFinite(result.intervalSeconds) &&
|
|
57
|
+
result.intervalSeconds > 0
|
|
58
|
+
? Math.max(MINIMUM_INTERVAL_MS, Math.floor(result.intervalSeconds * 1000))
|
|
59
|
+
: Math.max(MINIMUM_INTERVAL_MS, intervalMs + SLOW_DOWN_INTERVAL_INCREMENT_MS);
|
|
47
60
|
}
|
|
48
61
|
const remainingMs = deadline - Date.now();
|
|
49
62
|
if (remainingMs <= 0) {
|
|
@@ -156,6 +156,7 @@ async function pollForGitHubAccessToken(domain, device, signal) {
|
|
|
156
156
|
return pollOAuthDeviceCodeFlow({
|
|
157
157
|
intervalSeconds: device.interval,
|
|
158
158
|
expiresInSeconds: device.expires_in,
|
|
159
|
+
waitBeforeFirstPoll: true,
|
|
159
160
|
signal,
|
|
160
161
|
poll: async () => {
|
|
161
162
|
const raw = await fetchJson(urls.accessTokenUrl, {
|
|
@@ -175,12 +176,12 @@ async function pollForGitHubAccessToken(domain, device, signal) {
|
|
|
175
176
|
return { status: "complete", value: raw.access_token };
|
|
176
177
|
}
|
|
177
178
|
if (raw && typeof raw === "object" && typeof raw.error === "string") {
|
|
178
|
-
const { error, error_description: description } = raw;
|
|
179
|
+
const { error, error_description: description, interval } = raw;
|
|
179
180
|
if (error === "authorization_pending") {
|
|
180
181
|
return { status: "pending" };
|
|
181
182
|
}
|
|
182
183
|
if (error === "slow_down") {
|
|
183
|
-
return { status: "slow_down" };
|
|
184
|
+
return { status: "slow_down", intervalSeconds: typeof interval === "number" ? interval : undefined };
|
|
184
185
|
}
|
|
185
186
|
const descriptionSuffix = description ? `: ${description}` : "";
|
|
186
187
|
return { status: "failed", message: `Device flow failed: ${error}${descriptionSuffix}` };
|