@probelabs/probe 0.6.0-rc108 → 0.6.0-rc109
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/build/agent/index.js +92 -47
- package/build/agent/xmlParsingUtils.js +54 -2
- package/build/tools/common.js +30 -15
- package/cjs/agent/ProbeAgent.cjs +92 -47
- package/cjs/index.cjs +92 -47
- package/package.json +1 -1
- package/src/agent/xmlParsingUtils.js +54 -2
- package/src/tools/common.js +30 -15
package/cjs/agent/ProbeAgent.cjs
CHANGED
|
@@ -10236,9 +10236,10 @@ var init_ProtocolLib = __esm({
|
|
|
10236
10236
|
return { errorSchema, errorMetadata };
|
|
10237
10237
|
} catch (e3) {
|
|
10238
10238
|
dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
10239
|
-
const
|
|
10239
|
+
const synthetic = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
|
|
10240
|
+
const baseExceptionSchema = synthetic.getBaseException();
|
|
10240
10241
|
if (baseExceptionSchema) {
|
|
10241
|
-
const ErrorCtor = baseExceptionSchema
|
|
10242
|
+
const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error;
|
|
10242
10243
|
throw Object.assign(new ErrorCtor({ name: errorName }), errorMetadata, dataObject);
|
|
10243
10244
|
}
|
|
10244
10245
|
throw Object.assign(new Error(errorName), errorMetadata, dataObject);
|
|
@@ -10305,7 +10306,8 @@ var init_AwsSmithyRpcV2CborProtocol = __esm({
|
|
|
10305
10306
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata);
|
|
10306
10307
|
const ns = NormalizedSchema.of(errorSchema);
|
|
10307
10308
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
10308
|
-
const
|
|
10309
|
+
const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
10310
|
+
const exception = new ErrorCtor(message);
|
|
10309
10311
|
const output = {};
|
|
10310
10312
|
for (const [name14, member] of ns.structIterator()) {
|
|
10311
10313
|
output[name14] = this.deserializer.readValue(member, dataObject[name14]);
|
|
@@ -11847,7 +11849,8 @@ var init_AwsJsonRpcProtocol = __esm({
|
|
|
11847
11849
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
11848
11850
|
const ns = NormalizedSchema.of(errorSchema);
|
|
11849
11851
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
11850
|
-
const
|
|
11852
|
+
const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
11853
|
+
const exception = new ErrorCtor(message);
|
|
11851
11854
|
const output = {};
|
|
11852
11855
|
for (const [name14, member] of ns.structIterator()) {
|
|
11853
11856
|
const target = member.getMergedTraits().jsonName ?? name14;
|
|
@@ -11976,7 +11979,8 @@ var init_AwsRestJsonProtocol = __esm({
|
|
|
11976
11979
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
11977
11980
|
const ns = NormalizedSchema.of(errorSchema);
|
|
11978
11981
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
11979
|
-
const
|
|
11982
|
+
const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
11983
|
+
const exception = new ErrorCtor(message);
|
|
11980
11984
|
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
11981
11985
|
const output = {};
|
|
11982
11986
|
for (const [name14, member] of ns.structIterator()) {
|
|
@@ -13388,7 +13392,8 @@ var init_AwsQueryProtocol = __esm({
|
|
|
13388
13392
|
};
|
|
13389
13393
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, (registry, errorName) => registry.find((schema) => NormalizedSchema.of(schema).getMergedTraits().awsQueryError?.[0] === errorName));
|
|
13390
13394
|
const ns = NormalizedSchema.of(errorSchema);
|
|
13391
|
-
const
|
|
13395
|
+
const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
13396
|
+
const exception = new ErrorCtor(message);
|
|
13392
13397
|
const output = {
|
|
13393
13398
|
Error: errorData.Error
|
|
13394
13399
|
};
|
|
@@ -13850,7 +13855,8 @@ var init_AwsRestXmlProtocol = __esm({
|
|
|
13850
13855
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
13851
13856
|
const ns = NormalizedSchema.of(errorSchema);
|
|
13852
13857
|
const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
13853
|
-
const
|
|
13858
|
+
const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
13859
|
+
const exception = new ErrorCtor(message);
|
|
13854
13860
|
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
13855
13861
|
const output = {};
|
|
13856
13862
|
for (const [name14, member] of ns.structIterator()) {
|
|
@@ -17801,7 +17807,7 @@ var require_package = __commonJS({
|
|
|
17801
17807
|
module2.exports = {
|
|
17802
17808
|
name: "@aws-sdk/client-bedrock-runtime",
|
|
17803
17809
|
description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
|
|
17804
|
-
version: "3.
|
|
17810
|
+
version: "3.899.0",
|
|
17805
17811
|
scripts: {
|
|
17806
17812
|
build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
17807
17813
|
"build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
|
|
@@ -17820,23 +17826,23 @@ var require_package = __commonJS({
|
|
|
17820
17826
|
dependencies: {
|
|
17821
17827
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
17822
17828
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
17823
|
-
"@aws-sdk/core": "3.
|
|
17824
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
17829
|
+
"@aws-sdk/core": "3.899.0",
|
|
17830
|
+
"@aws-sdk/credential-provider-node": "3.899.0",
|
|
17825
17831
|
"@aws-sdk/eventstream-handler-node": "3.893.0",
|
|
17826
17832
|
"@aws-sdk/middleware-eventstream": "3.893.0",
|
|
17827
17833
|
"@aws-sdk/middleware-host-header": "3.893.0",
|
|
17828
17834
|
"@aws-sdk/middleware-logger": "3.893.0",
|
|
17829
17835
|
"@aws-sdk/middleware-recursion-detection": "3.893.0",
|
|
17830
|
-
"@aws-sdk/middleware-user-agent": "3.
|
|
17836
|
+
"@aws-sdk/middleware-user-agent": "3.899.0",
|
|
17831
17837
|
"@aws-sdk/middleware-websocket": "3.893.0",
|
|
17832
17838
|
"@aws-sdk/region-config-resolver": "3.893.0",
|
|
17833
|
-
"@aws-sdk/token-providers": "3.
|
|
17839
|
+
"@aws-sdk/token-providers": "3.899.0",
|
|
17834
17840
|
"@aws-sdk/types": "3.893.0",
|
|
17835
17841
|
"@aws-sdk/util-endpoints": "3.895.0",
|
|
17836
17842
|
"@aws-sdk/util-user-agent-browser": "3.893.0",
|
|
17837
|
-
"@aws-sdk/util-user-agent-node": "3.
|
|
17843
|
+
"@aws-sdk/util-user-agent-node": "3.899.0",
|
|
17838
17844
|
"@smithy/config-resolver": "^4.2.2",
|
|
17839
|
-
"@smithy/core": "^3.
|
|
17845
|
+
"@smithy/core": "^3.13.0",
|
|
17840
17846
|
"@smithy/eventstream-serde-browser": "^4.1.1",
|
|
17841
17847
|
"@smithy/eventstream-serde-config-resolver": "^4.2.1",
|
|
17842
17848
|
"@smithy/eventstream-serde-node": "^4.1.1",
|
|
@@ -17844,21 +17850,21 @@ var require_package = __commonJS({
|
|
|
17844
17850
|
"@smithy/hash-node": "^4.1.1",
|
|
17845
17851
|
"@smithy/invalid-dependency": "^4.1.1",
|
|
17846
17852
|
"@smithy/middleware-content-length": "^4.1.1",
|
|
17847
|
-
"@smithy/middleware-endpoint": "^4.2.
|
|
17848
|
-
"@smithy/middleware-retry": "^4.3.
|
|
17853
|
+
"@smithy/middleware-endpoint": "^4.2.5",
|
|
17854
|
+
"@smithy/middleware-retry": "^4.3.1",
|
|
17849
17855
|
"@smithy/middleware-serde": "^4.1.1",
|
|
17850
17856
|
"@smithy/middleware-stack": "^4.1.1",
|
|
17851
17857
|
"@smithy/node-config-provider": "^4.2.2",
|
|
17852
17858
|
"@smithy/node-http-handler": "^4.2.1",
|
|
17853
17859
|
"@smithy/protocol-http": "^5.2.1",
|
|
17854
|
-
"@smithy/smithy-client": "^4.6.
|
|
17860
|
+
"@smithy/smithy-client": "^4.6.5",
|
|
17855
17861
|
"@smithy/types": "^4.5.0",
|
|
17856
17862
|
"@smithy/url-parser": "^4.1.1",
|
|
17857
17863
|
"@smithy/util-base64": "^4.1.0",
|
|
17858
17864
|
"@smithy/util-body-length-browser": "^4.1.0",
|
|
17859
17865
|
"@smithy/util-body-length-node": "^4.1.0",
|
|
17860
|
-
"@smithy/util-defaults-mode-browser": "^4.1.
|
|
17861
|
-
"@smithy/util-defaults-mode-node": "^4.1.
|
|
17866
|
+
"@smithy/util-defaults-mode-browser": "^4.1.5",
|
|
17867
|
+
"@smithy/util-defaults-mode-node": "^4.1.5",
|
|
17862
17868
|
"@smithy/util-endpoints": "^3.1.2",
|
|
17863
17869
|
"@smithy/util-middleware": "^4.1.1",
|
|
17864
17870
|
"@smithy/util-retry": "^4.1.2",
|
|
@@ -18650,7 +18656,7 @@ var require_package2 = __commonJS({
|
|
|
18650
18656
|
module2.exports = {
|
|
18651
18657
|
name: "@aws-sdk/client-sso",
|
|
18652
18658
|
description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",
|
|
18653
|
-
version: "3.
|
|
18659
|
+
version: "3.899.0",
|
|
18654
18660
|
scripts: {
|
|
18655
18661
|
build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
18656
18662
|
"build:cjs": "node ../../scripts/compilation/inline client-sso",
|
|
@@ -18669,37 +18675,37 @@ var require_package2 = __commonJS({
|
|
|
18669
18675
|
dependencies: {
|
|
18670
18676
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
18671
18677
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
18672
|
-
"@aws-sdk/core": "3.
|
|
18678
|
+
"@aws-sdk/core": "3.899.0",
|
|
18673
18679
|
"@aws-sdk/middleware-host-header": "3.893.0",
|
|
18674
18680
|
"@aws-sdk/middleware-logger": "3.893.0",
|
|
18675
18681
|
"@aws-sdk/middleware-recursion-detection": "3.893.0",
|
|
18676
|
-
"@aws-sdk/middleware-user-agent": "3.
|
|
18682
|
+
"@aws-sdk/middleware-user-agent": "3.899.0",
|
|
18677
18683
|
"@aws-sdk/region-config-resolver": "3.893.0",
|
|
18678
18684
|
"@aws-sdk/types": "3.893.0",
|
|
18679
18685
|
"@aws-sdk/util-endpoints": "3.895.0",
|
|
18680
18686
|
"@aws-sdk/util-user-agent-browser": "3.893.0",
|
|
18681
|
-
"@aws-sdk/util-user-agent-node": "3.
|
|
18687
|
+
"@aws-sdk/util-user-agent-node": "3.899.0",
|
|
18682
18688
|
"@smithy/config-resolver": "^4.2.2",
|
|
18683
|
-
"@smithy/core": "^3.
|
|
18689
|
+
"@smithy/core": "^3.13.0",
|
|
18684
18690
|
"@smithy/fetch-http-handler": "^5.2.1",
|
|
18685
18691
|
"@smithy/hash-node": "^4.1.1",
|
|
18686
18692
|
"@smithy/invalid-dependency": "^4.1.1",
|
|
18687
18693
|
"@smithy/middleware-content-length": "^4.1.1",
|
|
18688
|
-
"@smithy/middleware-endpoint": "^4.2.
|
|
18689
|
-
"@smithy/middleware-retry": "^4.3.
|
|
18694
|
+
"@smithy/middleware-endpoint": "^4.2.5",
|
|
18695
|
+
"@smithy/middleware-retry": "^4.3.1",
|
|
18690
18696
|
"@smithy/middleware-serde": "^4.1.1",
|
|
18691
18697
|
"@smithy/middleware-stack": "^4.1.1",
|
|
18692
18698
|
"@smithy/node-config-provider": "^4.2.2",
|
|
18693
18699
|
"@smithy/node-http-handler": "^4.2.1",
|
|
18694
18700
|
"@smithy/protocol-http": "^5.2.1",
|
|
18695
|
-
"@smithy/smithy-client": "^4.6.
|
|
18701
|
+
"@smithy/smithy-client": "^4.6.5",
|
|
18696
18702
|
"@smithy/types": "^4.5.0",
|
|
18697
18703
|
"@smithy/url-parser": "^4.1.1",
|
|
18698
18704
|
"@smithy/util-base64": "^4.1.0",
|
|
18699
18705
|
"@smithy/util-body-length-browser": "^4.1.0",
|
|
18700
18706
|
"@smithy/util-body-length-node": "^4.1.0",
|
|
18701
|
-
"@smithy/util-defaults-mode-browser": "^4.1.
|
|
18702
|
-
"@smithy/util-defaults-mode-node": "^4.1.
|
|
18707
|
+
"@smithy/util-defaults-mode-browser": "^4.1.5",
|
|
18708
|
+
"@smithy/util-defaults-mode-node": "^4.1.5",
|
|
18703
18709
|
"@smithy/util-endpoints": "^3.1.2",
|
|
18704
18710
|
"@smithy/util-middleware": "^4.1.1",
|
|
18705
18711
|
"@smithy/util-retry": "^4.1.2",
|
|
@@ -19931,7 +19937,7 @@ var init_package = __esm({
|
|
|
19931
19937
|
"node_modules/@aws-sdk/nested-clients/package.json"() {
|
|
19932
19938
|
package_default = {
|
|
19933
19939
|
name: "@aws-sdk/nested-clients",
|
|
19934
|
-
version: "3.
|
|
19940
|
+
version: "3.899.0",
|
|
19935
19941
|
description: "Nested clients for AWS SDK packages.",
|
|
19936
19942
|
main: "./dist-cjs/index.js",
|
|
19937
19943
|
module: "./dist-es/index.js",
|
|
@@ -19960,37 +19966,37 @@ var init_package = __esm({
|
|
|
19960
19966
|
dependencies: {
|
|
19961
19967
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
19962
19968
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
19963
|
-
"@aws-sdk/core": "3.
|
|
19969
|
+
"@aws-sdk/core": "3.899.0",
|
|
19964
19970
|
"@aws-sdk/middleware-host-header": "3.893.0",
|
|
19965
19971
|
"@aws-sdk/middleware-logger": "3.893.0",
|
|
19966
19972
|
"@aws-sdk/middleware-recursion-detection": "3.893.0",
|
|
19967
|
-
"@aws-sdk/middleware-user-agent": "3.
|
|
19973
|
+
"@aws-sdk/middleware-user-agent": "3.899.0",
|
|
19968
19974
|
"@aws-sdk/region-config-resolver": "3.893.0",
|
|
19969
19975
|
"@aws-sdk/types": "3.893.0",
|
|
19970
19976
|
"@aws-sdk/util-endpoints": "3.895.0",
|
|
19971
19977
|
"@aws-sdk/util-user-agent-browser": "3.893.0",
|
|
19972
|
-
"@aws-sdk/util-user-agent-node": "3.
|
|
19978
|
+
"@aws-sdk/util-user-agent-node": "3.899.0",
|
|
19973
19979
|
"@smithy/config-resolver": "^4.2.2",
|
|
19974
|
-
"@smithy/core": "^3.
|
|
19980
|
+
"@smithy/core": "^3.13.0",
|
|
19975
19981
|
"@smithy/fetch-http-handler": "^5.2.1",
|
|
19976
19982
|
"@smithy/hash-node": "^4.1.1",
|
|
19977
19983
|
"@smithy/invalid-dependency": "^4.1.1",
|
|
19978
19984
|
"@smithy/middleware-content-length": "^4.1.1",
|
|
19979
|
-
"@smithy/middleware-endpoint": "^4.2.
|
|
19980
|
-
"@smithy/middleware-retry": "^4.3.
|
|
19985
|
+
"@smithy/middleware-endpoint": "^4.2.5",
|
|
19986
|
+
"@smithy/middleware-retry": "^4.3.1",
|
|
19981
19987
|
"@smithy/middleware-serde": "^4.1.1",
|
|
19982
19988
|
"@smithy/middleware-stack": "^4.1.1",
|
|
19983
19989
|
"@smithy/node-config-provider": "^4.2.2",
|
|
19984
19990
|
"@smithy/node-http-handler": "^4.2.1",
|
|
19985
19991
|
"@smithy/protocol-http": "^5.2.1",
|
|
19986
|
-
"@smithy/smithy-client": "^4.6.
|
|
19992
|
+
"@smithy/smithy-client": "^4.6.5",
|
|
19987
19993
|
"@smithy/types": "^4.5.0",
|
|
19988
19994
|
"@smithy/url-parser": "^4.1.1",
|
|
19989
19995
|
"@smithy/util-base64": "^4.1.0",
|
|
19990
19996
|
"@smithy/util-body-length-browser": "^4.1.0",
|
|
19991
19997
|
"@smithy/util-body-length-node": "^4.1.0",
|
|
19992
|
-
"@smithy/util-defaults-mode-browser": "^4.1.
|
|
19993
|
-
"@smithy/util-defaults-mode-node": "^4.1.
|
|
19998
|
+
"@smithy/util-defaults-mode-browser": "^4.1.5",
|
|
19999
|
+
"@smithy/util-defaults-mode-node": "^4.1.5",
|
|
19994
20000
|
"@smithy/util-endpoints": "^3.1.2",
|
|
19995
20001
|
"@smithy/util-middleware": "^4.1.1",
|
|
19996
20002
|
"@smithy/util-retry": "^4.1.2",
|
|
@@ -24460,6 +24466,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
24460
24466
|
END_TURN: "end_turn",
|
|
24461
24467
|
GUARDRAIL_INTERVENED: "guardrail_intervened",
|
|
24462
24468
|
MAX_TOKENS: "max_tokens",
|
|
24469
|
+
MODEL_CONTEXT_WINDOW_EXCEEDED: "model_context_window_exceeded",
|
|
24463
24470
|
STOP_SEQUENCE: "stop_sequence",
|
|
24464
24471
|
TOOL_USE: "tool_use"
|
|
24465
24472
|
};
|
|
@@ -25389,6 +25396,9 @@ var require_dist_cjs65 = __commonJS({
|
|
|
25389
25396
|
case "ServiceQuotaExceededException":
|
|
25390
25397
|
case "com.amazonaws.bedrockruntime#ServiceQuotaExceededException":
|
|
25391
25398
|
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
25399
|
+
case "ServiceUnavailableException":
|
|
25400
|
+
case "com.amazonaws.bedrockruntime#ServiceUnavailableException":
|
|
25401
|
+
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
25392
25402
|
case "ThrottlingException":
|
|
25393
25403
|
case "com.amazonaws.bedrockruntime#ThrottlingException":
|
|
25394
25404
|
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
@@ -25404,9 +25414,6 @@ var require_dist_cjs65 = __commonJS({
|
|
|
25404
25414
|
case "ModelTimeoutException":
|
|
25405
25415
|
case "com.amazonaws.bedrockruntime#ModelTimeoutException":
|
|
25406
25416
|
throw await de_ModelTimeoutExceptionRes(parsedOutput, context);
|
|
25407
|
-
case "ServiceUnavailableException":
|
|
25408
|
-
case "com.amazonaws.bedrockruntime#ServiceUnavailableException":
|
|
25409
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
25410
25417
|
case "ModelStreamErrorException":
|
|
25411
25418
|
case "com.amazonaws.bedrockruntime#ModelStreamErrorException":
|
|
25412
25419
|
throw await de_ModelStreamErrorExceptionRes(parsedOutput, context);
|
|
@@ -28857,9 +28864,10 @@ function parseXmlToolCall(xmlString, validTools = DEFAULT_VALID_TOOLS) {
|
|
|
28857
28864
|
if (openIndex === -1) {
|
|
28858
28865
|
continue;
|
|
28859
28866
|
}
|
|
28860
|
-
|
|
28867
|
+
let closeIndex = xmlString.indexOf(closeTag, openIndex + openTag.length);
|
|
28868
|
+
let hasClosingTag = closeIndex !== -1;
|
|
28861
28869
|
if (closeIndex === -1) {
|
|
28862
|
-
|
|
28870
|
+
closeIndex = xmlString.length;
|
|
28863
28871
|
}
|
|
28864
28872
|
const innerContent = xmlString.substring(
|
|
28865
28873
|
openIndex + openTag.length,
|
|
@@ -28901,9 +28909,17 @@ function parseXmlToolCall(xmlString, validTools = DEFAULT_VALID_TOOLS) {
|
|
|
28901
28909
|
if (paramOpenIndex === -1) {
|
|
28902
28910
|
continue;
|
|
28903
28911
|
}
|
|
28904
|
-
|
|
28912
|
+
let paramCloseIndex = innerContent.indexOf(paramCloseTag, paramOpenIndex + paramOpenTag.length);
|
|
28905
28913
|
if (paramCloseIndex === -1) {
|
|
28906
|
-
|
|
28914
|
+
let nextTagIndex = innerContent.length;
|
|
28915
|
+
for (const nextParam of commonParams3) {
|
|
28916
|
+
const nextOpenTag = `<${nextParam}>`;
|
|
28917
|
+
const nextIndex = innerContent.indexOf(nextOpenTag, paramOpenIndex + paramOpenTag.length);
|
|
28918
|
+
if (nextIndex !== -1 && nextIndex < nextTagIndex) {
|
|
28919
|
+
nextTagIndex = nextIndex;
|
|
28920
|
+
}
|
|
28921
|
+
}
|
|
28922
|
+
paramCloseIndex = nextTagIndex;
|
|
28907
28923
|
}
|
|
28908
28924
|
let paramValue = innerContent.substring(
|
|
28909
28925
|
paramOpenIndex + paramOpenTag.length,
|
|
@@ -31125,13 +31141,42 @@ var init_index = __esm({
|
|
|
31125
31141
|
|
|
31126
31142
|
// src/agent/xmlParsingUtils.js
|
|
31127
31143
|
function removeThinkingTags(xmlString) {
|
|
31128
|
-
|
|
31144
|
+
let result = xmlString;
|
|
31145
|
+
result = result.replace(/<thinking>[\s\S]*?<\/thinking>/g, "");
|
|
31146
|
+
const thinkingIndex = result.indexOf("<thinking>");
|
|
31147
|
+
if (thinkingIndex !== -1) {
|
|
31148
|
+
const afterThinking = result.substring(thinkingIndex + "<thinking>".length);
|
|
31149
|
+
const toolPattern = /<(search|query|extract|listFiles|searchFiles|implement|attempt_completion|attempt_complete)>/;
|
|
31150
|
+
const toolMatch = afterThinking.match(toolPattern);
|
|
31151
|
+
if (toolMatch) {
|
|
31152
|
+
const toolStart = thinkingIndex + "<thinking>".length + toolMatch.index;
|
|
31153
|
+
result = result.substring(0, thinkingIndex) + result.substring(toolStart);
|
|
31154
|
+
} else {
|
|
31155
|
+
result = result.substring(0, thinkingIndex);
|
|
31156
|
+
}
|
|
31157
|
+
}
|
|
31158
|
+
return result.trim();
|
|
31129
31159
|
}
|
|
31130
31160
|
function extractThinkingContent(xmlString) {
|
|
31131
31161
|
const thinkingMatch = xmlString.match(/<thinking>([\s\S]*?)<\/thinking>/);
|
|
31132
31162
|
return thinkingMatch ? thinkingMatch[1].trim() : null;
|
|
31133
31163
|
}
|
|
31134
31164
|
function checkAttemptCompleteRecovery(cleanedXmlString, validTools = []) {
|
|
31165
|
+
const attemptCompletionMatch = cleanedXmlString.match(/<attempt_completion>([\s\S]*?)(?:<\/attempt_completion>|$)/);
|
|
31166
|
+
if (attemptCompletionMatch) {
|
|
31167
|
+
const content = attemptCompletionMatch[1].trim();
|
|
31168
|
+
const hasClosingTag = cleanedXmlString.includes("</attempt_completion>");
|
|
31169
|
+
if (content) {
|
|
31170
|
+
return {
|
|
31171
|
+
toolName: "attempt_completion",
|
|
31172
|
+
params: { result: content }
|
|
31173
|
+
};
|
|
31174
|
+
}
|
|
31175
|
+
return {
|
|
31176
|
+
toolName: "attempt_completion",
|
|
31177
|
+
params: { result: hasClosingTag ? "" : "__PREVIOUS_RESPONSE__" }
|
|
31178
|
+
};
|
|
31179
|
+
}
|
|
31135
31180
|
const attemptCompletePatterns = [
|
|
31136
31181
|
// Standard shorthand with optional whitespace
|
|
31137
31182
|
/^<attempt_complete>\s*$/,
|