@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EventEmitter } from "node:events";
|
|
1
2
|
import * as undici from "undici";
|
|
2
3
|
export const DEFAULT_HTTP_IDLE_TIMEOUT_MS = 300_000;
|
|
3
4
|
export const HTTP_IDLE_TIMEOUT_CHOICES = [
|
|
@@ -39,16 +40,42 @@ export function applyHttpProxySettings(httpProxy) {
|
|
|
39
40
|
process.env.HTTP_PROXY ??= proxy;
|
|
40
41
|
process.env.HTTPS_PROXY ??= proxy;
|
|
41
42
|
}
|
|
43
|
+
const ignoreUndiciDispatcherError = (_error) => { };
|
|
44
|
+
// Undici can emit an internal Client "error" while terminating a mid-stream
|
|
45
|
+
// fetch body. The body stream still rejects through reader.read(); this listener
|
|
46
|
+
// only prevents EventEmitter's unhandled "error" special case from crashing pi.
|
|
47
|
+
function withUndiciErrorListener(dispatcher) {
|
|
48
|
+
if (dispatcher instanceof EventEmitter) {
|
|
49
|
+
EventEmitter.prototype.on.call(dispatcher, "error", ignoreUndiciDispatcherError);
|
|
50
|
+
}
|
|
51
|
+
return dispatcher;
|
|
52
|
+
}
|
|
53
|
+
function createUndiciClient(origin, options) {
|
|
54
|
+
return withUndiciErrorListener(new undici.Client(origin, options));
|
|
55
|
+
}
|
|
56
|
+
function createUndiciOriginDispatcher(origin, options) {
|
|
57
|
+
const dispatcherOptions = options;
|
|
58
|
+
if (dispatcherOptions.connections === 1) {
|
|
59
|
+
return createUndiciClient(origin, dispatcherOptions);
|
|
60
|
+
}
|
|
61
|
+
return withUndiciErrorListener(new undici.Pool(origin, {
|
|
62
|
+
...dispatcherOptions,
|
|
63
|
+
factory: createUndiciClient,
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
42
66
|
export function configureHttpDispatcher(timeoutMs = DEFAULT_HTTP_IDLE_TIMEOUT_MS) {
|
|
43
67
|
const normalizedTimeoutMs = parseHttpIdleTimeoutMs(timeoutMs);
|
|
44
68
|
if (normalizedTimeoutMs === undefined) {
|
|
45
69
|
throw new Error(`Invalid HTTP idle timeout: ${String(timeoutMs)}`);
|
|
46
70
|
}
|
|
47
|
-
|
|
71
|
+
const dispatcher = withUndiciErrorListener(new undici.EnvHttpProxyAgent({
|
|
48
72
|
allowH2: false,
|
|
49
73
|
bodyTimeout: normalizedTimeoutMs,
|
|
50
74
|
headersTimeout: normalizedTimeoutMs,
|
|
75
|
+
clientFactory: createUndiciClient,
|
|
76
|
+
factory: createUndiciOriginDispatcher,
|
|
51
77
|
}));
|
|
78
|
+
undici.setGlobalDispatcher(dispatcher);
|
|
52
79
|
// Keep fetch and the dispatcher on the same undici implementation. Node 26.0's
|
|
53
80
|
// bundled fetch can otherwise consume compressed responses through npm undici's
|
|
54
81
|
// dispatcher without decompressing them, causing response.json() failures.
|
|
@@ -402,13 +402,11 @@ export class ModelRegistry {
|
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
else if (!isBuiltIn) {
|
|
405
|
-
// Non-built-in providers with custom models require endpoint
|
|
405
|
+
// Non-built-in providers with custom models require an endpoint.
|
|
406
|
+
// Auth can come from auth.json, --api-key, or provider request config.
|
|
406
407
|
if (!providerConfig.baseUrl) {
|
|
407
408
|
throw new Error(`Provider ${providerName}: "baseUrl" is required when defining custom models.`);
|
|
408
409
|
}
|
|
409
|
-
if (!providerConfig.apiKey) {
|
|
410
|
-
throw new Error(`Provider ${providerName}: "apiKey" is required when defining custom models.`);
|
|
411
|
-
}
|
|
412
410
|
}
|
|
413
411
|
// Built-in providers with custom models: baseUrl/apiKey/api are optional,
|
|
414
412
|
// inherited from built-in models. Auth comes from env vars / auth storage.
|
|
@@ -11,7 +11,7 @@ export const defaultModelPerProvider = {
|
|
|
11
11
|
"amazon-bedrock": "us.anthropic.claude-opus-4-6-v1",
|
|
12
12
|
"ant-ling": "Ring-2.6-1T",
|
|
13
13
|
anthropic: "claude-opus-4-8",
|
|
14
|
-
openai: "gpt-5.
|
|
14
|
+
openai: "gpt-5.5",
|
|
15
15
|
"azure-openai-responses": "gpt-5.4",
|
|
16
16
|
"openai-codex": "gpt-5.5",
|
|
17
17
|
nvidia: "nvidia/nemotron-3-super-120b-a12b",
|
|
@@ -195,20 +195,10 @@ export function parseModelPattern(pattern, availableModels, options) {
|
|
|
195
195
|
return result;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
|
|
199
|
-
* Resolve model patterns to actual Model objects with optional thinking levels
|
|
200
|
-
* Format: "pattern:level" where :level is optional
|
|
201
|
-
* For each pattern, finds all matching models and picks the best version:
|
|
202
|
-
* 1. Prefer alias (e.g., claude-sonnet-4-5) over dated versions (claude-sonnet-4-5-20250929)
|
|
203
|
-
* 2. If no alias, pick the latest dated version
|
|
204
|
-
*
|
|
205
|
-
* Supports models with colons in their IDs (e.g., OpenRouter's model:exacto).
|
|
206
|
-
* The algorithm tries to match the full pattern first, then progressively
|
|
207
|
-
* strips colon-suffixes to find a match.
|
|
208
|
-
*/
|
|
209
|
-
export async function resolveModelScope(patterns, modelRegistry) {
|
|
198
|
+
export async function resolveModelScopeWithDiagnostics(patterns, modelRegistry) {
|
|
210
199
|
const availableModels = await modelRegistry.getAvailable();
|
|
211
200
|
const scopedModels = [];
|
|
201
|
+
const diagnostics = [];
|
|
212
202
|
for (const pattern of patterns) {
|
|
213
203
|
// Check if pattern contains glob characters
|
|
214
204
|
if (pattern.includes("*") || pattern.includes("?") || pattern.includes("[")) {
|
|
@@ -230,7 +220,7 @@ export async function resolveModelScope(patterns, modelRegistry) {
|
|
|
230
220
|
return minimatch(fullId, globPattern, { nocase: true }) || minimatch(m.id, globPattern, { nocase: true });
|
|
231
221
|
});
|
|
232
222
|
if (matchingModels.length === 0) {
|
|
233
|
-
|
|
223
|
+
diagnostics.push({ type: "warning", message: `No models match pattern "${pattern}"`, pattern });
|
|
234
224
|
continue;
|
|
235
225
|
}
|
|
236
226
|
for (const model of matchingModels) {
|
|
@@ -242,10 +232,10 @@ export async function resolveModelScope(patterns, modelRegistry) {
|
|
|
242
232
|
}
|
|
243
233
|
const { model, thinkingLevel, warning } = parseModelPattern(pattern, availableModels);
|
|
244
234
|
if (warning) {
|
|
245
|
-
|
|
235
|
+
diagnostics.push({ type: "warning", message: warning, pattern });
|
|
246
236
|
}
|
|
247
237
|
if (!model) {
|
|
248
|
-
|
|
238
|
+
diagnostics.push({ type: "warning", message: `No models match pattern "${pattern}"`, pattern });
|
|
249
239
|
continue;
|
|
250
240
|
}
|
|
251
241
|
// Avoid duplicates
|
|
@@ -253,6 +243,13 @@ export async function resolveModelScope(patterns, modelRegistry) {
|
|
|
253
243
|
scopedModels.push({ model, thinkingLevel });
|
|
254
244
|
}
|
|
255
245
|
}
|
|
246
|
+
return { scopedModels, diagnostics };
|
|
247
|
+
}
|
|
248
|
+
export async function resolveModelScope(patterns, modelRegistry) {
|
|
249
|
+
const { scopedModels, diagnostics } = await resolveModelScopeWithDiagnostics(patterns, modelRegistry);
|
|
250
|
+
for (const diagnostic of diagnostics) {
|
|
251
|
+
console.warn(chalk.yellow(`Warning: ${diagnostic.message}`));
|
|
252
|
+
}
|
|
256
253
|
return scopedModels;
|
|
257
254
|
}
|
|
258
255
|
/**
|
|
@@ -447,10 +444,10 @@ export async function findInitialModel(options) {
|
|
|
447
444
|
fallbackMessage: undefined,
|
|
448
445
|
};
|
|
449
446
|
}
|
|
450
|
-
// 3. Try saved default from settings
|
|
447
|
+
// 3. Try saved default from settings if auth is configured.
|
|
451
448
|
if (defaultProvider && defaultModelId) {
|
|
452
449
|
const found = modelRegistry.find(defaultProvider, defaultModelId);
|
|
453
|
-
if (found) {
|
|
450
|
+
if (found && modelRegistry.hasConfiguredAuth(found)) {
|
|
454
451
|
model = found;
|
|
455
452
|
if (defaultThinkingLevel) {
|
|
456
453
|
thinkingLevel = defaultThinkingLevel;
|
|
@@ -2,7 +2,7 @@ import { CONFIG_DIR_NAME } from "../config.js";
|
|
|
2
2
|
import { emitProjectTrustEvent } from "./extensions/runner.js";
|
|
3
3
|
import { getProjectTrustOptions, hasTrustRequiringProjectResources, } from "./trust-manager.js";
|
|
4
4
|
function formatProjectTrustPrompt(cwd) {
|
|
5
|
-
return `Trust project folder?\n${cwd}\n\nThis allows
|
|
5
|
+
return `Trust project folder?\n${cwd}\n\nThis allows pi to load ${CONFIG_DIR_NAME} settings and resources, install missing project packages, and execute project extensions.`;
|
|
6
6
|
}
|
|
7
7
|
async function selectProjectTrustOption(cwd, ctx) {
|
|
8
8
|
const options = getProjectTrustOptions(cwd, { includeSessionOnly: true });
|
|
@@ -4,7 +4,6 @@ const NVIDIA_NIM_HOST = "integrate.api.nvidia.com";
|
|
|
4
4
|
const CLOUDFLARE_API_HOST = "api.cloudflare.com";
|
|
5
5
|
const CLOUDFLARE_AI_GATEWAY_HOST = "gateway.ai.cloudflare.com";
|
|
6
6
|
const OPENCODE_HOST = "opencode.ai";
|
|
7
|
-
const VERCEL_GATEWAY_HOST = "ai-gateway.vercel.sh";
|
|
8
7
|
function matchesHost(baseUrl, expectedHost) {
|
|
9
8
|
try {
|
|
10
9
|
return new URL(baseUrl).hostname === expectedHost;
|
|
@@ -25,9 +24,6 @@ function isCloudflareModel(model) {
|
|
|
25
24
|
matchesHost(model.baseUrl, CLOUDFLARE_API_HOST) ||
|
|
26
25
|
matchesHost(model.baseUrl, CLOUDFLARE_AI_GATEWAY_HOST));
|
|
27
26
|
}
|
|
28
|
-
function isVercelGatewayModel(model) {
|
|
29
|
-
return model.provider === "vercel-ai-gateway" || matchesHost(model.baseUrl, VERCEL_GATEWAY_HOST);
|
|
30
|
-
}
|
|
31
27
|
function getDefaultAttributionHeaders(model, settingsManager) {
|
|
32
28
|
if (!isInstallTelemetryEnabled(settingsManager)) {
|
|
33
29
|
return undefined;
|
|
@@ -49,12 +45,6 @@ function getDefaultAttributionHeaders(model, settingsManager) {
|
|
|
49
45
|
"User-Agent": "pi-coding-agent",
|
|
50
46
|
};
|
|
51
47
|
}
|
|
52
|
-
if (isVercelGatewayModel(model)) {
|
|
53
|
-
return {
|
|
54
|
-
"http-referer": "https://pi.dev",
|
|
55
|
-
"x-title": "pi",
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
48
|
return undefined;
|
|
59
49
|
}
|
|
60
50
|
function getSessionHeaders(model, sessionId) {
|
|
@@ -11,6 +11,7 @@ import { loadPromptTemplates } from "./prompt-templates.js";
|
|
|
11
11
|
import { SettingsManager } from "./settings-manager.js";
|
|
12
12
|
import { loadSkills } from "./skills.js";
|
|
13
13
|
import { createSourceInfo } from "./source-info.js";
|
|
14
|
+
import { resetTimings } from "./timings.js";
|
|
14
15
|
function resolvePromptInput(input, description) {
|
|
15
16
|
if (!input) {
|
|
16
17
|
return undefined;
|
|
@@ -216,6 +217,7 @@ export class DefaultResourceLoader {
|
|
|
216
217
|
return this.loadCurrentExtensionSet({ includeInlineFactories: true });
|
|
217
218
|
}
|
|
218
219
|
async reload(options) {
|
|
220
|
+
resetTimings("extensions");
|
|
219
221
|
if (this.loaded) {
|
|
220
222
|
clearExtensionCache();
|
|
221
223
|
}
|
|
@@ -112,47 +112,40 @@ export function getLatestCompactionEntry(entries) {
|
|
|
112
112
|
}
|
|
113
113
|
return null;
|
|
114
114
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
// Build uuid index if not available
|
|
122
|
-
if (!byId) {
|
|
123
|
-
byId = new Map();
|
|
124
|
-
for (const entry of entries) {
|
|
125
|
-
byId.set(entry.id, entry);
|
|
126
|
-
}
|
|
115
|
+
function buildEntryIndex(entries, byId) {
|
|
116
|
+
if (byId)
|
|
117
|
+
return byId;
|
|
118
|
+
const index = new Map();
|
|
119
|
+
for (const entry of entries) {
|
|
120
|
+
index.set(entry.id, entry);
|
|
127
121
|
}
|
|
128
|
-
|
|
122
|
+
return index;
|
|
123
|
+
}
|
|
124
|
+
function buildSessionPath(entries, leafId, byId) {
|
|
125
|
+
const index = buildEntryIndex(entries, byId);
|
|
129
126
|
let leaf;
|
|
130
127
|
if (leafId === null) {
|
|
131
|
-
|
|
132
|
-
return { messages: [], thinkingLevel: "off", model: null };
|
|
128
|
+
return [];
|
|
133
129
|
}
|
|
134
130
|
if (leafId) {
|
|
135
|
-
leaf =
|
|
131
|
+
leaf = index.get(leafId);
|
|
136
132
|
}
|
|
133
|
+
leaf ??= entries[entries.length - 1];
|
|
137
134
|
if (!leaf) {
|
|
138
|
-
|
|
139
|
-
leaf = entries[entries.length - 1];
|
|
140
|
-
}
|
|
141
|
-
if (!leaf) {
|
|
142
|
-
return { messages: [], thinkingLevel: "off", model: null };
|
|
135
|
+
return [];
|
|
143
136
|
}
|
|
144
|
-
// Walk from leaf to root, collecting path
|
|
145
137
|
const path = [];
|
|
146
138
|
let current = leaf;
|
|
147
139
|
while (current) {
|
|
148
140
|
path.push(current);
|
|
149
|
-
current = current.parentId ?
|
|
141
|
+
current = current.parentId ? index.get(current.parentId) : undefined;
|
|
150
142
|
}
|
|
151
143
|
path.reverse();
|
|
152
|
-
|
|
144
|
+
return path;
|
|
145
|
+
}
|
|
146
|
+
function getSessionContextSettings(path) {
|
|
153
147
|
let thinkingLevel = "off";
|
|
154
148
|
let model = null;
|
|
155
|
-
let compaction = null;
|
|
156
149
|
for (const entry of path) {
|
|
157
150
|
if (entry.type === "thinking_level_change") {
|
|
158
151
|
thinkingLevel = entry.thinkingLevel;
|
|
@@ -163,55 +156,74 @@ export function buildSessionContext(entries, leafId, byId) {
|
|
|
163
156
|
else if (entry.type === "message" && entry.message.role === "assistant") {
|
|
164
157
|
model = { provider: entry.message.provider, modelId: entry.message.model };
|
|
165
158
|
}
|
|
166
|
-
|
|
159
|
+
}
|
|
160
|
+
return { thinkingLevel, model };
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Project one selected session entry into LLM/runtime messages.
|
|
164
|
+
* Plain custom entries are display/state entries and do not participate in context.
|
|
165
|
+
*/
|
|
166
|
+
export function sessionEntryToContextMessages(entry) {
|
|
167
|
+
if (entry.type === "message") {
|
|
168
|
+
return [entry.message];
|
|
169
|
+
}
|
|
170
|
+
if (entry.type === "custom_message") {
|
|
171
|
+
return [createCustomMessage(entry.customType, entry.content, entry.display, entry.details, entry.timestamp)];
|
|
172
|
+
}
|
|
173
|
+
if (entry.type === "branch_summary" && entry.summary) {
|
|
174
|
+
return [createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp)];
|
|
175
|
+
}
|
|
176
|
+
if (entry.type === "compaction") {
|
|
177
|
+
return [createCompactionSummaryMessage(entry.summary, entry.tokensBefore, entry.timestamp)];
|
|
178
|
+
}
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Build the active, compaction-aware session entry list.
|
|
183
|
+
*
|
|
184
|
+
* This follows the current leaf path. If the path contains compaction entries,
|
|
185
|
+
* the latest compaction is represented by the compaction entry itself, followed
|
|
186
|
+
* by the kept entries starting at firstKeptEntryId and all entries after the
|
|
187
|
+
* compaction entry. Older summarized entries are omitted.
|
|
188
|
+
*/
|
|
189
|
+
export function buildContextEntries(entries, leafId, byId) {
|
|
190
|
+
const path = buildSessionPath(entries, leafId, byId);
|
|
191
|
+
let compaction = null;
|
|
192
|
+
for (const entry of path) {
|
|
193
|
+
if (entry.type === "compaction") {
|
|
167
194
|
compaction = entry;
|
|
168
195
|
}
|
|
169
196
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
// 1. Emit summary first (entry = compaction)
|
|
173
|
-
// 2. Emit kept messages (from firstKeptEntryId up to compaction)
|
|
174
|
-
// 3. Emit messages after compaction
|
|
175
|
-
const messages = [];
|
|
176
|
-
const appendMessage = (entry) => {
|
|
177
|
-
if (entry.type === "message") {
|
|
178
|
-
messages.push(entry.message);
|
|
179
|
-
}
|
|
180
|
-
else if (entry.type === "custom_message") {
|
|
181
|
-
messages.push(createCustomMessage(entry.customType, entry.content, entry.display, entry.details, entry.timestamp));
|
|
182
|
-
}
|
|
183
|
-
else if (entry.type === "branch_summary" && entry.summary) {
|
|
184
|
-
messages.push(createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp));
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
if (compaction) {
|
|
188
|
-
// Emit summary first
|
|
189
|
-
messages.push(createCompactionSummaryMessage(compaction.summary, compaction.tokensBefore, compaction.timestamp));
|
|
190
|
-
// Find compaction index in path
|
|
191
|
-
const compactionIdx = path.findIndex((e) => e.type === "compaction" && e.id === compaction.id);
|
|
192
|
-
// Emit kept messages (before compaction, starting from firstKeptEntryId)
|
|
193
|
-
let foundFirstKept = false;
|
|
194
|
-
for (let i = 0; i < compactionIdx; i++) {
|
|
195
|
-
const entry = path[i];
|
|
196
|
-
if (entry.id === compaction.firstKeptEntryId) {
|
|
197
|
-
foundFirstKept = true;
|
|
198
|
-
}
|
|
199
|
-
if (foundFirstKept) {
|
|
200
|
-
appendMessage(entry);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
// Emit messages after compaction
|
|
204
|
-
for (let i = compactionIdx + 1; i < path.length; i++) {
|
|
205
|
-
const entry = path[i];
|
|
206
|
-
appendMessage(entry);
|
|
207
|
-
}
|
|
197
|
+
if (!compaction) {
|
|
198
|
+
return path;
|
|
208
199
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
200
|
+
const compactionIdx = path.findIndex((entry) => entry.id === compaction.id);
|
|
201
|
+
if (compactionIdx < 0) {
|
|
202
|
+
return path;
|
|
203
|
+
}
|
|
204
|
+
const contextEntries = [compaction];
|
|
205
|
+
let foundFirstKept = false;
|
|
206
|
+
for (let i = 0; i < compactionIdx; i++) {
|
|
207
|
+
const entry = path[i];
|
|
208
|
+
if (entry.id === compaction.firstKeptEntryId) {
|
|
209
|
+
foundFirstKept = true;
|
|
210
|
+
}
|
|
211
|
+
if (foundFirstKept) {
|
|
212
|
+
contextEntries.push(entry);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
+
contextEntries.push(...path.slice(compactionIdx + 1));
|
|
216
|
+
return contextEntries;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Build the session context from entries using tree traversal.
|
|
220
|
+
* If leafId is provided, walks from that entry to root.
|
|
221
|
+
* Handles compaction and branch summaries along the path.
|
|
222
|
+
*/
|
|
223
|
+
export function buildSessionContext(entries, leafId, byId) {
|
|
224
|
+
const path = buildSessionPath(entries, leafId, byId);
|
|
225
|
+
const { thinkingLevel, model } = getSessionContextSettings(path);
|
|
226
|
+
const messages = buildContextEntries(entries, leafId, byId).flatMap(sessionEntryToContextMessages);
|
|
215
227
|
return { messages, thinkingLevel, model };
|
|
216
228
|
}
|
|
217
229
|
/**
|
|
@@ -533,10 +545,13 @@ export class SessionManager {
|
|
|
533
545
|
this.sessionFile = resolvePath(sessionFile);
|
|
534
546
|
if (existsSync(this.sessionFile)) {
|
|
535
547
|
this.fileEntries = loadEntriesFromFile(this.sessionFile);
|
|
536
|
-
// If file was empty
|
|
537
|
-
//
|
|
548
|
+
// If file was empty, initialize it with a valid session header. If it was
|
|
549
|
+
// non-empty but did not parse as a pi session, fail without modifying it.
|
|
538
550
|
if (this.fileEntries.length === 0) {
|
|
539
551
|
const explicitPath = this.sessionFile;
|
|
552
|
+
if (statSync(explicitPath).size > 0) {
|
|
553
|
+
throw new Error(`Session file is not a valid pi session: ${explicitPath}`);
|
|
554
|
+
}
|
|
540
555
|
this.newSession();
|
|
541
556
|
this.sessionFile = explicitPath;
|
|
542
557
|
this._rewriteFile();
|
|
@@ -744,12 +759,13 @@ export class SessionManager {
|
|
|
744
759
|
}
|
|
745
760
|
/** Append a session info entry (e.g., display name). Returns entry id. */
|
|
746
761
|
appendSessionInfo(name) {
|
|
762
|
+
const sanitizedName = name.replace(/[\r\n]+/g, " ").trim();
|
|
747
763
|
const entry = {
|
|
748
764
|
type: "session_info",
|
|
749
765
|
id: generateId(this.byId),
|
|
750
766
|
parentId: this.leafId,
|
|
751
767
|
timestamp: new Date().toISOString(),
|
|
752
|
-
name:
|
|
768
|
+
name: sanitizedName,
|
|
753
769
|
};
|
|
754
770
|
this._appendEntry(entry);
|
|
755
771
|
return entry.id;
|
|
@@ -863,6 +879,13 @@ export class SessionManager {
|
|
|
863
879
|
path.reverse();
|
|
864
880
|
return path;
|
|
865
881
|
}
|
|
882
|
+
/**
|
|
883
|
+
* Build the active, compaction-aware entry list for context/rendering.
|
|
884
|
+
* Uses tree traversal from current leaf.
|
|
885
|
+
*/
|
|
886
|
+
buildContextEntries() {
|
|
887
|
+
return buildContextEntries(this.getEntries(), this.leafId, this.byId);
|
|
888
|
+
}
|
|
866
889
|
/**
|
|
867
890
|
* Build the session context (what gets sent to the LLM).
|
|
868
891
|
* Uses tree traversal from current leaf.
|
|
@@ -1112,8 +1135,8 @@ export class SessionManager {
|
|
|
1112
1135
|
return new SessionManager(cwd, dir, undefined, true);
|
|
1113
1136
|
}
|
|
1114
1137
|
/** Create an in-memory session (no file persistence) */
|
|
1115
|
-
static inMemory(cwd = process.cwd()) {
|
|
1116
|
-
return new SessionManager(cwd, "", undefined, false);
|
|
1138
|
+
static inMemory(cwd = process.cwd(), options) {
|
|
1139
|
+
return new SessionManager(cwd, "", undefined, false, options);
|
|
1117
1140
|
}
|
|
1118
1141
|
/**
|
|
1119
1142
|
* Fork a session from another project directory into the current project.
|
|
@@ -581,6 +581,17 @@ export class SettingsManager {
|
|
|
581
581
|
getHideThinkingBlock() {
|
|
582
582
|
return this.settings.hideThinkingBlock ?? false;
|
|
583
583
|
}
|
|
584
|
+
getExternalEditorCommand() {
|
|
585
|
+
const configuredEditor = this.settings.externalEditor;
|
|
586
|
+
if (typeof configuredEditor === "string" && configuredEditor.trim() !== "") {
|
|
587
|
+
return configuredEditor;
|
|
588
|
+
}
|
|
589
|
+
const environmentEditor = process.env.VISUAL || process.env.EDITOR;
|
|
590
|
+
if (environmentEditor) {
|
|
591
|
+
return environmentEditor;
|
|
592
|
+
}
|
|
593
|
+
return process.platform === "win32" ? "notepad" : "nano";
|
|
594
|
+
}
|
|
584
595
|
setHideThinkingBlock(hide) {
|
|
585
596
|
this.globalSettings.hideThinkingBlock = hide;
|
|
586
597
|
this.markModified("hideThinkingBlock");
|
|
@@ -851,6 +862,14 @@ export class SettingsManager {
|
|
|
851
862
|
this.markModified("editorPaddingX");
|
|
852
863
|
this.save();
|
|
853
864
|
}
|
|
865
|
+
getOutputPad() {
|
|
866
|
+
return this.settings.outputPad === 0 ? 0 : 1;
|
|
867
|
+
}
|
|
868
|
+
setOutputPad(padding) {
|
|
869
|
+
this.globalSettings.outputPad = padding;
|
|
870
|
+
this.markModified("outputPad");
|
|
871
|
+
this.save();
|
|
872
|
+
}
|
|
854
873
|
getAutocompleteMaxVisible() {
|
|
855
874
|
return this.settings.autocompleteMaxVisible ?? 5;
|
|
856
875
|
}
|
|
@@ -3,29 +3,39 @@
|
|
|
3
3
|
* Enable with PI_TIMING=1 environment variable.
|
|
4
4
|
*/
|
|
5
5
|
const ENABLED = process.env.PI_TIMING === "1";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
export function resetTimings() {
|
|
6
|
+
const timingNamespaces = new Map();
|
|
7
|
+
export function resetTimings(namespace = "main") {
|
|
9
8
|
if (!ENABLED)
|
|
10
9
|
return;
|
|
11
|
-
timings.
|
|
12
|
-
lastTime = Date.now();
|
|
10
|
+
timingNamespaces.set(namespace, { timings: [], lastTime: Date.now() });
|
|
13
11
|
}
|
|
14
|
-
export function time(label) {
|
|
12
|
+
export function time(label, namespace = "main") {
|
|
15
13
|
if (!ENABLED)
|
|
16
14
|
return;
|
|
17
15
|
const now = Date.now();
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
if (!timingNamespaces.has(namespace)) {
|
|
17
|
+
resetTimings(namespace);
|
|
18
|
+
}
|
|
19
|
+
const timingNamespace = timingNamespaces.get(namespace);
|
|
20
|
+
timingNamespace.timings.push({ label, ms: now - timingNamespace.lastTime });
|
|
21
|
+
timingNamespace.lastTime = now;
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
function printTimingGroup(title, timings) {
|
|
24
|
+
const printableTimings = timings.filter((timing) => timing.ms >= 0);
|
|
25
|
+
if (printableTimings.length === 0)
|
|
23
26
|
return;
|
|
24
|
-
console.error(
|
|
25
|
-
for (const t of
|
|
27
|
+
console.error(`\n--- ${title} ---`);
|
|
28
|
+
for (const t of printableTimings) {
|
|
26
29
|
console.error(` ${t.label}: ${t.ms}ms`);
|
|
27
30
|
}
|
|
28
|
-
console.error(` TOTAL: ${
|
|
29
|
-
console.error("
|
|
31
|
+
console.error(` TOTAL: ${printableTimings.reduce((a, b) => a + b.ms, 0)}ms`);
|
|
32
|
+
console.error(`${"-".repeat(title.length + 8)}\n`);
|
|
33
|
+
}
|
|
34
|
+
export function printTimings() {
|
|
35
|
+
if (!ENABLED)
|
|
36
|
+
return;
|
|
37
|
+
for (const [namespace, timingNamespace] of timingNamespaces) {
|
|
38
|
+
printTimingGroup(`Startup Timings: ${namespace}`, timingNamespace.timings);
|
|
39
|
+
}
|
|
30
40
|
}
|
|
31
41
|
//# sourceMappingURL=timings.js.map
|
|
@@ -12,6 +12,20 @@ import { OutputAccumulator } from "./output-accumulator.js";
|
|
|
12
12
|
import { getTextOutput, invalidArgText, str } from "./render-utils.js";
|
|
13
13
|
import { wrapToolDefinition } from "./tool-definition-wrapper.js";
|
|
14
14
|
import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize } from "./truncate.js";
|
|
15
|
+
const MAX_TIMEOUT_MS = 2_147_483_647;
|
|
16
|
+
const MAX_TIMEOUT_SECONDS = MAX_TIMEOUT_MS / 1000;
|
|
17
|
+
function resolveTimeoutMs(timeout) {
|
|
18
|
+
if (timeout === undefined)
|
|
19
|
+
return undefined;
|
|
20
|
+
if (!Number.isFinite(timeout) || timeout <= 0) {
|
|
21
|
+
throw new Error("Invalid timeout: must be a finite number of seconds");
|
|
22
|
+
}
|
|
23
|
+
const timeoutMs = timeout * 1000;
|
|
24
|
+
if (timeoutMs > MAX_TIMEOUT_MS) {
|
|
25
|
+
throw new Error(`Invalid timeout: maximum is ${MAX_TIMEOUT_SECONDS} seconds`);
|
|
26
|
+
}
|
|
27
|
+
return timeoutMs;
|
|
28
|
+
}
|
|
15
29
|
const bashSchema = Type.Object({
|
|
16
30
|
command: Type.String({ description: "Bash command to execute" }),
|
|
17
31
|
timeout: Type.Optional(Type.Number({ description: "Timeout in seconds (optional, no default timeout)" })),
|
|
@@ -25,6 +39,10 @@ const bashSchema = Type.Object({
|
|
|
25
39
|
export function createLocalBashOperations(options) {
|
|
26
40
|
return {
|
|
27
41
|
exec: async (command, cwd, { onData, signal, timeout, env }) => {
|
|
42
|
+
const timeoutMs = resolveTimeoutMs(timeout);
|
|
43
|
+
if (signal?.aborted) {
|
|
44
|
+
throw new Error("aborted");
|
|
45
|
+
}
|
|
28
46
|
const shellConfig = getShellConfig(options?.shellPath);
|
|
29
47
|
try {
|
|
30
48
|
await fsAccess(cwd, constants.F_OK);
|
|
@@ -32,9 +50,6 @@ export function createLocalBashOperations(options) {
|
|
|
32
50
|
catch {
|
|
33
51
|
throw new Error(`Working directory does not exist: ${cwd}\nCannot execute bash commands.`);
|
|
34
52
|
}
|
|
35
|
-
if (signal?.aborted) {
|
|
36
|
-
throw new Error("aborted");
|
|
37
|
-
}
|
|
38
53
|
const commandFromStdin = shellConfig.commandTransport === "stdin";
|
|
39
54
|
const child = spawn(shellConfig.shell, commandFromStdin ? shellConfig.args : [...shellConfig.args, command], {
|
|
40
55
|
cwd,
|
|
@@ -57,12 +72,12 @@ export function createLocalBashOperations(options) {
|
|
|
57
72
|
};
|
|
58
73
|
try {
|
|
59
74
|
// Set timeout if provided.
|
|
60
|
-
if (
|
|
75
|
+
if (timeoutMs !== undefined) {
|
|
61
76
|
timeoutHandle = setTimeout(() => {
|
|
62
77
|
timedOut = true;
|
|
63
78
|
if (child.pid)
|
|
64
79
|
killProcessTree(child.pid);
|
|
65
|
-
},
|
|
80
|
+
}, timeoutMs);
|
|
66
81
|
}
|
|
67
82
|
// Stream stdout and stderr.
|
|
68
83
|
child.stdout?.on("data", onData);
|
|
@@ -13,13 +13,13 @@ const replaceEditSchema = Type.Object({
|
|
|
13
13
|
description: "Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call.",
|
|
14
14
|
}),
|
|
15
15
|
newText: Type.String({ description: "Replacement text for this targeted edit." }),
|
|
16
|
-
}, {
|
|
16
|
+
}, {});
|
|
17
17
|
const editSchema = Type.Object({
|
|
18
18
|
path: Type.String({ description: "Path to the file to edit (relative or absolute)" }),
|
|
19
19
|
edits: Type.Array(replaceEditSchema, {
|
|
20
20
|
description: "One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead.",
|
|
21
21
|
}),
|
|
22
|
-
}, {
|
|
22
|
+
}, {});
|
|
23
23
|
const defaultEditOperations = {
|
|
24
24
|
readFile: (path) => fsReadFile(path),
|
|
25
25
|
writeFile: (path, content) => fsWriteFile(path, content, "utf-8"),
|