@psnext/slingcli 2.5.20260724-1 → 2.5.20260727-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/bin/sling.js +1 -1
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +66 -28
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +133 -15
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +7 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +28 -14
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.js +8 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.browser.js +9 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js +5 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +12 -6
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js +2 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +10 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +10 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js +18 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.js +13 -15
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/ByteJsonShapeSerializer.js +27 -17
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js +22 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/needsReviver.js +41 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +33 -13
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/writeKey.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +2 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +6 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/index.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +22 -6
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/index.browser.d.ts +11 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/index.d.ts +7 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +22 -6
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/index.d.ts +2 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/detectBufferParsing.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +0 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/needsReviver.d.ts +11 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +7 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/writeKey.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/api-extractor-type-index.d.ts +7 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +21 -61
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +27 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConstants.d.ts +16 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +14 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/index.d.ts +5 -16
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/emitWarningIfUnsupportedVersion.d.ts +11 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +47 -107
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +39 -112
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +48 -107
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/longPollMiddleware.d.ts +14 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts +35 -25
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-logger/loggerMiddleware.d.ts +4 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/configuration.d.ts +6 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts +5 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +5 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.browser.d.ts +6 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.d.ts +10 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.native.d.ts +6 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/check-features.d.ts +20 -16
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/configurations.d.ts +44 -21
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/constants.d.ts +7 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/encode-features.d.ts +5 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/user-agent-middleware.d.ts +18 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/awsRegionConfig.d.ts +11 -8
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/extensions.d.ts +16 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.browser.d.ts +4 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.d.ts +14 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.native.d.ts +4 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setCredentialFeature.d.ts +7 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setFeature.d.ts +12 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setTokenFeature.d.ts +7 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/aws.d.ts +2 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.d.ts +5 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/parseArn.d.ts +7 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partition.d.ts +38 -28
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +638 -647
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/isIpAddress.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveDefaultAwsRegionalEndpointsConfig.d.ts +56 -29
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveEndpoint.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointError.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointRuleObject.d.ts +1 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/ErrorRuleObject.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/RuleSetObject.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/TreeRuleObject.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/shared.d.ts +1 -12
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/configurations.d.ts +7 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.d.ts +14 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +2 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +27 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +18 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/crt-availability.d.ts +8 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +28 -17
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.d.ts +6 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/is-crt-available.d.ts +5 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.d.ts +13 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +10 -9
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +44 -37
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.d.ts +5 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +6 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/index.d.ts +7 -23
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +38 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +133 -56
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.browser.d.ts +11 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.d.ts +9 -24
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.d.ts +8 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.d.ts +6 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +8 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.d.ts +8 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +26 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/index.d.ts +4 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/isClockSkewed.d.ts +9 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ProtocolLib.d.ts +74 -40
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +24 -9
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.d.ts +25 -36
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/coercing-serializers.d.ts +18 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/common.d.ts +2 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +22 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +22 -21
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +22 -21
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +29 -49
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +36 -49
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonCodec.d.ts +19 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeDeserializer.d.ts +13 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +28 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/awsExpectUnion.d.ts +7 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +29 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +57 -30
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +21 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +15 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +11 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +22 -9
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +27 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsQueryProtocol.d.ts +49 -57
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QuerySerializerSettings.d.ts +13 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QueryShapeSerializer.d.ts +16 -21
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +31 -47
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlCodec.d.ts +14 -17
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeDeserializer.d.ts +20 -15
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeSerializer.d.ts +21 -21
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/parseXmlBody.d.ts +13 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/simpleFormatXml.d.ts +6 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +3 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-arn-parser/arn.d.ts +32 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-format-url/format-url.d.ts +2 -4
- package/node_modules/@aws-sdk/core/package.json +10 -6
- package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-websocket/package.json +5 -5
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/package.json +6 -6
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +14 -4
- package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +14 -4
- package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +17 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +8 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +118 -11
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js +132 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit-diff.js +386 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js +95 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js +46 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/image.js +106 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/index.js +5 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js +26 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js +110 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/tool-context.js +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +31 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +90 -35
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +10 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +26 -10
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +21 -8
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +25 -13
- package/node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js +100 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +7 -11
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +17 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +7 -11
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +13 -9
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +68 -27
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +131 -34
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +173 -66
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +29 -7
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +8 -3
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js +222 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js +37 -35
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +11 -1
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +9 -3
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/model-catalog.js +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +5 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +30 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/ant-ling.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cerebras.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/deepseek.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/groq.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/kimi-coding.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-images.js +10 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +10 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-cn.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +8 -3
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +94 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +3 -0
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +7 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +11 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +20 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js +3 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js +24 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +34 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/tool-definition-wrapper.js +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js +7 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js +10 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/extension-editor.js +16 -46
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js +22 -13
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/external-editor.js +37 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +67 -74
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js +19 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/version-check.js +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +16 -15
- package/node_modules/@earendil-works/pi-coding-agent/package.json +5 -4
- package/node_modules/@earendil-works/pi-server/package.json +2 -2
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +15 -12
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +6 -3
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +1 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +1 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +2 -2
- package/node_modules/@smithy/core/dist-types/submodules/retry/service-error-classification/constants.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/service-error-classification/constants.d.ts +1 -0
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
- package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
- package/node_modules/@smithy/signature-v4/package.json +2 -2
- package/node_modules/gaxios/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/node_modules/gaxios/build/esm/tsconfig.tsbuildinfo +1 -1
- package/node_modules/gaxios/package.json +1 -1
- package/node_modules/google-auth-library/build/src/auth/googleauth.js +24 -19
- package/node_modules/google-auth-library/package.json +1 -1
- package/node_modules/undici/lib/cache/memory-cache-store.js +54 -9
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +7 -1
- package/node_modules/undici/lib/core/request.js +12 -1
- package/node_modules/undici/lib/dispatcher/client-h1.js +11 -2
- package/node_modules/undici/lib/handler/cache-handler.js +246 -64
- package/node_modules/undici/lib/handler/cache-revalidation-handler.js +3 -3
- package/node_modules/undici/lib/handler/retry-handler.js +24 -0
- package/node_modules/undici/lib/interceptor/cache.js +159 -52
- package/node_modules/undici/lib/util/cache.js +324 -62
- package/node_modules/undici/lib/util/date.js +23 -6
- package/node_modules/undici/lib/web/cookies/util.js +79 -9
- package/node_modules/undici/package.json +1 -1
- package/package.json +7 -7
- package/sling-default-packages.json +2 -1
- package/slingshot/index.js +337 -339
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Pure functions for compaction logic. The session manager handles I/O,
|
|
5
5
|
* and after compaction the session is reloaded.
|
|
6
6
|
*/
|
|
7
|
-
import { contentText, retryAssistantCall } from "@earendil-works/pi-ai";
|
|
7
|
+
import { contentText, retryAssistantCall, uuidv7 } from "@earendil-works/pi-ai";
|
|
8
8
|
import { completeSimple } from "@earendil-works/pi-ai/compat";
|
|
9
9
|
import { convertToLlm } from "../messages.js";
|
|
10
10
|
import { buildSessionContext, sessionEntryToContextMessages, } from "../session-manager.js";
|
|
@@ -438,8 +438,16 @@ function createSummarizationOptions(model, maxTokens, apiKey, headers, env, sign
|
|
|
438
438
|
* immediately (see {@link retryAssistantCall}).
|
|
439
439
|
*/
|
|
440
440
|
export async function completeSummarization(model, context, options, streamFn, retry, callbacks) {
|
|
441
|
-
|
|
442
|
-
|
|
441
|
+
// Summaries are standalone requests, so isolate routing and avoid cache writes that cannot be reused.
|
|
442
|
+
const requestOptions = {
|
|
443
|
+
...options,
|
|
444
|
+
cacheRetention: "none",
|
|
445
|
+
sessionId: uuidv7(),
|
|
446
|
+
};
|
|
447
|
+
const produce = async () => streamFn
|
|
448
|
+
? (await streamFn(model, context, requestOptions)).result()
|
|
449
|
+
: completeSimple(model, context, requestOptions);
|
|
450
|
+
return retryAssistantCall(produce, retry, requestOptions.signal, callbacks);
|
|
443
451
|
}
|
|
444
452
|
/**
|
|
445
453
|
* Generate a summary of the conversation using the LLM.
|
|
@@ -483,6 +483,10 @@ export class ExtensionRunner {
|
|
|
483
483
|
runner.assertActive();
|
|
484
484
|
return getModel();
|
|
485
485
|
},
|
|
486
|
+
get thinkingLevel() {
|
|
487
|
+
runner.assertActive();
|
|
488
|
+
return runner.runtime.getThinkingLevel();
|
|
489
|
+
},
|
|
486
490
|
isIdle: () => {
|
|
487
491
|
runner.assertActive();
|
|
488
492
|
return runner.isIdleFn();
|
|
@@ -83,6 +83,7 @@ const OpenAICompletionsCompatSchema = Type.Object({
|
|
|
83
83
|
cacheControlFormat: Type.Optional(Type.Literal("anthropic")),
|
|
84
84
|
openRouterRouting: Type.Optional(OpenRouterRoutingSchema),
|
|
85
85
|
vercelGatewayRouting: Type.Optional(VercelGatewayRoutingSchema),
|
|
86
|
+
supportsOpenAIGrammarTools: Type.Optional(Type.Boolean()),
|
|
86
87
|
supportsStrictMode: Type.Optional(Type.Boolean()),
|
|
87
88
|
sendSessionAffinityHeaders: Type.Optional(Type.Boolean()),
|
|
88
89
|
deferredToolsMode: Type.Optional(Type.Literal("kimi")),
|
|
@@ -93,6 +94,8 @@ const OpenAIResponsesCompatSchema = Type.Object({
|
|
|
93
94
|
supportsDeveloperRole: Type.Optional(Type.Boolean()),
|
|
94
95
|
sessionAffinityFormat: Type.Optional(Type.Union([Type.Literal("openai"), Type.Literal("openai-nosession"), Type.Literal("openrouter")])),
|
|
95
96
|
supportsLongCacheRetention: Type.Optional(Type.Boolean()),
|
|
97
|
+
supportsStrictMode: Type.Optional(Type.Boolean()),
|
|
98
|
+
supportsOpenAIGrammarTools: Type.Optional(Type.Boolean()),
|
|
96
99
|
supportsToolSearch: Type.Optional(Type.Boolean()),
|
|
97
100
|
});
|
|
98
101
|
const AnthropicMessagesCompatSchema = Type.Object({
|
|
@@ -100,7 +103,10 @@ const AnthropicMessagesCompatSchema = Type.Object({
|
|
|
100
103
|
supportsLongCacheRetention: Type.Optional(Type.Boolean()),
|
|
101
104
|
sendSessionAffinityHeaders: Type.Optional(Type.Boolean()),
|
|
102
105
|
supportsCacheControlOnTools: Type.Optional(Type.Boolean()),
|
|
106
|
+
supportsTemperature: Type.Optional(Type.Boolean()),
|
|
103
107
|
forceAdaptiveThinking: Type.Optional(Type.Boolean()),
|
|
108
|
+
allowEmptySignature: Type.Optional(Type.Boolean()),
|
|
109
|
+
supportsStrictTools: Type.Optional(Type.Boolean()),
|
|
104
110
|
supportsToolReferences: Type.Optional(Type.Boolean()),
|
|
105
111
|
});
|
|
106
112
|
const ProviderCompatSchema = Type.Union([
|
|
@@ -9,8 +9,8 @@ export class ModelRegistry {
|
|
|
9
9
|
this.runtime = runtime;
|
|
10
10
|
}
|
|
11
11
|
/** Reload models.json asynchronously. Await before making synchronous registry reads. */
|
|
12
|
-
refresh() {
|
|
13
|
-
|
|
12
|
+
async refresh() {
|
|
13
|
+
await this.runtime.refresh();
|
|
14
14
|
}
|
|
15
15
|
getError() {
|
|
16
16
|
return this.runtime.getError();
|
|
@@ -216,6 +216,13 @@ export async function resolveModelScopeWithDiagnostics(patterns, modelRuntime) {
|
|
|
216
216
|
globPattern = pattern.substring(0, colonIdx);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
+
const exactMatch = findExactModelReferenceMatch(globPattern, availableModels);
|
|
220
|
+
if (exactMatch) {
|
|
221
|
+
if (!scopedModels.find((sm) => modelsAreEqual(sm.model, exactMatch))) {
|
|
222
|
+
scopedModels.push({ model: exactMatch, thinkingLevel });
|
|
223
|
+
}
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
219
226
|
// Match against "provider/modelId" format OR just model ID
|
|
220
227
|
// This allows "*sonnet*" to match without requiring "anthropic/*sonnet*"
|
|
221
228
|
const matchingModels = availableModels.filter((m) => {
|
|
@@ -223,7 +230,12 @@ export async function resolveModelScopeWithDiagnostics(patterns, modelRuntime) {
|
|
|
223
230
|
return minimatch(fullId, globPattern, { nocase: true }) || minimatch(m.id, globPattern, { nocase: true });
|
|
224
231
|
});
|
|
225
232
|
if (matchingModels.length === 0) {
|
|
226
|
-
diagnostics.push({
|
|
233
|
+
diagnostics.push({
|
|
234
|
+
type: "warning",
|
|
235
|
+
code: "no-match",
|
|
236
|
+
message: `No models match pattern "${pattern}"`,
|
|
237
|
+
pattern,
|
|
238
|
+
});
|
|
227
239
|
continue;
|
|
228
240
|
}
|
|
229
241
|
for (const model of matchingModels) {
|
|
@@ -235,10 +247,15 @@ export async function resolveModelScopeWithDiagnostics(patterns, modelRuntime) {
|
|
|
235
247
|
}
|
|
236
248
|
const { model, thinkingLevel, warning } = parseModelPattern(pattern, availableModels);
|
|
237
249
|
if (warning) {
|
|
238
|
-
diagnostics.push({ type: "warning", message: warning, pattern });
|
|
250
|
+
diagnostics.push({ type: "warning", code: "invalid-thinking-level", message: warning, pattern });
|
|
239
251
|
}
|
|
240
252
|
if (!model) {
|
|
241
|
-
diagnostics.push({
|
|
253
|
+
diagnostics.push({
|
|
254
|
+
type: "warning",
|
|
255
|
+
code: "no-match",
|
|
256
|
+
message: `No models match pattern "${pattern}"`,
|
|
257
|
+
pattern,
|
|
258
|
+
});
|
|
242
259
|
continue;
|
|
243
260
|
}
|
|
244
261
|
// Avoid duplicates
|
|
@@ -62,11 +62,12 @@ export class ModelRuntime {
|
|
|
62
62
|
(modelsPath
|
|
63
63
|
? new FileModelsStore(options.modelsStorePath ?? join(dirname(modelsPath), "models-store.json"))
|
|
64
64
|
: new InMemoryCodingAgentModelsStore());
|
|
65
|
+
const builtinModelDataGeneratedAt = builtinProviderCatalog.getBuiltinModelDataGeneratedAt();
|
|
65
66
|
const providers = builtinProviderCatalog
|
|
66
67
|
.builtinProviders()
|
|
67
68
|
.map((provider) => provider.id === "radius"
|
|
68
69
|
? provider
|
|
69
|
-
: withRemoteCatalog(provider, options.catalogBaseUrl,
|
|
70
|
+
: withRemoteCatalog(provider, options.catalogBaseUrl, builtinModelDataGeneratedAt));
|
|
70
71
|
const runtime = new ModelRuntime(credentials, config, modelsPath, modelsStore, providers, process.env.PI_OFFLINE === undefined);
|
|
71
72
|
runtime.configureRadiusProviders();
|
|
72
73
|
runtime.rebuildProviders();
|
|
@@ -359,13 +360,10 @@ export class ModelRuntime {
|
|
|
359
360
|
this.recomposeProvider(providerId);
|
|
360
361
|
await this.refresh({ allowNetwork: this.modelNetworkEnabled });
|
|
361
362
|
}
|
|
362
|
-
async
|
|
363
|
+
async refresh(options = {}) {
|
|
363
364
|
this.config = await ModelConfig.load(this.modelsPath);
|
|
364
365
|
this.configureRadiusProviders();
|
|
365
366
|
this.rebuildProviders();
|
|
366
|
-
await this.refresh({ allowNetwork: this.modelNetworkEnabled });
|
|
367
|
-
}
|
|
368
|
-
async refresh(options = {}) {
|
|
369
367
|
const refreshOptions = {
|
|
370
368
|
...options,
|
|
371
369
|
allowNetwork: options.allowNetwork ?? this.modelNetworkEnabled,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { stat } from "node:fs/promises";
|
|
2
1
|
import { VERSION } from "../config.js";
|
|
3
2
|
import { getPiUserAgent } from "../utils/pi-user-agent.js";
|
|
4
3
|
const DEFAULT_CATALOG_BASE_URL = "https://pi.dev";
|
|
@@ -28,17 +27,16 @@ function parseCatalog(providerId, value) {
|
|
|
28
27
|
.filter((entry) => typeof entry === "object" && entry !== null && "id" in entry)
|
|
29
28
|
.map((model) => ({ ...model, provider: providerId }));
|
|
30
29
|
}
|
|
31
|
-
function remoteModels(entry,
|
|
30
|
+
function remoteModels(entry, localGeneratedAt) {
|
|
32
31
|
if (!entry)
|
|
33
32
|
return [];
|
|
34
|
-
if (
|
|
35
|
-
(entry.lastModified === undefined || entry.lastModified <= localLastModified)) {
|
|
33
|
+
if (localGeneratedAt !== undefined && (entry.lastModified === undefined || entry.lastModified <= localGeneratedAt)) {
|
|
36
34
|
return [];
|
|
37
35
|
}
|
|
38
36
|
return entry.models;
|
|
39
37
|
}
|
|
40
38
|
/** Add a persisted pi.dev catalog overlay to a static built-in provider. */
|
|
41
|
-
export function withRemoteCatalog(provider, catalogBaseUrl = DEFAULT_CATALOG_BASE_URL,
|
|
39
|
+
export function withRemoteCatalog(provider, catalogBaseUrl = DEFAULT_CATALOG_BASE_URL, localGeneratedAt) {
|
|
42
40
|
let dynamicModels = [];
|
|
43
41
|
let inflightRefresh;
|
|
44
42
|
return {
|
|
@@ -47,11 +45,8 @@ export function withRemoteCatalog(provider, catalogBaseUrl = DEFAULT_CATALOG_BAS
|
|
|
47
45
|
refreshModels: (context) => {
|
|
48
46
|
inflightRefresh ??= (async () => {
|
|
49
47
|
try {
|
|
50
|
-
const localLastModified = localCatalogUrl
|
|
51
|
-
? await stat(localCatalogUrl).then((value) => value.mtimeMs, () => undefined)
|
|
52
|
-
: undefined;
|
|
53
48
|
const stored = await context.store.read();
|
|
54
|
-
dynamicModels = remoteModels(stored,
|
|
49
|
+
dynamicModels = remoteModels(stored, localGeneratedAt).filter((model) => model.provider === provider.id);
|
|
55
50
|
if (!context.allowNetwork || context.signal?.aborted)
|
|
56
51
|
return;
|
|
57
52
|
if (!context.force &&
|
|
@@ -60,22 +55,39 @@ export function withRemoteCatalog(provider, catalogBaseUrl = DEFAULT_CATALOG_BAS
|
|
|
60
55
|
Date.now() - stored.checkedAt < REMOTE_CATALOG_REFRESH_INTERVAL_MS) {
|
|
61
56
|
return;
|
|
62
57
|
}
|
|
58
|
+
// Only revalidate when a cached body backs the validator, so a 304 can never
|
|
59
|
+
// leave the overlay empty.
|
|
60
|
+
const validator = stored?.models.length ? stored.etag : undefined;
|
|
63
61
|
const url = new URL(`/api/models/providers/${encodeURIComponent(provider.id)}`, catalogBaseUrl);
|
|
64
62
|
const response = await fetch(url, {
|
|
65
63
|
headers: {
|
|
66
64
|
accept: "application/json",
|
|
67
65
|
"User-Agent": getPiUserAgent(VERSION),
|
|
66
|
+
...(validator ? { "if-none-match": validator } : {}),
|
|
68
67
|
},
|
|
69
68
|
signal: context.signal,
|
|
70
69
|
});
|
|
71
70
|
if (context.signal?.aborted)
|
|
72
71
|
return;
|
|
73
72
|
const checkedAt = Date.now();
|
|
73
|
+
// Unchanged: dynamicModels already holds the stored overlay, so only the
|
|
74
|
+
// freshness window moves.
|
|
75
|
+
if (response.status === 304 && stored) {
|
|
76
|
+
await context.store.write({ ...stored, checkedAt });
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
74
79
|
if (response.status === 404 || response.status === 501) {
|
|
75
|
-
await context.store.write({
|
|
80
|
+
await context.store.write({
|
|
81
|
+
...(stored ?? { models: [] }),
|
|
82
|
+
checkedAt,
|
|
83
|
+
lastModified: 0,
|
|
84
|
+
etag: undefined,
|
|
85
|
+
});
|
|
76
86
|
return;
|
|
77
87
|
}
|
|
78
88
|
if (!response.ok) {
|
|
89
|
+
// Transient failure: the cached body and its validator stay valid, so keep the
|
|
90
|
+
// etag and let the next refresh revalidate instead of downloading the catalog.
|
|
79
91
|
await context.store.write({ ...(stored ?? { models: [] }), checkedAt });
|
|
80
92
|
throw new Error(`Model catalog request failed for ${provider.id}: ${response.status}`);
|
|
81
93
|
}
|
|
@@ -87,8 +99,9 @@ export function withRemoteCatalog(provider, catalogBaseUrl = DEFAULT_CATALOG_BAS
|
|
|
87
99
|
models: refreshed,
|
|
88
100
|
checkedAt,
|
|
89
101
|
lastModified: Number.isNaN(lastModified) ? 0 : lastModified,
|
|
102
|
+
etag: response.headers.get("etag") ?? undefined,
|
|
90
103
|
};
|
|
91
|
-
dynamicModels = remoteModels(entry,
|
|
104
|
+
dynamicModels = remoteModels(entry, localGeneratedAt);
|
|
92
105
|
await context.store.write(entry);
|
|
93
106
|
}
|
|
94
107
|
finally {
|
|
@@ -85,7 +85,7 @@ Sling documentation (read only when the user asks about sling itself, its SDK, e
|
|
|
85
85
|
- Additional docs: ${docsPath}
|
|
86
86
|
- Examples: ${examplesPath} (extensions, custom tools, SDK)
|
|
87
87
|
- When reading sling docs or examples, resolve docs/... under Additional docs and examples/... under Examples, not the current working directory
|
|
88
|
-
- When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), sling packages (docs/packages.md)
|
|
88
|
+
- When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), sling packages (docs/packages.md), environment variables (docs/environment-variables.md)
|
|
89
89
|
- When working on sling topics, read the docs and examples, and follow .md cross-references before implementing
|
|
90
90
|
- Always read sling .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`;
|
|
91
91
|
if (appendSection) {
|
|
@@ -111,8 +111,27 @@ export function createLocalBashOperations(options) {
|
|
|
111
111
|
},
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
-
function resolveSpawnContext(command, cwd, spawnHook) {
|
|
115
|
-
const
|
|
114
|
+
function resolveSpawnContext(command, cwd, spawnHook, exposeSessionEnvironment, ctx) {
|
|
115
|
+
const env = { ...getShellEnv() };
|
|
116
|
+
delete env.PI_SESSION_ID;
|
|
117
|
+
delete env.PI_SESSION_FILE;
|
|
118
|
+
delete env.PI_PROVIDER;
|
|
119
|
+
delete env.PI_MODEL;
|
|
120
|
+
delete env.PI_REASONING_LEVEL;
|
|
121
|
+
if (exposeSessionEnvironment && ctx) {
|
|
122
|
+
const model = ctx.model;
|
|
123
|
+
env.PI_SESSION_ID = ctx.sessionManager.getSessionId();
|
|
124
|
+
const sessionFile = ctx.sessionManager.getSessionFile();
|
|
125
|
+
if (sessionFile)
|
|
126
|
+
env.PI_SESSION_FILE = sessionFile;
|
|
127
|
+
if (model) {
|
|
128
|
+
env.PI_PROVIDER = model.provider;
|
|
129
|
+
env.PI_MODEL = model.id;
|
|
130
|
+
}
|
|
131
|
+
if (ctx.thinkingLevel)
|
|
132
|
+
env.PI_REASONING_LEVEL = ctx.thinkingLevel;
|
|
133
|
+
}
|
|
134
|
+
const baseContext = { command, cwd, env };
|
|
116
135
|
return spawnHook ? spawnHook(baseContext) : baseContext;
|
|
117
136
|
}
|
|
118
137
|
const BASH_PREVIEW_LINES = 5;
|
|
@@ -202,16 +221,20 @@ function rebuildBashResultRenderComponent(component, result, options, showImages
|
|
|
202
221
|
export function createBashToolDefinition(cwd, options) {
|
|
203
222
|
const ops = options?.operations ?? createLocalBashOperations({ shellPath: options?.shellPath });
|
|
204
223
|
const commandPrefix = options?.commandPrefix;
|
|
224
|
+
const exposeSessionEnvironment = options?.exposeSessionEnvironment ?? true;
|
|
205
225
|
const spawnHook = options?.spawnHook;
|
|
206
226
|
return {
|
|
207
227
|
name: "bash",
|
|
208
228
|
label: "bash",
|
|
209
229
|
description: `Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.`,
|
|
210
230
|
promptSnippet: "Execute bash commands (ls, grep, find, etc.)",
|
|
231
|
+
promptGuidelines: exposeSessionEnvironment
|
|
232
|
+
? ["Inspect PI_* environment variables for current model and session details."]
|
|
233
|
+
: undefined,
|
|
211
234
|
parameters: bashSchema,
|
|
212
|
-
async execute(_toolCallId, { command, timeout }, signal, onUpdate,
|
|
235
|
+
async execute(_toolCallId, { command, timeout }, signal, onUpdate, ctx) {
|
|
213
236
|
const resolvedCommand = commandPrefix ? `${commandPrefix}\n${command}` : command;
|
|
214
|
-
const spawnContext = resolveSpawnContext(resolvedCommand, cwd, spawnHook);
|
|
237
|
+
const spawnContext = resolveSpawnContext(resolvedCommand, cwd, spawnHook, exposeSessionEnvironment, ctx);
|
|
215
238
|
const output = new OutputAccumulator({ tempFilePrefix: "pi-bash" });
|
|
216
239
|
let acceptingOutput = true;
|
|
217
240
|
let updateTimer;
|
|
@@ -356,6 +379,12 @@ export function createBashToolDefinition(cwd, options) {
|
|
|
356
379
|
};
|
|
357
380
|
}
|
|
358
381
|
export function createBashTool(cwd, options) {
|
|
359
|
-
|
|
382
|
+
const definition = createBashToolDefinition(cwd, options);
|
|
383
|
+
const tool = wrapToolDefinition(definition);
|
|
384
|
+
Object.assign(tool, {
|
|
385
|
+
promptSnippet: definition.promptSnippet,
|
|
386
|
+
promptGuidelines: definition.promptGuidelines,
|
|
387
|
+
});
|
|
388
|
+
return tool;
|
|
360
389
|
}
|
|
361
390
|
//# sourceMappingURL=bash.js.map
|
package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/tool-definition-wrapper.js
CHANGED
|
@@ -5,9 +5,10 @@ export function wrapToolDefinition(definition, ctxFactory) {
|
|
|
5
5
|
label: definition.label,
|
|
6
6
|
description: definition.description,
|
|
7
7
|
parameters: definition.parameters,
|
|
8
|
+
constrainedSampling: definition.constrainedSampling,
|
|
8
9
|
prepareArguments: definition.prepareArguments,
|
|
9
10
|
executionMode: definition.executionMode,
|
|
10
|
-
execute: (toolCallId, params, signal, onUpdate) => definition.execute(toolCallId, params, signal, onUpdate, ctxFactory?.()),
|
|
11
|
+
execute: (toolCallId, params, signal, onUpdate, ctx) => definition.execute(toolCallId, params, signal, onUpdate, ctx ?? ctxFactory?.()),
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
/** Wrap multiple ToolDefinitions into AgentTools for the core runtime. */
|
|
@@ -26,6 +27,7 @@ export function createToolDefinitionFromAgentTool(tool) {
|
|
|
26
27
|
label: tool.label,
|
|
27
28
|
description: tool.description,
|
|
28
29
|
parameters: tool.parameters,
|
|
30
|
+
constrainedSampling: tool.constrainedSampling,
|
|
29
31
|
prepareArguments: tool.prepareArguments,
|
|
30
32
|
executionMode: tool.executionMode,
|
|
31
33
|
execute: async (toolCallId, params, signal, onUpdate) => tool.execute(toolCallId, params, signal, onUpdate),
|
|
@@ -2,7 +2,6 @@ import { stream, streamSimple } from "@earendil-works/pi-ai/compat";
|
|
|
2
2
|
import { LlamaClient, llamaInferenceUrl, normalizeLlamaServerUrl } from "./client.js";
|
|
3
3
|
export const LLAMA_PROVIDER_ID = "llama.cpp";
|
|
4
4
|
export const DEFAULT_LLAMA_SERVER_URL = "http://127.0.0.1:8080";
|
|
5
|
-
const DEFAULT_MAX_TOKENS = 16384;
|
|
6
5
|
function credentialServerUrl(credential) {
|
|
7
6
|
const value = credential?.env?.LLAMA_BASE_URL;
|
|
8
7
|
return typeof value === "string" && value.trim() ? normalizeLlamaServerUrl(value) : undefined;
|
|
@@ -24,7 +23,7 @@ function toPiModel(model, serverUrl) {
|
|
|
24
23
|
input: model.architecture?.input_modalities?.includes("image") ? ["text", "image"] : ["text"],
|
|
25
24
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
26
25
|
contextWindow,
|
|
27
|
-
maxTokens:
|
|
26
|
+
maxTokens: contextWindow,
|
|
28
27
|
compat: {
|
|
29
28
|
supportsStore: false,
|
|
30
29
|
supportsDeveloperRole: false,
|
|
@@ -86,6 +85,10 @@ export function createLlamaProvider() {
|
|
|
86
85
|
},
|
|
87
86
|
getModels: () => models,
|
|
88
87
|
refreshModels: async (context) => {
|
|
88
|
+
const stored = await context.store.read();
|
|
89
|
+
if (stored) {
|
|
90
|
+
models = stored.models.filter((model) => model.provider === LLAMA_PROVIDER_ID && model.api === "openai-completions");
|
|
91
|
+
}
|
|
89
92
|
if (!context.allowNetwork || context.signal?.aborted || context.credential?.type !== "api_key")
|
|
90
93
|
return;
|
|
91
94
|
const serverUrl = credentialServerUrl(context.credential);
|
|
@@ -93,6 +96,8 @@ export function createLlamaProvider() {
|
|
|
93
96
|
return;
|
|
94
97
|
const catalog = await new LlamaClient(serverUrl, context.credential.key).list({ signal: context.signal });
|
|
95
98
|
setCatalog(catalog, serverUrl);
|
|
99
|
+
if (!context.signal?.aborted)
|
|
100
|
+
await context.store.write({ models, checkedAt: Date.now() });
|
|
96
101
|
},
|
|
97
102
|
stream: (model, context, options) => stream(model, context, options),
|
|
98
103
|
streamSimple: (model, context, options) => streamSimple(model, context, options),
|
|
@@ -11,11 +11,13 @@ export class CustomMessageComponent extends Container {
|
|
|
11
11
|
customComponent;
|
|
12
12
|
markdownTheme;
|
|
13
13
|
_expanded = false;
|
|
14
|
-
|
|
14
|
+
outputPad;
|
|
15
|
+
constructor(message, customRenderer, markdownTheme = getMarkdownTheme(), outputPad = 1) {
|
|
15
16
|
super();
|
|
16
17
|
this.message = message;
|
|
17
18
|
this.customRenderer = customRenderer;
|
|
18
19
|
this.markdownTheme = markdownTheme;
|
|
20
|
+
this.outputPad = outputPad;
|
|
19
21
|
this.addChild(new Spacer(1));
|
|
20
22
|
// Create box with purple background (used for default rendering)
|
|
21
23
|
this.box = new Box(1, 1, (t) => theme.bg("customMessageBg", t));
|
|
@@ -27,6 +29,12 @@ export class CustomMessageComponent extends Container {
|
|
|
27
29
|
this.rebuild();
|
|
28
30
|
}
|
|
29
31
|
}
|
|
32
|
+
setOutputPad(outputPad) {
|
|
33
|
+
if (this.outputPad !== outputPad) {
|
|
34
|
+
this.outputPad = outputPad;
|
|
35
|
+
this.rebuild();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
30
38
|
invalidate() {
|
|
31
39
|
super.invalidate();
|
|
32
40
|
this.rebuild();
|
|
@@ -41,7 +49,7 @@ export class CustomMessageComponent extends Container {
|
|
|
41
49
|
// Try custom renderer first - it handles its own styling
|
|
42
50
|
if (this.customRenderer) {
|
|
43
51
|
try {
|
|
44
|
-
const component = this.customRenderer(this.message, { expanded: this._expanded }, theme);
|
|
52
|
+
const component = this.customRenderer(this.message, { expanded: this._expanded, outputPad: this.outputPad }, theme);
|
|
45
53
|
if (component) {
|
|
46
54
|
// Custom renderer provides its own styled component
|
|
47
55
|
this.customComponent = component;
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
* Multi-line editor component for extensions.
|
|
3
3
|
* Supports Ctrl+G for external editor.
|
|
4
4
|
*/
|
|
5
|
-
import { spawn } from "node:child_process";
|
|
6
|
-
import * as fs from "node:fs";
|
|
7
|
-
import * as os from "node:os";
|
|
8
|
-
import * as path from "node:path";
|
|
9
5
|
import { Container, Editor, getKeybindings, Spacer, Text, } from "@earendil-works/pi-tui";
|
|
6
|
+
import { editInExternalEditor } from "../external-editor.js";
|
|
10
7
|
import { getEditorTheme, theme } from "../theme/theme.js";
|
|
11
8
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
12
9
|
import { keyHint } from "./keybinding-hints.js";
|
|
@@ -29,7 +26,11 @@ export class ExtensionEditorComponent extends Container {
|
|
|
29
26
|
super();
|
|
30
27
|
this.tui = tui;
|
|
31
28
|
this.keybindings = keybindings;
|
|
32
|
-
this.externalEditorCommand =
|
|
29
|
+
this.externalEditorCommand =
|
|
30
|
+
externalEditorCommand ||
|
|
31
|
+
process.env.VISUAL ||
|
|
32
|
+
process.env.EDITOR ||
|
|
33
|
+
(process.platform === "win32" ? "notepad" : "nano");
|
|
33
34
|
this.onSubmitCallback = onSubmit;
|
|
34
35
|
this.onCancelCallback = onCancel;
|
|
35
36
|
// Add top border
|
|
@@ -50,13 +51,12 @@ export class ExtensionEditorComponent extends Container {
|
|
|
50
51
|
this.addChild(this.editor);
|
|
51
52
|
this.addChild(new Spacer(1));
|
|
52
53
|
// Add hint
|
|
53
|
-
const hasExternalEditor = !!this.getExternalEditorCommand();
|
|
54
54
|
const hint = keyHint("tui.select.confirm", "submit") +
|
|
55
55
|
" " +
|
|
56
56
|
keyHint("tui.input.newLine", "newline") +
|
|
57
57
|
" " +
|
|
58
58
|
keyHint("tui.select.cancel", "cancel") +
|
|
59
|
-
|
|
59
|
+
` ${keyHint("app.editor.external", "external editor")}`;
|
|
60
60
|
this.addChild(new Text(hint, 1, 0));
|
|
61
61
|
this.addChild(new Spacer(1));
|
|
62
62
|
// Add bottom border
|
|
@@ -71,56 +71,26 @@ export class ExtensionEditorComponent extends Container {
|
|
|
71
71
|
}
|
|
72
72
|
// External editor (app keybinding)
|
|
73
73
|
if (this.keybindings.matches(keyData, "app.editor.external")) {
|
|
74
|
-
this.
|
|
74
|
+
void this.handleOpenExternalEditor();
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
// Forward to editor
|
|
78
78
|
this.editor.handleInput(keyData);
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
return editorCmd;
|
|
84
|
-
}
|
|
85
|
-
return process.platform === "win32" ? "notepad" : "nano";
|
|
86
|
-
}
|
|
87
|
-
async openExternalEditor() {
|
|
88
|
-
const editorCmd = this.getExternalEditorCommand();
|
|
89
|
-
if (!editorCmd) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
const currentText = this.editor.getText();
|
|
93
|
-
const tmpFile = path.join(os.tmpdir(), `pi-extension-editor-${Date.now()}.md`);
|
|
80
|
+
async handleOpenExternalEditor() {
|
|
81
|
+
const content = this.editor.getText();
|
|
82
|
+
this.tui.stop();
|
|
94
83
|
try {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
process.stdout.write(`Launching external editor: ${editorCmd}\nPi will resume when the editor exits.\n`);
|
|
99
|
-
// Do not use spawnSync here. On Windows, synchronous child_process calls can keep
|
|
100
|
-
// Node/libuv's console input read active after tui.stop() pauses stdin, racing
|
|
101
|
-
// vim/nvim for the console input buffer until Ctrl+C cancels the pending read.
|
|
102
|
-
const status = await new Promise((resolve) => {
|
|
103
|
-
const child = spawn(editor, [...editorArgs, tmpFile], {
|
|
104
|
-
stdio: "inherit",
|
|
105
|
-
shell: process.platform === "win32",
|
|
106
|
-
});
|
|
107
|
-
child.on("error", () => resolve(null));
|
|
108
|
-
child.on("close", (code) => resolve(code));
|
|
84
|
+
const result = await editInExternalEditor({
|
|
85
|
+
command: this.externalEditorCommand,
|
|
86
|
+
content,
|
|
109
87
|
});
|
|
110
|
-
if (status ===
|
|
111
|
-
|
|
112
|
-
this.editor.setText(newContent);
|
|
88
|
+
if (result.status === "complete") {
|
|
89
|
+
this.editor.setText(result.content);
|
|
113
90
|
}
|
|
114
91
|
}
|
|
115
92
|
finally {
|
|
116
|
-
try {
|
|
117
|
-
fs.unlinkSync(tmpFile);
|
|
118
|
-
}
|
|
119
|
-
catch {
|
|
120
|
-
// Ignore cleanup errors
|
|
121
|
-
}
|
|
122
93
|
this.tui.start();
|
|
123
|
-
// Force full re-render since external editor uses alternate screen
|
|
124
94
|
this.tui.requestRender(true);
|
|
125
95
|
}
|
|
126
96
|
}
|
|
@@ -23,7 +23,7 @@ function enableAll(enabledIds, allIds, targetIds) {
|
|
|
23
23
|
if (!result.includes(id))
|
|
24
24
|
result.push(id);
|
|
25
25
|
}
|
|
26
|
-
return result.length === allIds.length ? null : result;
|
|
26
|
+
return result.length === allIds.length && result.every((id) => allIds.includes(id)) ? null : result;
|
|
27
27
|
}
|
|
28
28
|
function clearAll(enabledIds, allIds, targetIds) {
|
|
29
29
|
if (enabledIds === null) {
|
|
@@ -108,19 +108,19 @@ export class ScopedModelsSelectorComponent extends Container {
|
|
|
108
108
|
this.updateList();
|
|
109
109
|
}
|
|
110
110
|
buildItems() {
|
|
111
|
-
|
|
112
|
-
return getSortedIds(this.enabledIds, this.allIds)
|
|
113
|
-
.filter((id) => this.modelsById.has(id))
|
|
114
|
-
.map((id) => ({
|
|
111
|
+
return getSortedIds(this.enabledIds, this.allIds).map((id) => ({
|
|
115
112
|
fullId: id,
|
|
116
113
|
model: this.modelsById.get(id),
|
|
117
114
|
enabled: isEnabled(this.enabledIds, id),
|
|
118
115
|
}));
|
|
119
116
|
}
|
|
120
117
|
getFooterText() {
|
|
121
|
-
const enabledCount = this.enabledIds?.length ?? this.allIds.length;
|
|
118
|
+
const enabledCount = this.enabledIds?.filter((id) => this.modelsById.has(id)).length ?? this.allIds.length;
|
|
119
|
+
const unavailableCount = this.enabledIds?.filter((id) => !this.modelsById.has(id)).length ?? 0;
|
|
122
120
|
const allEnabled = this.enabledIds === null;
|
|
123
|
-
const countText = allEnabled
|
|
121
|
+
const countText = allEnabled
|
|
122
|
+
? "all enabled"
|
|
123
|
+
: `${enabledCount}/${this.allIds.length} enabled${unavailableCount ? ` · ${unavailableCount} unavailable` : ""}`;
|
|
124
124
|
const parts = [
|
|
125
125
|
`${keyText("tui.select.confirm")} toggle`,
|
|
126
126
|
`${keyText("app.models.enableAll")} all`,
|
|
@@ -138,7 +138,9 @@ export class ScopedModelsSelectorComponent extends Container {
|
|
|
138
138
|
const query = this.searchInput.getValue();
|
|
139
139
|
const items = this.buildItems();
|
|
140
140
|
this.filteredItems = query
|
|
141
|
-
? fuzzyFilter(items, query, (
|
|
141
|
+
? fuzzyFilter(items, query, (item) => item.model
|
|
142
|
+
? getModelSearchText({ id: item.model.id, provider: item.model.provider, name: item.model.name })
|
|
143
|
+
: item.fullId)
|
|
142
144
|
: items;
|
|
143
145
|
this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredItems.length - 1));
|
|
144
146
|
this.updateList();
|
|
@@ -160,9 +162,16 @@ export class ScopedModelsSelectorComponent extends Container {
|
|
|
160
162
|
const item = this.filteredItems[i];
|
|
161
163
|
const isSelected = i === this.selectedIndex;
|
|
162
164
|
const prefix = isSelected ? theme.fg("accent", "→ ") : " ";
|
|
163
|
-
const
|
|
164
|
-
const
|
|
165
|
-
const
|
|
165
|
+
const id = item.model?.id ?? item.fullId;
|
|
166
|
+
const modelText = isSelected ? theme.fg("accent", id) : id;
|
|
167
|
+
const providerBadge = theme.fg("muted", item.model ? ` [${item.model.provider}]` : " [unavailable]");
|
|
168
|
+
const status = item.model
|
|
169
|
+
? allEnabled
|
|
170
|
+
? ""
|
|
171
|
+
: item.enabled
|
|
172
|
+
? theme.fg("success", " ✓")
|
|
173
|
+
: theme.fg("dim", " ✗")
|
|
174
|
+
: theme.fg("dim", " ✗");
|
|
166
175
|
this.listContainer.addChild(new Text(`${prefix}${modelText}${providerBadge}${status}`, 0, 0));
|
|
167
176
|
}
|
|
168
177
|
// Add scroll indicator if needed
|
|
@@ -172,7 +181,7 @@ export class ScopedModelsSelectorComponent extends Container {
|
|
|
172
181
|
if (this.filteredItems.length > 0) {
|
|
173
182
|
const selected = this.filteredItems[this.selectedIndex];
|
|
174
183
|
this.listContainer.addChild(new Spacer(1));
|
|
175
|
-
this.listContainer.addChild(new Text(theme.fg("muted", ` Model Name: ${selected.model.name}`), 0, 0));
|
|
184
|
+
this.listContainer.addChild(new Text(theme.fg("muted", ` ${selected.model ? `Model Name: ${selected.model.name}` : "Model unavailable"}`), 0, 0));
|
|
176
185
|
}
|
|
177
186
|
}
|
|
178
187
|
handleInput(data) {
|
|
@@ -246,7 +255,7 @@ export class ScopedModelsSelectorComponent extends Container {
|
|
|
246
255
|
// Toggle provider of current item
|
|
247
256
|
if (kb.matches(data, "app.models.toggleProvider")) {
|
|
248
257
|
const item = this.filteredItems[this.selectedIndex];
|
|
249
|
-
if (item) {
|
|
258
|
+
if (item?.model) {
|
|
250
259
|
const provider = item.model.provider;
|
|
251
260
|
const providerIds = this.allIds.filter((id) => this.modelsById.get(id).provider === provider);
|
|
252
261
|
const allEnabled = providerIds.every((id) => isEnabled(this.enabledIds, id));
|