@psnext/slingcli 2.5.20260727-1 → 2.5.20260731-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 +163 -0
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +856 -57
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +8 -5
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonSettings.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonCodec.js → codec-v1/JsonCodec.js} +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonShapeDeserializer.js → codec-v1/JsonShapeDeserializer.js} +6 -6
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonShapeSerializer.js → codec-v1/JsonShapeSerializer.js} +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +103 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +20 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{experimental/BufferJsonShapeDeserializer.js → codec-v2/JsonShapeDeserializer2.js} +38 -18
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{experimental/ByteJsonShapeSerializer.js → codec-v2/JsonShapeSerializer2.js} +66 -60
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +9 -6
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonCodec.d.ts → codec-v1/JsonCodec.d.ts} +4 -8
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonShapeDeserializer.d.ts → codec-v1/JsonShapeDeserializer.d.ts} +3 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonShapeSerializer.d.ts → codec-v1/JsonShapeSerializer.d.ts} +3 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +51 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{experimental/BufferJsonShapeDeserializer.d.ts → codec-v2/JsonShapeDeserializer2.d.ts} +4 -3
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{experimental/ByteJsonShapeSerializer.d.ts → codec-v2/JsonShapeSerializer2.d.ts} +19 -16
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/api-extractor-type-index.d.ts +4 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +61 -21
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +13 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConstants.d.ts +4 -16
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +5 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/index.d.ts +16 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/emitWarningIfUnsupportedVersion.d.ts +4 -11
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +107 -47
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +112 -39
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +107 -48
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/longPollMiddleware.d.ts +13 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts +25 -35
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-logger/loggerMiddleware.d.ts +14 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/configuration.d.ts +2 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts +2 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +2 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.browser.d.ts +2 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.d.ts +2 -10
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.native.d.ts +2 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/check-features.d.ts +16 -20
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/configurations.d.ts +21 -44
- 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 +2 -5
- 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 +8 -11
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/extensions.d.ts +14 -16
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.browser.d.ts +1 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.d.ts +7 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.native.d.ts +1 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setCredentialFeature.d.ts +6 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setFeature.d.ts +6 -12
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setTokenFeature.d.ts +6 -7
- 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 +4 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/parseArn.d.ts +2 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partition.d.ts +28 -38
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +647 -638
- 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 +29 -56
- 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 +6 -1
- 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 +12 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/configurations.d.ts +4 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.d.ts +7 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +7 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +18 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +13 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/crt-availability.d.ts +3 -8
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +17 -28
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.d.ts +2 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/is-crt-available.d.ts +2 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.d.ts +4 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +9 -10
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +39 -44
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.d.ts +2 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +1 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +1 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +4 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/index.d.ts +23 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +13 -38
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +57 -133
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.browser.d.ts +32 -11
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.d.ts +32 -9
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.d.ts +1 -8
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.d.ts +1 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +2 -8
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.d.ts +1 -8
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +6 -26
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/index.d.ts +4 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/isClockSkewed.d.ts +1 -9
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +5 -8
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ProtocolLib.d.ts +40 -74
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +9 -24
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.d.ts +36 -25
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/coercing-serializers.d.ts +3 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/common.d.ts +5 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +30 -22
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +21 -22
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +21 -22
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +49 -29
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +49 -36
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/awsExpectUnion.d.ts +1 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +11 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +18 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +27 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +9 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +15 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +39 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +7 -21
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +7 -15
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +2 -11
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +14 -22
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +18 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsQueryProtocol.d.ts +57 -49
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QuerySerializerSettings.d.ts +7 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QueryShapeSerializer.d.ts +21 -16
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +1 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +47 -31
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlCodec.d.ts +17 -14
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeDeserializer.d.ts +15 -20
- 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 +4 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/simpleFormatXml.d.ts +1 -6
- 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 +14 -32
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-format-url/format-url.d.ts +4 -2
- package/node_modules/@aws-sdk/core/package.json +3 -3
- 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/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/@earendil-works/pi-coding-agent/docs/compaction.md +14 -9
- package/node_modules/@earendil-works/pi-coding-agent/docs/containerization.md +16 -16
- package/node_modules/@earendil-works/pi-coding-agent/docs/custom-provider.md +12 -9
- package/node_modules/@earendil-works/pi-coding-agent/docs/docs.json +1 -5
- package/node_modules/@earendil-works/pi-coding-agent/docs/environment-variables.md +88 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +54 -36
- package/node_modules/@earendil-works/pi-coding-agent/docs/index.md +9 -6
- package/node_modules/@earendil-works/pi-coding-agent/docs/json.md +5 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/llama-cpp.md +7 -7
- package/node_modules/@earendil-works/pi-coding-agent/docs/mcp.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +13 -9
- package/node_modules/@earendil-works/pi-coding-agent/docs/packages.md +13 -13
- package/node_modules/@earendil-works/pi-coding-agent/docs/prompt-templates.md +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/quickstart.md +22 -22
- package/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +106 -10
- package/node_modules/@earendil-works/pi-coding-agent/docs/sdk.md +1186 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/security.md +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/session-format.md +18 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/sessions.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +8 -8
- package/node_modules/@earendil-works/pi-coding-agent/docs/shell-aliases.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/skills.md +6 -6
- package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/termux.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/themes.md +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/tmux.md +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/usage.md +12 -25
- package/node_modules/@earendil-works/pi-coding-agent/docs/windows.md +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1561 -337
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +4 -205
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +113 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +103 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +621 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +602 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/index.js +5 -1
- package/node_modules/@smithy/core/dist-types/submodules/cbor/CborCodec.d.ts +5 -27
- package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +35 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/index.d.ts +5 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +5 -27
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +35 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/index.d.ts +5 -1
- package/node_modules/@smithy/core/package.json +2 -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/@types/node/README.md +1 -1
- package/node_modules/@types/node/crypto.d.ts +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/brace-expansion/README.md +1 -2
- package/node_modules/brace-expansion/dist/commonjs/index.js +30 -4
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js +30 -4
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
- package/node_modules/brace-expansion/package.json +1 -1
- package/package.json +2 -2
- package/slingshot/index.js +203 -205
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonCodec.d.ts +0 -19
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeDeserializer.d.ts +0 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +0 -28
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +0 -29
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +0 -57
- package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +0 -297
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Environment Variables
|
|
2
|
+
|
|
3
|
+
Pi uses environment variables in three ways:
|
|
4
|
+
|
|
5
|
+
- Variables such as `PI_OFFLINE` configure the Pi process.
|
|
6
|
+
- Pi sets `PI_CODING_AGENT` so child processes can detect that they run inside Pi.
|
|
7
|
+
- Commands run by the LLM-callable bash tool receive `PI_*` variables describing the current session.
|
|
8
|
+
|
|
9
|
+
Provider API-key variables are documented separately in [Providers](providers.md#environment-variables-or-auth-file).
|
|
10
|
+
|
|
11
|
+
## Process Marker
|
|
12
|
+
|
|
13
|
+
The CLI and RPC entry points set `PI_CODING_AGENT=true`. Child processes inherit it and can use it to detect that they run inside Pi. It is not session-specific and is not set automatically when Pi is embedded through the SDK.
|
|
14
|
+
|
|
15
|
+
## Bash Tool Session Environment
|
|
16
|
+
|
|
17
|
+
Commands run by the bash tool receive the current Pi session state:
|
|
18
|
+
|
|
19
|
+
| Variable | Description |
|
|
20
|
+
|----------|-------------|
|
|
21
|
+
| `PI_SESSION_ID` | Current session ID |
|
|
22
|
+
| `PI_SESSION_FILE` | Absolute path to the current session JSONL file; unset for ephemeral sessions |
|
|
23
|
+
| `PI_PROVIDER` | Currently selected model provider |
|
|
24
|
+
| `PI_MODEL` | Currently selected model ID |
|
|
25
|
+
| `PI_REASONING_LEVEL` | Current effective reasoning level: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max` |
|
|
26
|
+
|
|
27
|
+
The values are resolved when each command starts. Switching models or changing the reasoning level therefore affects the next bash command without restarting Pi. `PI_PROVIDER` and `PI_MODEL` identify the selected Pi model, not a different upstream model that a router may choose internally.
|
|
28
|
+
|
|
29
|
+
When asked which model or provider is running, inspect these variables instead of inferring the answer from the system prompt:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
printf '%s/%s\n' "$PI_PROVIDER" "$PI_MODEL"
|
|
33
|
+
printf 'reasoning=%s session=%s\n' "$PI_REASONING_LEVEL" "$PI_SESSION_ID"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The session file can be inspected directly when the session is persistent:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
if [ -n "$PI_SESSION_FILE" ]; then
|
|
40
|
+
tail -n 1 "$PI_SESSION_FILE"
|
|
41
|
+
fi
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
These variables are injected into the LLM-callable bash tool. They are not injected into user-entered `!` or `!!` commands.
|
|
45
|
+
|
|
46
|
+
### Custom Bash Tools
|
|
47
|
+
|
|
48
|
+
Bash tools created with `createBashTool()` expose the session environment by default when registered with Pi. Injection happens before `spawnHook`, so a hook receives the variables in `ctx.env`:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
const bashTool = createBashTool(cwd, {
|
|
52
|
+
spawnHook: (ctx) => ({
|
|
53
|
+
...ctx,
|
|
54
|
+
env: { ...ctx.env, CI: "1" },
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Disable session metadata independently of the spawn hook:
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
const bashTool = createBashTool(cwd, {
|
|
63
|
+
exposeSessionEnvironment: false,
|
|
64
|
+
spawnHook: (ctx) => ctx,
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
When disabled, Pi removes inherited values for these variables so nested Pi processes do not expose stale parent-session metadata.
|
|
69
|
+
|
|
70
|
+
## Pi Process Configuration
|
|
71
|
+
|
|
72
|
+
These variables are read by Pi itself:
|
|
73
|
+
|
|
74
|
+
| Variable | Description |
|
|
75
|
+
|----------|-------------|
|
|
76
|
+
| `PI_CODING_AGENT_DIR` | Override the config directory; default is `~/.pi/agent` |
|
|
77
|
+
| `PI_CODING_AGENT_SESSION_DIR` | Override session storage; overridden by `--session-dir` |
|
|
78
|
+
| `PI_PACKAGE_DIR` | Override the package directory, useful for Nix/Guix store paths |
|
|
79
|
+
| `PI_OFFLINE` | Disable startup network operations, including update checks, package updates, and install/update telemetry |
|
|
80
|
+
| `PI_SKIP_VERSION_CHECK` | Disable the `pi.dev` latest-version request |
|
|
81
|
+
| `PI_TELEMETRY` | Override install/update telemetry and provider attribution headers: `1`/`true`/`yes` or `0`/`false`/`no` |
|
|
82
|
+
| `PI_CACHE_RETENTION` | Set to `long` for extended provider prompt caching where supported |
|
|
83
|
+
| `PI_SHARE_VIEWER_URL` | Override the base URL used by `/share` |
|
|
84
|
+
| `PI_HARDWARE_CURSOR` | Set to `1` to show the hardware cursor; see [Terminal setup](terminal-setup.md) |
|
|
85
|
+
| `VISUAL`, `EDITOR` | External editor fallback when `externalEditor` is unset |
|
|
86
|
+
| `HTTP_PROXY`, `HTTPS_PROXY` | Proxy outbound HTTP requests |
|
|
87
|
+
|
|
88
|
+
Provider credentials such as `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and cloud-provider configuration are listed in [Providers](providers.md#environment-variables-or-auth-file).
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Extensions
|
|
4
4
|
|
|
5
|
-
Extensions are TypeScript modules that extend
|
|
5
|
+
Extensions are TypeScript modules that extend sling's behavior. They can subscribe to lifecycle events, register custom tools callable by the LLM, add commands, and more.
|
|
6
6
|
|
|
7
|
-
> **Placement for /reload:** Put extensions in `~/.sling/agent/extensions/` (global) or `.sling/extensions/` (project-local) for auto-discovery. Use `
|
|
7
|
+
> **Placement for /reload:** Put extensions in `~/.sling/agent/extensions/` (global) or `.sling/extensions/` (project-local) for auto-discovery. Use `sling -e ./path.ts` only for quick tests. Extensions in auto-discovered locations can be hot-reloaded with `/reload`.
|
|
8
8
|
|
|
9
9
|
**Key capabilities:**
|
|
10
10
|
- **Custom tools** - Register tools the LLM can call via `pi.registerTool()`
|
|
@@ -103,7 +103,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
103
103
|
Test with `--extension` (or `-e`) flag:
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
|
|
106
|
+
sling -e ./my-extension.ts
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
## Extension Locations
|
|
@@ -134,7 +134,7 @@ Additional paths via `settings.json`:
|
|
|
134
134
|
}
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
To share extensions via npm or git as
|
|
137
|
+
To share extensions via npm or git as sling packages, see [packages.md](packages.md).
|
|
138
138
|
|
|
139
139
|
## Available Imports
|
|
140
140
|
|
|
@@ -147,7 +147,7 @@ To share extensions via npm or git as pi packages, see [packages.md](packages.md
|
|
|
147
147
|
|
|
148
148
|
npm dependencies work too. Add a `package.json` next to your extension (or in a parent directory), run `npm install`, and imports from `node_modules/` are resolved automatically.
|
|
149
149
|
|
|
150
|
-
For distributed
|
|
150
|
+
For distributed sling packages installed with `sling install` (npm or git), runtime deps must be in `dependencies`. Package installation uses production installs (`npm install --omit=dev`) by default, so `devDependencies` are not available at runtime; when `npmCommand` is configured, git packages use plain `install` for compatibility with wrappers.
|
|
151
151
|
|
|
152
152
|
Node.js built-ins (`node:fs`, `node:path`, etc.) are also available.
|
|
153
153
|
|
|
@@ -178,7 +178,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
178
178
|
|
|
179
179
|
Extensions are loaded via [jiti](https://github.com/unjs/jiti), so TypeScript works without compilation.
|
|
180
180
|
|
|
181
|
-
If the factory returns a `Promise`,
|
|
181
|
+
If the factory returns a `Promise`, sling awaits it before continuing startup. That means async initialization completes before `session_start`, before `resources_discover`, and before provider registrations queued via `sling.registerProvider()` are flushed.
|
|
182
182
|
|
|
183
183
|
### Async factory functions
|
|
184
184
|
|
|
@@ -215,7 +215,7 @@ export default async function (pi: ExtensionAPI) {
|
|
|
215
215
|
}
|
|
216
216
|
```
|
|
217
217
|
|
|
218
|
-
This pattern makes the fetched models available during normal startup and to `
|
|
218
|
+
This pattern makes the fetched models available during normal startup and to `sling --list-models`.
|
|
219
219
|
|
|
220
220
|
### Long-lived resources and shutdown
|
|
221
221
|
|
|
@@ -275,7 +275,7 @@ Run `npm install` in the extension directory, then imports from `node_modules/`
|
|
|
275
275
|
### Lifecycle Overview
|
|
276
276
|
|
|
277
277
|
```
|
|
278
|
-
|
|
278
|
+
sling starts
|
|
279
279
|
│
|
|
280
280
|
├─► project_trust (user/global and CLI extensions only, before project resources load)
|
|
281
281
|
├─► session_start { reason: "startup" }
|
|
@@ -351,7 +351,7 @@ exit (Ctrl+C, Ctrl+D, SIGHUP, SIGTERM)
|
|
|
351
351
|
|
|
352
352
|
#### project_trust
|
|
353
353
|
|
|
354
|
-
Fired before
|
|
354
|
+
Fired before sling decides whether to trust a project with dynamic configs (`.sling` or `.agents/skills`). It runs during startup and when session replacement (for example `/resume`) enters a cwd whose trust has not been resolved in the current process. Only user/global extensions and CLI `-e` extensions participate; project-local extensions are not loaded until after trust is resolved.
|
|
355
355
|
|
|
356
356
|
```typescript
|
|
357
357
|
pi.on("project_trust", async (event, ctx) => {
|
|
@@ -364,7 +364,7 @@ pi.on("project_trust", async (event, ctx) => {
|
|
|
364
364
|
});
|
|
365
365
|
```
|
|
366
366
|
|
|
367
|
-
A `project_trust` handler must return `{ trusted: "yes" | "no" | "undecided" }`. A user/global or CLI extension that returns `"yes"` or `"no"` owns the decision; the first yes/no decision wins and suppresses the built-in trust prompt. Use `remember: true` to persist a yes/no decision; otherwise it applies only to the current process. Return `"undecided"` to let later handlers or the built-in trust flow decide. Check `ctx.hasUI` before prompting. If no handler returns yes/no, normal trust resolution continues: saved `trust.json` decisions apply first, then `defaultProjectTrust` controls whether
|
|
367
|
+
A `project_trust` handler must return `{ trusted: "yes" | "no" | "undecided" }`. A user/global or CLI extension that returns `"yes"` or `"no"` owns the decision; the first yes/no decision wins and suppresses the built-in trust prompt. Use `remember: true` to persist a yes/no decision; otherwise it applies only to the current process. Return `"undecided"` to let later handlers or the built-in trust flow decide. Check `ctx.hasUI` before prompting. If no handler returns yes/no, normal trust resolution continues: saved `trust.json` decisions apply first, then `defaultProjectTrust` controls whether sling asks, trusts, or declines by default.
|
|
368
368
|
|
|
369
369
|
### Resource Events
|
|
370
370
|
|
|
@@ -428,7 +428,7 @@ pi.on("session_before_switch", async (event, ctx) => {
|
|
|
428
428
|
});
|
|
429
429
|
```
|
|
430
430
|
|
|
431
|
-
After a successful switch or new-session action,
|
|
431
|
+
After a successful switch or new-session action, sling emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "new" | "resume"` and `previousSessionFile`.
|
|
432
432
|
Do cleanup work in `session_shutdown`, then reestablish any in-memory state in `session_start`.
|
|
433
433
|
|
|
434
434
|
#### session_before_fork
|
|
@@ -445,7 +445,7 @@ pi.on("session_before_fork", async (event, ctx) => {
|
|
|
445
445
|
});
|
|
446
446
|
```
|
|
447
447
|
|
|
448
|
-
After a successful fork or clone,
|
|
448
|
+
After a successful fork or clone, sling emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "fork"` and `previousSessionFile`.
|
|
449
449
|
Do cleanup work in `session_shutdown`, then reestablish any in-memory state in `session_start`.
|
|
450
450
|
|
|
451
451
|
#### session_before_compact / session_compact
|
|
@@ -468,6 +468,7 @@ pi.on("session_before_compact", async (event, ctx) => {
|
|
|
468
468
|
summary: "...",
|
|
469
469
|
firstKeptEntryId: preparation.firstKeptEntryId,
|
|
470
470
|
tokensBefore: preparation.tokensBefore,
|
|
471
|
+
// usage: summaryResponse.usage, // Optional; included in session totals
|
|
471
472
|
}
|
|
472
473
|
};
|
|
473
474
|
});
|
|
@@ -489,7 +490,13 @@ pi.on("session_before_tree", async (event, ctx) => {
|
|
|
489
490
|
const { preparation, signal } = event;
|
|
490
491
|
return { cancel: true };
|
|
491
492
|
// OR provide custom summary:
|
|
492
|
-
return {
|
|
493
|
+
return {
|
|
494
|
+
summary: {
|
|
495
|
+
summary: "...",
|
|
496
|
+
// usage: summaryResponse.usage, // Optional; included in session totals
|
|
497
|
+
details: {},
|
|
498
|
+
},
|
|
499
|
+
};
|
|
493
500
|
});
|
|
494
501
|
|
|
495
502
|
pi.on("session_tree", async (event, ctx) => {
|
|
@@ -661,7 +668,7 @@ pi.on("before_provider_headers", (event, ctx) => {
|
|
|
661
668
|
// Add or override — e.g. a session id for gateway tracing/attribution
|
|
662
669
|
event.headers["x-session-id"] = ctx.sessionManager.getSessionId();
|
|
663
670
|
|
|
664
|
-
// Drop a tracking header
|
|
671
|
+
// Drop a tracking header sling adds for this call
|
|
665
672
|
event.headers["X-OpenRouter-Title"] = null;
|
|
666
673
|
});
|
|
667
674
|
```
|
|
@@ -745,7 +752,7 @@ Use this to update extension UI when `pi.setThinkingLevel()`, model changes, or
|
|
|
745
752
|
|
|
746
753
|
Fired after `tool_execution_start`, before the tool executes. **Can block.** Use `isToolCallEventType` to narrow and get typed inputs.
|
|
747
754
|
|
|
748
|
-
Before `tool_call` runs,
|
|
755
|
+
Before `tool_call` runs, sling waits for previously emitted Agent events to finish draining through `AgentSession`. This means `ctx.sessionManager` is up to date through the current assistant tool-calling message.
|
|
749
756
|
|
|
750
757
|
In the default parallel tool execution mode, sibling tool calls from the same assistant message are preflighted sequentially, then executed concurrently. `tool_call` is not guaranteed to see sibling tool results from that same assistant message in `ctx.sessionManager`.
|
|
751
758
|
|
|
@@ -813,7 +820,7 @@ In parallel tool mode, `tool_result` and `tool_execution_end` may interleave in
|
|
|
813
820
|
`tool_result` handlers chain like middleware:
|
|
814
821
|
- Handlers run in extension load order
|
|
815
822
|
- Each handler sees the latest result after previous handler changes
|
|
816
|
-
- Handlers can return partial patches (`content`, `details`, or `
|
|
823
|
+
- Handlers can return partial patches (`content`, `details`, `isError`, or `usage`); omitted fields keep their current values
|
|
817
824
|
|
|
818
825
|
Use `ctx.signal` for nested async work inside the handler. This lets Esc cancel model calls, `fetch()`, and other abort-aware operations started by the extension.
|
|
819
826
|
|
|
@@ -822,7 +829,7 @@ import { isBashToolResult } from "@earendil-works/pi-coding-agent";
|
|
|
822
829
|
|
|
823
830
|
pi.on("tool_result", async (event, ctx) => {
|
|
824
831
|
// event.toolName, event.toolCallId, event.input
|
|
825
|
-
// event.content, event.details, event.isError
|
|
832
|
+
// event.content, event.details, event.isError, event.usage
|
|
826
833
|
|
|
827
834
|
if (isBashToolResult(event)) {
|
|
828
835
|
// event.details is typed as BashToolDetails
|
|
@@ -835,7 +842,7 @@ pi.on("tool_result", async (event, ctx) => {
|
|
|
835
842
|
});
|
|
836
843
|
|
|
837
844
|
// Modify result:
|
|
838
|
-
return { content: [...], details: {...}, isError: false };
|
|
845
|
+
return { content: [...], details: {...}, isError: false, usage: nestedModelUsage };
|
|
839
846
|
});
|
|
840
847
|
```
|
|
841
848
|
|
|
@@ -856,7 +863,7 @@ pi.on("user_bash", (event, ctx) => {
|
|
|
856
863
|
// Option 1: Provide custom operations (e.g., SSH)
|
|
857
864
|
return { operations: remoteBashOps };
|
|
858
865
|
|
|
859
|
-
// Option 2: Wrap
|
|
866
|
+
// Option 2: Wrap sling's built-in local bash backend
|
|
860
867
|
const local = createLocalBashOperations();
|
|
861
868
|
return {
|
|
862
869
|
operations: {
|
|
@@ -975,9 +982,9 @@ ctx.sessionManager.buildContextEntries() // Active branch entries with compac
|
|
|
975
982
|
ctx.sessionManager.getLeafId() // Current leaf entry ID
|
|
976
983
|
```
|
|
977
984
|
|
|
978
|
-
### ctx.modelRegistry / ctx.model
|
|
985
|
+
### ctx.modelRegistry / ctx.model / ctx.thinkingLevel
|
|
979
986
|
|
|
980
|
-
Access to models, providers, and resolved authentication. `ctx.modelRegistry.getProvider(id)` returns the effective pi-ai provider, while `getProviderAuth(id)` resolves its current API key, headers, base URL, and provider-scoped environment without requiring a loaded model. `ctx.model` is the active model.
|
|
987
|
+
Access to models, providers, and resolved authentication. `ctx.modelRegistry.getProvider(id)` returns the effective pi-ai provider, while `getProviderAuth(id)` resolves its current API key, headers, base URL, and provider-scoped environment without requiring a loaded model. `ctx.model` is the active model, and `ctx.thinkingLevel` is its current effective thinking level.
|
|
981
988
|
|
|
982
989
|
### ctx.signal
|
|
983
990
|
|
|
@@ -989,7 +996,7 @@ Use this for abort-aware nested work started by extension handlers, for example:
|
|
|
989
996
|
- file or process helpers that accept `AbortSignal`
|
|
990
997
|
|
|
991
998
|
`ctx.signal` is typically defined during active turn events such as `tool_call`, `tool_result`, `message_update`, and `turn_end`.
|
|
992
|
-
It is usually `undefined` in idle or non-turn contexts such as session events, extension commands, and shortcuts fired while
|
|
999
|
+
It is usually `undefined` in idle or non-turn contexts such as session events, extension commands, and shortcuts fired while sling is idle.
|
|
993
1000
|
|
|
994
1001
|
```typescript
|
|
995
1002
|
pi.on("tool_result", async (event, ctx) => {
|
|
@@ -1010,7 +1017,7 @@ Control flow helpers. `ctx.isIdle()` is false while Pi is processing an agent ru
|
|
|
1010
1017
|
|
|
1011
1018
|
### ctx.shutdown()
|
|
1012
1019
|
|
|
1013
|
-
Request a graceful shutdown of
|
|
1020
|
+
Request a graceful shutdown of sling.
|
|
1014
1021
|
|
|
1015
1022
|
- **Interactive mode:** Deferred until the agent becomes idle (after processing all queued steering and follow-up messages).
|
|
1016
1023
|
- **RPC mode:** Deferred until the next idle state (after completing the current command response, when waiting for the next command).
|
|
@@ -1130,7 +1137,7 @@ if (result.cancelled) {
|
|
|
1130
1137
|
Options:
|
|
1131
1138
|
- `parentSession`: parent session file to record in the new session header
|
|
1132
1139
|
- `setup`: mutate the new session's `SessionManager` before `withSession` runs
|
|
1133
|
-
- `withSession`: run post-switch work against a fresh replacement-session context. Do not use captured old `
|
|
1140
|
+
- `withSession`: run post-switch work against a fresh replacement-session context. Do not use captured old `sling` / command `ctx`; see [Session replacement lifecycle and footguns](#session-replacement-lifecycle-and-footguns).
|
|
1134
1141
|
|
|
1135
1142
|
### ctx.fork(entryId, options?)
|
|
1136
1143
|
|
|
@@ -1156,7 +1163,7 @@ if (cloneResult.cancelled) {
|
|
|
1156
1163
|
Options:
|
|
1157
1164
|
- `position`: `"before"` (default) forks before the selected user message, restoring that prompt into the editor
|
|
1158
1165
|
- `position`: `"at"` duplicates the active path through the selected entry without restoring editor text
|
|
1159
|
-
- `withSession`: run post-switch work against a fresh replacement-session context. Do not use captured old `
|
|
1166
|
+
- `withSession`: run post-switch work against a fresh replacement-session context. Do not use captured old `sling` / command `ctx`; see [Session replacement lifecycle and footguns](#session-replacement-lifecycle-and-footguns).
|
|
1160
1167
|
|
|
1161
1168
|
### ctx.navigateTree(targetId, options?)
|
|
1162
1169
|
|
|
@@ -1193,7 +1200,7 @@ if (result.cancelled) {
|
|
|
1193
1200
|
```
|
|
1194
1201
|
|
|
1195
1202
|
Options:
|
|
1196
|
-
- `withSession`: run post-switch work against a fresh replacement-session context. Do not use captured old `
|
|
1203
|
+
- `withSession`: run post-switch work against a fresh replacement-session context. Do not use captured old `sling` / command `ctx`; see [Session replacement lifecycle and footguns](#session-replacement-lifecycle-and-footguns).
|
|
1197
1204
|
|
|
1198
1205
|
To discover available sessions, use the static `SessionManager.list()` or `SessionManager.listAll()` methods:
|
|
1199
1206
|
|
|
@@ -1227,7 +1234,7 @@ pi.registerCommand("switch", {
|
|
|
1227
1234
|
Lifecycle and footguns:
|
|
1228
1235
|
- `withSession` runs only after the old session has emitted `session_shutdown`, the old runtime has been torn down, the replacement session has been rebound, and the new extension instance has already received `session_start`.
|
|
1229
1236
|
- The callback still executes in the original closure, not inside the new extension instance. That means your old extension instance may already have run its shutdown cleanup before `withSession` starts.
|
|
1230
|
-
- Captured old `
|
|
1237
|
+
- Captured old `sling` / old command `ctx` session-bound objects are stale after replacement and will throw if used. Use only the `ctx` passed to `withSession` for session-bound work.
|
|
1231
1238
|
- Previously extracted raw objects are still your responsibility. For example, if you capture `const sm = ctx.sessionManager` before replacement, `sm` is still the old `SessionManager` object. Do not reuse it after replacement.
|
|
1232
1239
|
- Code in `withSession` should assume any state invalidated by your `session_shutdown` handler is already gone. Only capture plain data that survives shutdown cleanly, such as strings, ids, and serialized config.
|
|
1233
1240
|
|
|
@@ -1485,7 +1492,7 @@ Labels persist in the session and survive restarts. Use them to mark important p
|
|
|
1485
1492
|
|
|
1486
1493
|
Register a command.
|
|
1487
1494
|
|
|
1488
|
-
If multiple extensions register the same command name,
|
|
1495
|
+
If multiple extensions register the same command name, sling keeps them all and assigns numeric invocation suffixes in load order, for example `/review:1` and `/review:2`.
|
|
1489
1496
|
|
|
1490
1497
|
```typescript
|
|
1491
1498
|
pi.registerCommand("stats", {
|
|
@@ -1932,6 +1939,7 @@ pi.registerTool({
|
|
|
1932
1939
|
return {
|
|
1933
1940
|
content: [{ type: "text", text: "Done" }], // Sent to LLM
|
|
1934
1941
|
details: { data: result }, // For rendering & state
|
|
1942
|
+
// usage: nestedModelResponse.usage, // Optional nested LLM usage
|
|
1935
1943
|
// Optional: stop after this tool batch when every finalized tool result
|
|
1936
1944
|
// in the batch also returns terminate: true.
|
|
1937
1945
|
terminate: true,
|
|
@@ -1944,6 +1952,8 @@ pi.registerTool({
|
|
|
1944
1952
|
});
|
|
1945
1953
|
```
|
|
1946
1954
|
|
|
1955
|
+
**Usage accounting:** If a tool makes nested LLM calls, return their combined `Usage` as `usage`. Pi persists it on the tool result and includes it in footer, `/session`, and RPC session totals. `tool_result` handlers can inspect or replace this value.
|
|
1956
|
+
|
|
1947
1957
|
**Signaling errors:** To mark a tool execution as failed (sets `isError: true` on the result and reports it to the LLM), throw an error from `execute`. Returning a value never sets the error flag regardless of what properties you include in the return object.
|
|
1948
1958
|
|
|
1949
1959
|
**Early termination:** Return `terminate: true` from `execute()` to hint that the automatic follow-up LLM call should be skipped after the current tool batch. This only takes effect when every finalized tool result in that batch is terminating. See [examples/extensions/structured-output.ts](../examples/extensions/structured-output.ts) for a minimal example where the agent ends on a final structured-output tool call.
|
|
@@ -1960,7 +1970,7 @@ async execute(toolCallId, params) {
|
|
|
1960
1970
|
|
|
1961
1971
|
**Important:** Use `StringEnum` from `@earendil-works/pi-ai` for string enums. `Type.Union`/`Type.Literal` doesn't work with Google's API.
|
|
1962
1972
|
|
|
1963
|
-
**Argument preparation:** `prepareArguments(args)` is optional. If defined, it runs before schema validation and before `execute()`. Use it to mimic an older accepted input shape when
|
|
1973
|
+
**Argument preparation:** `prepareArguments(args)` is optional. If defined, it runs before schema validation and before `execute()`. Use it to mimic an older accepted input shape when sling resumes an older session whose stored tool call arguments no longer match the current schema. Return the object you want validated against `parameters`. Keep the public schema strict. Do not add deprecated compatibility fields to `parameters` just to keep old resumed sessions working.
|
|
1964
1974
|
|
|
1965
1975
|
Example: an older session may contain an `edit` tool call with top-level `oldText` and `newText`, while the current schema only accepts `edits: [{ oldText, newText }]`.
|
|
1966
1976
|
|
|
@@ -2013,13 +2023,13 @@ Extensions can override built-in tools (`read`, `bash`, `edit`, `write`, `grep`,
|
|
|
2013
2023
|
|
|
2014
2024
|
```bash
|
|
2015
2025
|
# Extension's read tool replaces built-in read
|
|
2016
|
-
|
|
2026
|
+
sling -e ./tool-override.ts
|
|
2017
2027
|
```
|
|
2018
2028
|
|
|
2019
2029
|
Alternatively, use `--no-builtin-tools` to start without any built-in tools while keeping extension tools enabled:
|
|
2020
2030
|
```bash
|
|
2021
2031
|
# No built-in tools, only extension tools
|
|
2022
|
-
|
|
2032
|
+
sling --no-builtin-tools -e ./my-extension.ts
|
|
2023
2033
|
```
|
|
2024
2034
|
|
|
2025
2035
|
See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.ts) for a complete example that overrides `read` with logging and access control.
|
|
@@ -2070,7 +2080,7 @@ pi.registerTool({
|
|
|
2070
2080
|
|
|
2071
2081
|
**Operations interfaces:** `ReadOperations`, `WriteOperations`, `EditOperations`, `BashOperations`, `LsOperations`, `GrepOperations`, `FindOperations`
|
|
2072
2082
|
|
|
2073
|
-
For `user_bash`, extensions can reuse
|
|
2083
|
+
For `user_bash`, extensions can reuse sling's local shell backend via `createLocalBashOperations()` instead of reimplementing local process spawning, shell resolution, and process-tree termination.
|
|
2074
2084
|
|
|
2075
2085
|
The bash tool also supports a spawn hook to adjust the command, cwd, or env before execution:
|
|
2076
2086
|
|
|
@@ -2086,7 +2096,15 @@ const bashTool = createBashTool(cwd, {
|
|
|
2086
2096
|
});
|
|
2087
2097
|
```
|
|
2088
2098
|
|
|
2089
|
-
|
|
2099
|
+
`createBashTool()` exposes the current session to commands through `PI_SESSION_ID`, `PI_SESSION_FILE`, `PI_PROVIDER`, `PI_MODEL`, and `PI_REASONING_LEVEL`. Injection happens before `spawnHook`, so hooks receive these values in `env` and preserve them when they spread the existing environment as above. Set `exposeSessionEnvironment: false` to disable them:
|
|
2100
|
+
|
|
2101
|
+
```typescript
|
|
2102
|
+
const bashTool = createBashTool(cwd, {
|
|
2103
|
+
exposeSessionEnvironment: false,
|
|
2104
|
+
});
|
|
2105
|
+
```
|
|
2106
|
+
|
|
2107
|
+
See [Bash tool session environment](environment-variables.md#bash-tool-session-environment) for variable semantics. See [examples/extensions/ssh.ts](../examples/extensions/ssh.ts) for a complete SSH example with `--ssh` flag.
|
|
2090
2108
|
|
|
2091
2109
|
### Output Truncation
|
|
2092
2110
|
|
|
@@ -2546,7 +2564,7 @@ ctx.ui.setFooter((tui, theme) => ({
|
|
|
2546
2564
|
ctx.ui.setFooter(undefined); // Restore built-in footer
|
|
2547
2565
|
|
|
2548
2566
|
// Terminal title
|
|
2549
|
-
ctx.ui.setTitle("
|
|
2567
|
+
ctx.ui.setTitle("sling - my-project");
|
|
2550
2568
|
|
|
2551
2569
|
// Editor text
|
|
2552
2570
|
ctx.ui.setEditorText("Prefill text");
|
|
@@ -2773,7 +2791,7 @@ Register a custom renderer for messages with your `customType`. Use message rend
|
|
|
2773
2791
|
import { Text } from "@earendil-works/pi-tui";
|
|
2774
2792
|
|
|
2775
2793
|
pi.registerMessageRenderer("my-extension", (message, options, theme) => {
|
|
2776
|
-
const { expanded } = options;
|
|
2794
|
+
const { expanded, outputPad } = options;
|
|
2777
2795
|
let text = theme.fg("accent", `[${message.customType}] `);
|
|
2778
2796
|
text += message.content;
|
|
2779
2797
|
|
|
@@ -2781,7 +2799,7 @@ pi.registerMessageRenderer("my-extension", (message, options, theme) => {
|
|
|
2781
2799
|
text += "\n" + theme.fg("dim", JSON.stringify(message.details, null, 2));
|
|
2782
2800
|
}
|
|
2783
2801
|
|
|
2784
|
-
return new Text(text,
|
|
2802
|
+
return new Text(text, outputPad, 0);
|
|
2785
2803
|
});
|
|
2786
2804
|
```
|
|
2787
2805
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Sling Documentation
|
|
2
2
|
|
|
3
|
-
Sling is a terminal coding harness
|
|
3
|
+
Sling is a minimal terminal coding harness. It is designed to stay small at the core while being extended through TypeScript extensions, skills, prompt templates, themes, and sling packages.
|
|
4
4
|
|
|
5
5
|
## Quick start
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ npm install -g --ignore-scripts @psnext/slingcli
|
|
|
15
15
|
On Linux or macOS, you can also use the installer:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
curl -fsSL https://
|
|
18
|
+
curl -fsSL https://pi.dev/install.sh | sh
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
To uninstall sling itself, use npm for curl and npm installs:
|
|
@@ -32,15 +32,18 @@ Then run it in a project directory:
|
|
|
32
32
|
sling
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Authenticate with `/login
|
|
35
|
+
Authenticate with `/login` for subscription providers, or set an API key such as `ANTHROPIC_API_KEY` before starting sling.
|
|
36
36
|
|
|
37
37
|
For the full first-run flow, see [Quickstart](quickstart.md).
|
|
38
38
|
|
|
39
39
|
## Start here
|
|
40
40
|
|
|
41
41
|
- [Quickstart](quickstart.md) - install, authenticate, and run a first session.
|
|
42
|
-
- [Using Sling](usage.md) - interactive mode, slash commands, context files, and CLI reference.
|
|
42
|
+
- [Using Sling](usage.md) - interactive mode, slash commands, context files, and CLI reference.
|
|
43
|
+
- [Providers](providers.md) - subscription and API-key setup for built-in providers.
|
|
44
|
+
- [llama.cpp](llama-cpp.md) - run a local router and manage models with `/llama`.
|
|
43
45
|
- [Security](security.md) - project trust, sandbox boundaries, and vulnerability reporting.
|
|
46
|
+
- [Containerization](containerization.md) - sandbox sling with Gondolin, Docker, or OpenShell.
|
|
44
47
|
- [Settings](settings.md) - global and project settings.
|
|
45
48
|
- [Keybindings](keybindings.md) - default shortcuts and custom keybindings.
|
|
46
49
|
- [Sessions](sessions.md) - session management, branching, and tree navigation.
|
|
@@ -52,8 +55,7 @@ For the full first-run flow, see [Quickstart](quickstart.md).
|
|
|
52
55
|
- [Skills](skills.md) - Agent Skills for reusable on-demand capabilities.
|
|
53
56
|
- [Prompt templates](prompt-templates.md) - reusable prompts that expand from slash commands.
|
|
54
57
|
- [Themes](themes.md) - built-in and custom terminal themes.
|
|
55
|
-
- [Pi packages](packages.md) - bundle and share extensions, skills, prompts, and themes.
|
|
56
|
-
- [MCP servers](mcp.md) - use the pi-mcp-adapter to configure and manage MCP servers.
|
|
58
|
+
- [Sling/Pi packages](packages.md) - bundle and share extensions, skills, prompts, and themes.
|
|
57
59
|
- [Custom models](models.md) - add model entries for supported provider APIs.
|
|
58
60
|
- [Custom providers](custom-provider.md) - implement custom APIs and OAuth flows.
|
|
59
61
|
|
|
@@ -65,6 +67,7 @@ For the full first-run flow, see [Quickstart](quickstart.md).
|
|
|
65
67
|
|
|
66
68
|
## Reference
|
|
67
69
|
|
|
70
|
+
- [Environment variables](environment-variables.md) - Sling process configuration and session metadata available to bash tools.
|
|
68
71
|
- [Session format](session-format.md) - JSONL session file format, entry types, and SessionManager API.
|
|
69
72
|
|
|
70
73
|
## Platform setup
|
|
@@ -17,7 +17,11 @@ type AgentSessionEvent =
|
|
|
17
17
|
| { type: "compaction_start"; reason: "manual" | "threshold" | "overflow" }
|
|
18
18
|
| { type: "compaction_end"; reason: "manual" | "threshold" | "overflow"; result: CompactionResult | undefined; aborted: boolean; willRetry: boolean; errorMessage?: string }
|
|
19
19
|
| { type: "auto_retry_start"; attempt: number; maxAttempts: number; delayMs: number; errorMessage: string }
|
|
20
|
-
| { type: "auto_retry_end"; success: boolean; attempt: number; finalError?: string }
|
|
20
|
+
| { type: "auto_retry_end"; success: boolean; attempt: number; finalError?: string }
|
|
21
|
+
| { type: "summarization_retry_scheduled"; attempt: number; maxAttempts: number; delayMs: number; errorMessage: string }
|
|
22
|
+
| { type: "summarization_retry_attempt_start"; source: "branchSummary" }
|
|
23
|
+
| { type: "summarization_retry_attempt_start"; source: "compaction"; reason: "manual" | "threshold" | "overflow" }
|
|
24
|
+
| { type: "summarization_retry_finished" };
|
|
21
25
|
```
|
|
22
26
|
|
|
23
27
|
`queue_update` emits the full pending steering and follow-up queues whenever they change. `compaction_start` and `compaction_end` cover both manual and automatic compaction.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# llama.cpp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
sling supports the [llama.cpp](https://github.com/ggml-org/llama.cpp) router server. The router discovers multiple GGUF models and loads or unloads them on demand.
|
|
4
4
|
|
|
5
5
|
Use a current llama.cpp build with router support. Follow the [build instructions](https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md) or install a [prebuilt release](https://github.com/ggml-org/llama.cpp/releases) for your platform.
|
|
6
6
|
|
|
@@ -43,9 +43,9 @@ A single-file model can sit directly in the model directory. Put multimodal and
|
|
|
43
43
|
|
|
44
44
|
Restart the router after manually adding files. For per-model context sizes and other options, use [llama.cpp model presets](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md#model-presets).
|
|
45
45
|
|
|
46
|
-
## Configure
|
|
46
|
+
## Configure sling
|
|
47
47
|
|
|
48
|
-
Start
|
|
48
|
+
Start sling and configure the provider:
|
|
49
49
|
|
|
50
50
|
```text
|
|
51
51
|
/login llama.cpp
|
|
@@ -58,7 +58,7 @@ Environment variables can configure the same values without `/login`:
|
|
|
58
58
|
```bash
|
|
59
59
|
export LLAMA_BASE_URL=http://127.0.0.1:8080
|
|
60
60
|
export LLAMA_API_KEY=optional-secret
|
|
61
|
-
|
|
61
|
+
sling
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
If the server uses an API key, start `llama-server` with the matching `--api-key` value. Keep `--host 127.0.0.1` for local-only access.
|
|
@@ -76,11 +76,11 @@ Run:
|
|
|
76
76
|
- Select **Download model…**, search Hugging Face, then choose a repository and quantization. Exact `owner/repository[:quant]` values also work.
|
|
77
77
|
- Press Escape during a load or download to confirm cancellation.
|
|
78
78
|
|
|
79
|
-
Hugging Face search uses `HF_TOKEN` when set, then checks `$HF_TOKEN_PATH`, `$HF_HOME/token`, `$XDG_CACHE_HOME/huggingface/token`, and `~/.cache/huggingface/token`. Search also works without authentication, subject to lower rate limits.
|
|
79
|
+
Hugging Face search uses `HF_TOKEN` when set, then checks `$HF_TOKEN_PATH`, `$HF_HOME/token`, `$XDG_CACHE_HOME/huggingface/token`, and `~/.cache/huggingface/token`. Search also works without authentication, subject to lower rate limits. sling warns before downloading gated repositories and links to their access page. The llama.cpp server performs the download, so its process must also have `HF_TOKEN` when the selected repository requires access.
|
|
80
80
|
|
|
81
|
-
If other models are loaded,
|
|
81
|
+
If other models are loaded, sling asks whether to unload them first or keep them loaded. sling does not silently unload models and never deletes model files. The router may be shared with other clients, so `/llama` always displays the router's current state.
|
|
82
82
|
|
|
83
|
-
Only loaded models appear in `/model`. After loading a model, run `/model` to select it for the current
|
|
83
|
+
Only loaded models appear in `/model`. After loading a model, run `/model` to select it for the current sling session.
|
|
84
84
|
|
|
85
85
|
If the router disconnects, `/llama` shows **Retry** and **Close**. Retry reconnects and refreshes model state without replaying the interrupted operation.
|
|
86
86
|
|
|
@@ -272,7 +272,7 @@ Sling reads MCP config in this order:
|
|
|
272
272
|
1. `~/.config/mcp/mcp.json`
|
|
273
273
|
2. `~/.sling/agent/mcp.json`
|
|
274
274
|
3. `.mcp.json`
|
|
275
|
-
4. `.
|
|
275
|
+
4. `.sling/mcp.json`
|
|
276
276
|
|
|
277
277
|
Use shared config files for portable setups and Pi-specific files for adapter-only behavior.
|
|
278
278
|
|
|
@@ -34,9 +34,9 @@ For local models (Ollama, LM Studio, vLLM), only `id` is required per model:
|
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
The `apiKey` value is a placeholder because Ollama ignores it.
|
|
37
|
+
The `apiKey` value is a placeholder because Ollama ignores it. sling still treats models as requiring auth before they appear in `/model`, so keyless local servers should keep a dummy value, save a key for that provider with `/login`, or pass `--api-key` when selecting the model.
|
|
38
38
|
|
|
39
|
-
Some OpenAI-compatible servers do not understand the `developer` role used for reasoning-capable models. For those providers, set `compat.supportsDeveloperRole` to `false` so
|
|
39
|
+
Some OpenAI-compatible servers do not understand the `developer` role used for reasoning-capable models. For those providers, set `compat.supportsDeveloperRole` to `false` so sling sends the system prompt as a `system` message instead. If the server also does not support `reasoning_effort`, set `compat.supportsReasoningEffort` to `false` too.
|
|
40
40
|
|
|
41
41
|
You can set `compat` at the provider level to apply to all models, or at the model level to override a specific model. This commonly applies to Ollama, vLLM, SGLang, and similar OpenAI-compatible servers.
|
|
42
42
|
|
|
@@ -169,7 +169,7 @@ The `apiKey` and `headers` fields support command execution, environment interpo
|
|
|
169
169
|
"apiKey": "sk-..."
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
For `models.json`, shell commands are resolved at request time.
|
|
172
|
+
For `models.json`, shell commands are resolved at request time. sling intentionally does not apply built-in TTL, stale reuse, or recovery logic for arbitrary commands. Different commands need different caching and failure strategies, and sling cannot infer the right one.
|
|
173
173
|
|
|
174
174
|
If your command is slow, expensive, rate-limited, or should keep using a previous value on transient failures, wrap it in your own script or command that implements the caching or TTL behavior you want.
|
|
175
175
|
|
|
@@ -202,7 +202,7 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
|
|
|
202
202
|
| `name` | No | `id` | Human-readable model label. Used for matching (`--model` patterns) and shown as secondary model detail text. |
|
|
203
203
|
| `api` | No | provider's `api` | Override provider's API for this model |
|
|
204
204
|
| `reasoning` | No | `false` | Supports extended thinking |
|
|
205
|
-
| `thinkingLevelMap` | No | omitted | Maps
|
|
205
|
+
| `thinkingLevelMap` | No | omitted | Maps sling thinking levels to provider values and marks unsupported levels (see below) |
|
|
206
206
|
| `input` | No | `["text"]` | Input types: `["text"]` or `["text", "image"]` |
|
|
207
207
|
| `contextWindow` | No | `128000` | Context window size in tokens |
|
|
208
208
|
| `maxTokens` | No | `16384` | Maximum output tokens |
|
|
@@ -237,7 +237,7 @@ Current behavior:
|
|
|
237
237
|
|
|
238
238
|
### Thinking Level Map
|
|
239
239
|
|
|
240
|
-
Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are
|
|
240
|
+
Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are sling thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. Maps may contain holes; for example, a model can expose `high` and `max` without exposing `xhigh`.
|
|
241
241
|
|
|
242
242
|
Values are tristate:
|
|
243
243
|
|
|
@@ -369,12 +369,14 @@ Behavior notes:
|
|
|
369
369
|
|
|
370
370
|
For providers or proxies using `api: "anthropic-messages"`, use `compat` to control Anthropic-specific request compatibility.
|
|
371
371
|
|
|
372
|
-
By default
|
|
372
|
+
By default sling sends per-tool `eager_input_streaming: true`. If a proxy or Anthropic-compatible backend rejects that field, set `supportsEagerToolInputStreaming` to `false`. sling will omit `tools[].eager_input_streaming` and send the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests instead.
|
|
373
373
|
|
|
374
374
|
Some Anthropic models require adaptive thinking (`thinking.type: "adaptive"` plus `output_config.effort`) instead of the legacy budget-based thinking payload. Built-in models set this automatically. For custom providers or aliases that route to those models, set `forceAdaptiveThinking` to `true`.
|
|
375
375
|
|
|
376
376
|
Some Anthropic-compatible providers emit thinking blocks with empty signatures and still expect them on replay. Set `allowEmptySignature` to `true` only for those providers; real Anthropic rejects empty thinking signatures.
|
|
377
377
|
|
|
378
|
+
Built-in Anthropic models enable `supportsStrictTools` in their model metadata. Custom Anthropic-compatible models must set it to `true` when their endpoint accepts strict JSON-schema tool definitions.
|
|
379
|
+
|
|
378
380
|
```json
|
|
379
381
|
{
|
|
380
382
|
"providers": {
|
|
@@ -408,6 +410,7 @@ Some Anthropic-compatible providers emit thinking blocks with empty signatures a
|
|
|
408
410
|
| `supportsCacheControlOnTools` | Whether the provider accepts Anthropic-style `cache_control` markers on tool definitions. Default: `true`. |
|
|
409
411
|
| `forceAdaptiveThinking` | Whether to send adaptive thinking (`thinking.type: "adaptive"` plus `output_config.effort`) for this model. Built-in adaptive models set this automatically. Default: `false`. |
|
|
410
412
|
| `allowEmptySignature` | Whether to replay empty thinking signatures as `signature: ""` instead of converting thinking to text. Default: `false`. |
|
|
413
|
+
| `supportsStrictTools` | Whether the provider accepts strict JSON-schema tool definitions. Default: `false`; built-in Anthropic models enable it in generated metadata. |
|
|
411
414
|
|
|
412
415
|
## OpenAI Compatibility
|
|
413
416
|
|
|
@@ -444,11 +447,12 @@ For providers with partial OpenAI compatibility, use the `compat` field.
|
|
|
444
447
|
| `requiresThinkingAsText` | Convert thinking blocks to plain text |
|
|
445
448
|
| `requiresReasoningContentOnAssistantMessages` | Include empty `reasoning_content` on all replayed assistant messages when reasoning is enabled |
|
|
446
449
|
| `thinkingFormat` | Use `reasoning_effort`, `openrouter`, `deepseek`, `together`, `zai`, `qwen`, `chat-template`, or `qwen-chat-template` thinking parameters |
|
|
447
|
-
| `chatTemplateKwargs` | `chat_template_kwargs` values for `thinkingFormat: "chat-template"`; use `{ "$var": "thinking.enabled" }` or `{ "$var": "thinking.effort" }` for
|
|
448
|
-
| `cacheControlFormat` | Use Anthropic-style `cache_control` markers on the system prompt, last tool definition, and last user
|
|
450
|
+
| `chatTemplateKwargs` | `chat_template_kwargs` values for `thinkingFormat: "chat-template"`; use `{ "$var": "thinking.enabled" }` or `{ "$var": "thinking.effort" }` for sling-controlled thinking values |
|
|
451
|
+
| `cacheControlFormat` | Use Anthropic-style `cache_control` markers on the system prompt, last tool definition, and last user, assistant, or tool-result text content. Currently only `anthropic` is supported. |
|
|
449
452
|
| `sendSessionAffinityHeaders` | For `openai-completions`, send session-affinity headers from the session id when caching is enabled. Default: `false`. |
|
|
450
453
|
| `sessionAffinityFormat` | For `openai-completions` and `openai-responses`, the session-affinity header format: `openai` sends `session_id`/`x-client-request-id` (completions also `x-session-affinity`), `openai-nosession` omits the underscore-containing `session_id` header, `openrouter` sends `x-session-id`. Does not affect the `prompt_cache_key` body param. Default: auto-detected. |
|
|
451
|
-
| `supportsStrictMode` |
|
|
454
|
+
| `supportsStrictMode` | Whether the provider accepts strict JSON-schema function tool definitions. Defaults depend on the API; built-in OpenAI models carry explicit capability metadata. |
|
|
455
|
+
| `supportsOpenAIGrammarTools` | Whether OpenAI-compatible APIs emit custom Lark/regex grammar tools. When `false`, grammar-constrained tools fall back to normal function tools. Default: `false`; the built-in model catalog enables it for GPT-5+ models on OpenAI, OpenAI Codex, Azure OpenAI, GitHub Copilot, opencode, and Cloudflare AI Gateway. |
|
|
452
456
|
| `deferredToolsMode` | Use provider-specific deferred tool serialization. Currently only `"kimi"` is supported for Kimi's OpenAI-compatible Chat Completions format. |
|
|
453
457
|
| `supportsLongCacheRetention` | Whether the provider accepts long cache retention when cache retention is `long`: `prompt_cache_retention: "24h"` for OpenAI prompt caching, or `cache_control.ttl: "1h"` when `cacheControlFormat` is `anthropic`. Default: `true`. |
|
|
454
458
|
| `openRouterRouting` | OpenRouter provider routing preferences. This object is sent as-is in the `provider` field of the [OpenRouter API request](https://openrouter.ai/docs/guides/routing/provider-selection). |
|