@psnext/slingcli 2.5.20260629-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 +4 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +20 -2
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +2 -14
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +16 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +54 -19
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +8 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +2 -14
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +15 -45
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js +124 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js +4 -3
- 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/mistral.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +5 -5
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js +75 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +105 -88
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +41 -4
- 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/utils/error-body.js +109 -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/overflow.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +35 -4
- 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 +5 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +6 -0
- 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-resolver.js +14 -17
- 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/session-manager.js +87 -68
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +8 -0
- 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/index.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +15 -7
- 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/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 +18 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +143 -130
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -12
- package/node_modules/@earendil-works/pi-coding-agent/package.json +4 -4
- package/node_modules/@earendil-works/pi-orchestrator/package.json +2 -2
- 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 +237 -3
- 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/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 -7
- package/slingshot/index.js +261 -261
- 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/@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
|
@@ -45,6 +45,23 @@ const buildBuiltinKeybindings = (resolvedKeybindings) => {
|
|
|
45
45
|
}
|
|
46
46
|
return builtinKeybindings;
|
|
47
47
|
};
|
|
48
|
+
async function callContextHandlerAbortable(fn, signal) {
|
|
49
|
+
if (signal.aborted) {
|
|
50
|
+
throw new Error("Agent run aborted");
|
|
51
|
+
}
|
|
52
|
+
let cleanup = () => { };
|
|
53
|
+
const abortPromise = new Promise((_resolve, reject) => {
|
|
54
|
+
const onAbort = () => reject(new Error("Agent run aborted"));
|
|
55
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
56
|
+
cleanup = () => signal.removeEventListener("abort", onAbort);
|
|
57
|
+
});
|
|
58
|
+
try {
|
|
59
|
+
return await Promise.race([Promise.resolve().then(fn), abortPromise]);
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
cleanup();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
48
65
|
/**
|
|
49
66
|
* Helper function to emit session_shutdown event to extensions.
|
|
50
67
|
* Returns true if the event was emitted, false if there were no handlers.
|
|
@@ -358,6 +375,15 @@ export class ExtensionRunner {
|
|
|
358
375
|
}
|
|
359
376
|
return undefined;
|
|
360
377
|
}
|
|
378
|
+
getEntryRenderer(customType) {
|
|
379
|
+
for (const ext of this.extensions) {
|
|
380
|
+
const renderer = ext.entryRenderers?.get(customType);
|
|
381
|
+
if (renderer) {
|
|
382
|
+
return renderer;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return undefined;
|
|
386
|
+
}
|
|
361
387
|
resolveRegisteredCommands() {
|
|
362
388
|
const commands = [];
|
|
363
389
|
const counts = new Map();
|
|
@@ -684,6 +710,7 @@ export class ExtensionRunner {
|
|
|
684
710
|
}
|
|
685
711
|
async emitContext(messages) {
|
|
686
712
|
const ctx = this.createContext();
|
|
713
|
+
const signal = ctx.signal;
|
|
687
714
|
let currentMessages = structuredClone(messages);
|
|
688
715
|
for (const ext of this.extensions) {
|
|
689
716
|
const handlers = ext.handlers.get("context");
|
|
@@ -692,12 +719,17 @@ export class ExtensionRunner {
|
|
|
692
719
|
for (const handler of handlers) {
|
|
693
720
|
try {
|
|
694
721
|
const event = { type: "context", messages: currentMessages };
|
|
695
|
-
const handlerResult =
|
|
722
|
+
const handlerResult = signal
|
|
723
|
+
? await callContextHandlerAbortable(() => handler(event, ctx), signal)
|
|
724
|
+
: await handler(event, ctx);
|
|
696
725
|
if (handlerResult && handlerResult.messages) {
|
|
697
726
|
currentMessages = handlerResult.messages;
|
|
698
727
|
}
|
|
699
728
|
}
|
|
700
729
|
catch (err) {
|
|
730
|
+
if (signal?.aborted) {
|
|
731
|
+
throw err;
|
|
732
|
+
}
|
|
701
733
|
const message = err instanceof Error ? err.message : String(err);
|
|
702
734
|
const stack = err instanceof Error ? err.stack : undefined;
|
|
703
735
|
this.emitError({
|
|
@@ -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.
|
|
@@ -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) {
|
|
@@ -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
|
/**
|
|
@@ -867,6 +879,13 @@ export class SessionManager {
|
|
|
867
879
|
path.reverse();
|
|
868
880
|
return path;
|
|
869
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
|
+
}
|
|
870
889
|
/**
|
|
871
890
|
* Build the session context (what gets sent to the LLM).
|
|
872
891
|
* Uses tree traversal from current leaf.
|
|
@@ -862,6 +862,14 @@ export class SettingsManager {
|
|
|
862
862
|
this.markModified("editorPaddingX");
|
|
863
863
|
this.save();
|
|
864
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
|
+
}
|
|
865
873
|
getAutocompleteMaxVisible() {
|
|
866
874
|
return this.settings.autocompleteMaxVisible ?? 5;
|
|
867
875
|
}
|
|
@@ -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"),
|
|
@@ -11,6 +11,7 @@ export { createEventBus } from "./core/event-bus.js";
|
|
|
11
11
|
export { createExtensionRuntime, defineTool, discoverAndLoadExtensions, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.js";
|
|
12
12
|
export { convertToLlm } from "./core/messages.js";
|
|
13
13
|
export { ModelRegistry } from "./core/model-registry.js";
|
|
14
|
+
export { resolveCliModel, resolveModelScopeWithDiagnostics, } from "./core/model-resolver.js";
|
|
14
15
|
export { DefaultPackageManager } from "./core/package-manager.js";
|
|
15
16
|
export { DefaultResourceLoader, loadProjectContextFiles } from "./core/resource-loader.js";
|
|
16
17
|
// SDK for programmatic usage
|
|
@@ -19,7 +20,7 @@ export { AgentSessionRuntime,
|
|
|
19
20
|
createAgentSession, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createBashTool,
|
|
20
21
|
// Tool factories (for custom cwd)
|
|
21
22
|
createCodingTools, createEditTool, createFindTool, createGrepTool, createLsTool, createReadOnlyTools, createReadTool, createWriteTool, } from "./core/sdk.js";
|
|
22
|
-
export { buildSessionContext, CURRENT_SESSION_VERSION, getLatestCompactionEntry, migrateSessionEntries, parseSessionEntries, SessionManager, } from "./core/session-manager.js";
|
|
23
|
+
export { buildContextEntries, buildSessionContext, CURRENT_SESSION_VERSION, getLatestCompactionEntry, migrateSessionEntries, parseSessionEntries, SessionManager, sessionEntryToContextMessages, } from "./core/session-manager.js";
|
|
23
24
|
export { SettingsManager, } from "./core/settings-manager.js";
|
|
24
25
|
// Skills
|
|
25
26
|
export { formatSkillsForPrompt, loadSkills, loadSkillsFromDir, } from "./core/skills.js";
|
|
@@ -35,7 +35,7 @@ import { initTheme, stopThemeWatcher } from "./modes/interactive/theme/theme.js"
|
|
|
35
35
|
import { handleConfigCommand, handlePackageCommand } from "./package-manager-cli.js";
|
|
36
36
|
import { isLocalPath, normalizePath, resolvePath } from "./utils/paths.js";
|
|
37
37
|
import { cleanupWindowsSelfUpdateQuarantine } from "./utils/windows-self-update.js";
|
|
38
|
-
const EXTENSION_LOAD_FAILURE_HINT = 'Hint: Start without extensions using "
|
|
38
|
+
const EXTENSION_LOAD_FAILURE_HINT = 'Hint: Start without extensions using "pi -ne".';
|
|
39
39
|
/**
|
|
40
40
|
* Read all content from piped stdin.
|
|
41
41
|
* Returns undefined if stdin is a TTY (interactive terminal).
|
|
@@ -11,13 +11,15 @@ export class AssistantMessageComponent extends Container {
|
|
|
11
11
|
hideThinkingBlock;
|
|
12
12
|
markdownTheme;
|
|
13
13
|
hiddenThinkingLabel;
|
|
14
|
+
outputPad;
|
|
14
15
|
lastMessage;
|
|
15
16
|
hasToolCalls = false;
|
|
16
|
-
constructor(message, hideThinkingBlock = false, markdownTheme = getMarkdownTheme(), hiddenThinkingLabel = "Thinking...") {
|
|
17
|
+
constructor(message, hideThinkingBlock = false, markdownTheme = getMarkdownTheme(), hiddenThinkingLabel = "Thinking...", outputPad = 1) {
|
|
17
18
|
super();
|
|
18
19
|
this.hideThinkingBlock = hideThinkingBlock;
|
|
19
20
|
this.markdownTheme = markdownTheme;
|
|
20
21
|
this.hiddenThinkingLabel = hiddenThinkingLabel;
|
|
22
|
+
this.outputPad = outputPad;
|
|
21
23
|
// Container for text/thinking content
|
|
22
24
|
this.contentContainer = new Container();
|
|
23
25
|
this.addChild(this.contentContainer);
|
|
@@ -43,6 +45,12 @@ export class AssistantMessageComponent extends Container {
|
|
|
43
45
|
this.updateContent(this.lastMessage);
|
|
44
46
|
}
|
|
45
47
|
}
|
|
48
|
+
setOutputPad(padding) {
|
|
49
|
+
this.outputPad = padding;
|
|
50
|
+
if (this.lastMessage) {
|
|
51
|
+
this.updateContent(this.lastMessage);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
46
54
|
render(width) {
|
|
47
55
|
const lines = super.render(width);
|
|
48
56
|
if (this.hasToolCalls || lines.length === 0) {
|
|
@@ -66,7 +74,7 @@ export class AssistantMessageComponent extends Container {
|
|
|
66
74
|
if (content.type === "text" && content.text.trim()) {
|
|
67
75
|
// Assistant text messages with no background - trim the text
|
|
68
76
|
// Set paddingY=0 to avoid extra spacing before tool executions
|
|
69
|
-
this.contentContainer.addChild(new Markdown(content.text.trim(),
|
|
77
|
+
this.contentContainer.addChild(new Markdown(content.text.trim(), this.outputPad, 0, this.markdownTheme));
|
|
70
78
|
}
|
|
71
79
|
else if (content.type === "thinking" && content.thinking.trim()) {
|
|
72
80
|
// Add spacing only when another visible assistant content block follows.
|
|
@@ -76,14 +84,14 @@ export class AssistantMessageComponent extends Container {
|
|
|
76
84
|
.some((c) => (c.type === "text" && c.text.trim()) || (c.type === "thinking" && c.thinking.trim()));
|
|
77
85
|
if (this.hideThinkingBlock) {
|
|
78
86
|
// Show static thinking label when hidden
|
|
79
|
-
this.contentContainer.addChild(new Text(theme.italic(theme.fg("thinkingText", this.hiddenThinkingLabel)),
|
|
87
|
+
this.contentContainer.addChild(new Text(theme.italic(theme.fg("thinkingText", this.hiddenThinkingLabel)), this.outputPad, 0));
|
|
80
88
|
if (hasVisibleContentAfter) {
|
|
81
89
|
this.contentContainer.addChild(new Spacer(1));
|
|
82
90
|
}
|
|
83
91
|
}
|
|
84
92
|
else {
|
|
85
93
|
// Thinking traces in thinkingText color, italic
|
|
86
|
-
this.contentContainer.addChild(new Markdown(content.thinking.trim(),
|
|
94
|
+
this.contentContainer.addChild(new Markdown(content.thinking.trim(), this.outputPad, 0, this.markdownTheme, {
|
|
87
95
|
color: (text) => theme.fg("thinkingText", text),
|
|
88
96
|
italic: true,
|
|
89
97
|
}));
|
|
@@ -100,7 +108,7 @@ export class AssistantMessageComponent extends Container {
|
|
|
100
108
|
this.hasToolCalls = hasToolCalls;
|
|
101
109
|
if (message.stopReason === "length") {
|
|
102
110
|
this.contentContainer.addChild(new Spacer(1));
|
|
103
|
-
this.contentContainer.addChild(new Text(theme.fg("error", "Error: Model stopped because it reached the maximum output token limit. The response may be incomplete."),
|
|
111
|
+
this.contentContainer.addChild(new Text(theme.fg("error", "Error: Model stopped because it reached the maximum output token limit. The response may be incomplete."), this.outputPad, 0));
|
|
104
112
|
}
|
|
105
113
|
else if (!hasToolCalls) {
|
|
106
114
|
if (message.stopReason === "aborted") {
|
|
@@ -108,12 +116,12 @@ export class AssistantMessageComponent extends Container {
|
|
|
108
116
|
? message.errorMessage
|
|
109
117
|
: "Operation aborted";
|
|
110
118
|
this.contentContainer.addChild(new Spacer(1));
|
|
111
|
-
this.contentContainer.addChild(new Text(theme.fg("error", abortMessage),
|
|
119
|
+
this.contentContainer.addChild(new Text(theme.fg("error", abortMessage), this.outputPad, 0));
|
|
112
120
|
}
|
|
113
121
|
else if (message.stopReason === "error") {
|
|
114
122
|
const errorMsg = message.errorMessage || "Unknown error";
|
|
115
123
|
this.contentContainer.addChild(new Spacer(1));
|
|
116
|
-
this.contentContainer.addChild(new Text(theme.fg("error", `Error: ${errorMsg}`),
|
|
124
|
+
this.contentContainer.addChild(new Text(theme.fg("error", `Error: ${errorMsg}`), this.outputPad, 0));
|
|
117
125
|
}
|
|
118
126
|
}
|
|
119
127
|
}
|