@probelabs/probe 0.6.0-rc221 → 0.6.0-rc223
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/binaries/probe-v0.6.0-rc223-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc223-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc223-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc223-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc223-x86_64-unknown-linux-musl.tar.gz +0 -0
- package/build/agent/acp/tools.js +12 -0
- package/build/agent/index.js +30 -8
- package/build/delegate.js +26 -4
- package/build/tools/common.js +7 -1
- package/build/tools/langchain.js +4 -2
- package/build/tools/vercel.js +3 -2
- package/cjs/agent/ProbeAgent.cjs +138 -51
- package/cjs/index.cjs +142 -53
- package/package.json +1 -1
- package/src/agent/acp/tools.js +12 -0
- package/src/delegate.js +26 -4
- package/src/tools/common.js +7 -1
- package/src/tools/langchain.js +4 -2
- package/src/tools/vercel.js +3 -2
- package/bin/binaries/probe-v0.6.0-rc221-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc221-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc221-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc221-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc221-x86_64-unknown-linux-musl.tar.gz +0 -0
package/cjs/index.cjs
CHANGED
|
@@ -17265,18 +17265,21 @@ var require_dist_cjs37 = __commonJS({
|
|
|
17265
17265
|
}
|
|
17266
17266
|
const placeHolderStream = new TransformStream();
|
|
17267
17267
|
request.body = placeHolderStream.readable;
|
|
17268
|
+
const match2 = (headers?.authorization ?? "").match(/Signature=(\w+)$/);
|
|
17269
|
+
const priorSignature = (match2 ?? [])[1] ?? (query2 && query2["X-Amz-Signature"]) ?? "";
|
|
17270
|
+
const signingStream = getEventSigningTransformStream(priorSignature, await this.messageSigner(), this.eventStreamCodec, this.systemClockOffsetProvider);
|
|
17271
|
+
payload2.pipeThrough(signingStream).pipeThrough(placeHolderStream);
|
|
17268
17272
|
let result;
|
|
17269
17273
|
try {
|
|
17270
17274
|
result = await next(args);
|
|
17271
17275
|
} catch (e5) {
|
|
17272
|
-
|
|
17276
|
+
const p5 = payload2.cancel?.();
|
|
17277
|
+
if (p5 instanceof Promise) {
|
|
17278
|
+
p5.catch(() => {
|
|
17279
|
+
});
|
|
17280
|
+
}
|
|
17273
17281
|
throw e5;
|
|
17274
17282
|
}
|
|
17275
|
-
const match2 = (headers["authorization"] || "").match(/Signature=([\w]+)$/);
|
|
17276
|
-
const priorSignature = (match2 || [])[1] || query2 && query2["X-Amz-Signature"] || "";
|
|
17277
|
-
const signingStream = getEventSigningTransformStream(priorSignature, await this.messageSigner(), this.eventStreamCodec, this.systemClockOffsetProvider);
|
|
17278
|
-
const signedPayload = payload2.pipeThrough(signingStream);
|
|
17279
|
-
signedPayload.pipeThrough(placeHolderStream);
|
|
17280
17283
|
return result;
|
|
17281
17284
|
}
|
|
17282
17285
|
};
|
|
@@ -17500,8 +17503,12 @@ var require_dist_cjs37 = __commonJS({
|
|
|
17500
17503
|
};
|
|
17501
17504
|
const send = async () => {
|
|
17502
17505
|
try {
|
|
17503
|
-
for await (const
|
|
17504
|
-
socket.
|
|
17506
|
+
for await (const chunk of data2) {
|
|
17507
|
+
if (socket.readyState >= WebSocket.CLOSING) {
|
|
17508
|
+
break;
|
|
17509
|
+
} else {
|
|
17510
|
+
socket.send(chunk);
|
|
17511
|
+
}
|
|
17505
17512
|
}
|
|
17506
17513
|
} catch (err) {
|
|
17507
17514
|
streamError = err;
|
|
@@ -19175,7 +19182,7 @@ var require_package2 = __commonJS({
|
|
|
19175
19182
|
module2.exports = {
|
|
19176
19183
|
name: "@aws-sdk/client-bedrock-runtime",
|
|
19177
19184
|
description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
|
|
19178
|
-
version: "3.
|
|
19185
|
+
version: "3.983.0",
|
|
19179
19186
|
scripts: {
|
|
19180
19187
|
build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
19181
19188
|
"build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
|
|
@@ -19195,21 +19202,21 @@ var require_package2 = __commonJS({
|
|
|
19195
19202
|
dependencies: {
|
|
19196
19203
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
19197
19204
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
19198
|
-
"@aws-sdk/core": "^3.973.
|
|
19199
|
-
"@aws-sdk/credential-provider-node": "^3.972.
|
|
19200
|
-
"@aws-sdk/eventstream-handler-node": "^3.972.
|
|
19205
|
+
"@aws-sdk/core": "^3.973.6",
|
|
19206
|
+
"@aws-sdk/credential-provider-node": "^3.972.5",
|
|
19207
|
+
"@aws-sdk/eventstream-handler-node": "^3.972.4",
|
|
19201
19208
|
"@aws-sdk/middleware-eventstream": "^3.972.3",
|
|
19202
19209
|
"@aws-sdk/middleware-host-header": "^3.972.3",
|
|
19203
19210
|
"@aws-sdk/middleware-logger": "^3.972.3",
|
|
19204
19211
|
"@aws-sdk/middleware-recursion-detection": "^3.972.3",
|
|
19205
|
-
"@aws-sdk/middleware-user-agent": "^3.972.
|
|
19206
|
-
"@aws-sdk/middleware-websocket": "^3.972.
|
|
19212
|
+
"@aws-sdk/middleware-user-agent": "^3.972.6",
|
|
19213
|
+
"@aws-sdk/middleware-websocket": "^3.972.4",
|
|
19207
19214
|
"@aws-sdk/region-config-resolver": "^3.972.3",
|
|
19208
|
-
"@aws-sdk/token-providers": "3.
|
|
19215
|
+
"@aws-sdk/token-providers": "3.983.0",
|
|
19209
19216
|
"@aws-sdk/types": "^3.973.1",
|
|
19210
|
-
"@aws-sdk/util-endpoints": "3.
|
|
19217
|
+
"@aws-sdk/util-endpoints": "3.983.0",
|
|
19211
19218
|
"@aws-sdk/util-user-agent-browser": "^3.972.3",
|
|
19212
|
-
"@aws-sdk/util-user-agent-node": "^3.972.
|
|
19219
|
+
"@aws-sdk/util-user-agent-node": "^3.972.4",
|
|
19213
19220
|
"@smithy/config-resolver": "^4.4.6",
|
|
19214
19221
|
"@smithy/core": "^3.22.0",
|
|
19215
19222
|
"@smithy/eventstream-serde-browser": "^4.2.8",
|
|
@@ -19956,7 +19963,7 @@ var init_package = __esm({
|
|
|
19956
19963
|
"node_modules/@aws-sdk/nested-clients/package.json"() {
|
|
19957
19964
|
package_default = {
|
|
19958
19965
|
name: "@aws-sdk/nested-clients",
|
|
19959
|
-
version: "3.
|
|
19966
|
+
version: "3.982.0",
|
|
19960
19967
|
description: "Nested clients for AWS SDK packages.",
|
|
19961
19968
|
main: "./dist-cjs/index.js",
|
|
19962
19969
|
module: "./dist-es/index.js",
|
|
@@ -19985,16 +19992,16 @@ var init_package = __esm({
|
|
|
19985
19992
|
dependencies: {
|
|
19986
19993
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
19987
19994
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
19988
|
-
"@aws-sdk/core": "^3.973.
|
|
19995
|
+
"@aws-sdk/core": "^3.973.6",
|
|
19989
19996
|
"@aws-sdk/middleware-host-header": "^3.972.3",
|
|
19990
19997
|
"@aws-sdk/middleware-logger": "^3.972.3",
|
|
19991
19998
|
"@aws-sdk/middleware-recursion-detection": "^3.972.3",
|
|
19992
|
-
"@aws-sdk/middleware-user-agent": "^3.972.
|
|
19999
|
+
"@aws-sdk/middleware-user-agent": "^3.972.6",
|
|
19993
20000
|
"@aws-sdk/region-config-resolver": "^3.972.3",
|
|
19994
20001
|
"@aws-sdk/types": "^3.973.1",
|
|
19995
|
-
"@aws-sdk/util-endpoints": "3.
|
|
20002
|
+
"@aws-sdk/util-endpoints": "3.982.0",
|
|
19996
20003
|
"@aws-sdk/util-user-agent-browser": "^3.972.3",
|
|
19997
|
-
"@aws-sdk/util-user-agent-node": "^3.972.
|
|
20004
|
+
"@aws-sdk/util-user-agent-node": "^3.972.4",
|
|
19998
20005
|
"@smithy/config-resolver": "^4.4.6",
|
|
19999
20006
|
"@smithy/core": "^3.22.0",
|
|
20000
20007
|
"@smithy/fetch-http-handler": "^5.3.9",
|
|
@@ -21754,7 +21761,7 @@ var require_package3 = __commonJS({
|
|
|
21754
21761
|
module2.exports = {
|
|
21755
21762
|
name: "@aws-sdk/client-sso",
|
|
21756
21763
|
description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",
|
|
21757
|
-
version: "3.
|
|
21764
|
+
version: "3.982.0",
|
|
21758
21765
|
scripts: {
|
|
21759
21766
|
build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
21760
21767
|
"build:cjs": "node ../../scripts/compilation/inline client-sso",
|
|
@@ -21774,16 +21781,16 @@ var require_package3 = __commonJS({
|
|
|
21774
21781
|
dependencies: {
|
|
21775
21782
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
21776
21783
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
21777
|
-
"@aws-sdk/core": "^3.973.
|
|
21784
|
+
"@aws-sdk/core": "^3.973.6",
|
|
21778
21785
|
"@aws-sdk/middleware-host-header": "^3.972.3",
|
|
21779
21786
|
"@aws-sdk/middleware-logger": "^3.972.3",
|
|
21780
21787
|
"@aws-sdk/middleware-recursion-detection": "^3.972.3",
|
|
21781
|
-
"@aws-sdk/middleware-user-agent": "^3.972.
|
|
21788
|
+
"@aws-sdk/middleware-user-agent": "^3.972.6",
|
|
21782
21789
|
"@aws-sdk/region-config-resolver": "^3.972.3",
|
|
21783
21790
|
"@aws-sdk/types": "^3.973.1",
|
|
21784
|
-
"@aws-sdk/util-endpoints": "3.
|
|
21791
|
+
"@aws-sdk/util-endpoints": "3.982.0",
|
|
21785
21792
|
"@aws-sdk/util-user-agent-browser": "^3.972.3",
|
|
21786
|
-
"@aws-sdk/util-user-agent-node": "^3.972.
|
|
21793
|
+
"@aws-sdk/util-user-agent-node": "^3.972.4",
|
|
21787
21794
|
"@smithy/config-resolver": "^4.4.6",
|
|
21788
21795
|
"@smithy/core": "^3.22.0",
|
|
21789
21796
|
"@smithy/fetch-http-handler": "^5.3.9",
|
|
@@ -25602,17 +25609,23 @@ var require_dist_cjs66 = __commonJS({
|
|
|
25602
25609
|
messageSigner: await this.messageSigner(),
|
|
25603
25610
|
systemClockOffsetProvider: this.systemClockOffsetProvider
|
|
25604
25611
|
});
|
|
25605
|
-
|
|
25606
|
-
|
|
25607
|
-
|
|
25608
|
-
|
|
25612
|
+
let resolvePipeline;
|
|
25613
|
+
const pipelineError = new Promise((resolve7, reject2) => {
|
|
25614
|
+
resolvePipeline = () => resolve7(void 0);
|
|
25615
|
+
stream2.pipeline(payloadStream, signingStream, request.body, (err) => {
|
|
25616
|
+
if (err) {
|
|
25617
|
+
reject2(new Error(`Pipeline error in @aws-sdk/eventstream-handler-node: ${err.message}`, { cause: err }));
|
|
25618
|
+
}
|
|
25619
|
+
});
|
|
25609
25620
|
});
|
|
25610
25621
|
let result;
|
|
25611
25622
|
try {
|
|
25612
|
-
result = await next(args);
|
|
25623
|
+
result = await Promise.race([next(args), pipelineError]);
|
|
25613
25624
|
} catch (e5) {
|
|
25614
25625
|
request.body.end();
|
|
25615
25626
|
throw e5;
|
|
25627
|
+
} finally {
|
|
25628
|
+
resolvePipeline();
|
|
25616
25629
|
}
|
|
25617
25630
|
return result;
|
|
25618
25631
|
}
|
|
@@ -25704,7 +25717,7 @@ var init_package2 = __esm({
|
|
|
25704
25717
|
"node_modules/@aws-sdk/token-providers/node_modules/@aws-sdk/nested-clients/package.json"() {
|
|
25705
25718
|
package_default2 = {
|
|
25706
25719
|
name: "@aws-sdk/nested-clients",
|
|
25707
|
-
version: "3.
|
|
25720
|
+
version: "3.983.0",
|
|
25708
25721
|
description: "Nested clients for AWS SDK packages.",
|
|
25709
25722
|
main: "./dist-cjs/index.js",
|
|
25710
25723
|
module: "./dist-es/index.js",
|
|
@@ -25733,16 +25746,16 @@ var init_package2 = __esm({
|
|
|
25733
25746
|
dependencies: {
|
|
25734
25747
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
25735
25748
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
25736
|
-
"@aws-sdk/core": "^3.973.
|
|
25749
|
+
"@aws-sdk/core": "^3.973.6",
|
|
25737
25750
|
"@aws-sdk/middleware-host-header": "^3.972.3",
|
|
25738
25751
|
"@aws-sdk/middleware-logger": "^3.972.3",
|
|
25739
25752
|
"@aws-sdk/middleware-recursion-detection": "^3.972.3",
|
|
25740
|
-
"@aws-sdk/middleware-user-agent": "^3.972.
|
|
25753
|
+
"@aws-sdk/middleware-user-agent": "^3.972.6",
|
|
25741
25754
|
"@aws-sdk/region-config-resolver": "^3.972.3",
|
|
25742
25755
|
"@aws-sdk/types": "^3.973.1",
|
|
25743
|
-
"@aws-sdk/util-endpoints": "3.
|
|
25756
|
+
"@aws-sdk/util-endpoints": "3.983.0",
|
|
25744
25757
|
"@aws-sdk/util-user-agent-browser": "^3.972.3",
|
|
25745
|
-
"@aws-sdk/util-user-agent-node": "^3.972.
|
|
25758
|
+
"@aws-sdk/util-user-agent-node": "^3.972.4",
|
|
25746
25759
|
"@smithy/config-resolver": "^4.4.6",
|
|
25747
25760
|
"@smithy/core": "^3.22.0",
|
|
25748
25761
|
"@smithy/fetch-http-handler": "^5.3.9",
|
|
@@ -27809,6 +27822,7 @@ var require_dist_cjs70 = __commonJS({
|
|
|
27809
27822
|
var _IMWRSRn = "InvokeModelWithResponseStreamResponse";
|
|
27810
27823
|
var _IS = "ImageSource";
|
|
27811
27824
|
var _ISE4 = "InternalServerException";
|
|
27825
|
+
var _JSD = "JsonSchemaDefinition";
|
|
27812
27826
|
var _LAI = "ListAsyncInvokes";
|
|
27813
27827
|
var _LAIR = "ListAsyncInvokesRequest";
|
|
27814
27828
|
var _LAIRi = "ListAsyncInvokesResponse";
|
|
@@ -27821,6 +27835,9 @@ var require_dist_cjs70 = __commonJS({
|
|
|
27821
27835
|
var _MSEe = "MessageStopEvent";
|
|
27822
27836
|
var _MTE = "ModelTimeoutException";
|
|
27823
27837
|
var _Me = "Messages";
|
|
27838
|
+
var _OC = "OutputConfig";
|
|
27839
|
+
var _OF = "OutputFormat";
|
|
27840
|
+
var _OFS = "OutputFormatStructure";
|
|
27824
27841
|
var _PB = "PartBody";
|
|
27825
27842
|
var _PC2 = "PerformanceConfiguration";
|
|
27826
27843
|
var _PP = "PayloadPart";
|
|
@@ -27976,6 +27993,7 @@ var require_dist_cjs70 = __commonJS({
|
|
|
27976
27993
|
var _imp = "impossible";
|
|
27977
27994
|
var _in = "invalid";
|
|
27978
27995
|
var _j = "json";
|
|
27996
|
+
var _jS = "jsonSchema";
|
|
27979
27997
|
var _k = "key";
|
|
27980
27998
|
var _kKI = "kmsKeyId";
|
|
27981
27999
|
var _l = "location";
|
|
@@ -28006,6 +28024,7 @@ var require_dist_cjs70 = __commonJS({
|
|
|
28006
28024
|
var _nTo = "noTranslations";
|
|
28007
28025
|
var _o = "outputs";
|
|
28008
28026
|
var _oA = "outputAssessments";
|
|
28027
|
+
var _oC = "outputConfig";
|
|
28009
28028
|
var _oDC = "outputDataConfig";
|
|
28010
28029
|
var _oM = "originalMessage";
|
|
28011
28030
|
var _oS = "outputScope";
|
|
@@ -28055,6 +28074,7 @@ var require_dist_cjs70 = __commonJS({
|
|
|
28055
28074
|
var _sUE = "serviceUnavailableException";
|
|
28056
28075
|
var _sa = "satisfiable";
|
|
28057
28076
|
var _sc = "score";
|
|
28077
|
+
var _sch = "schema";
|
|
28058
28078
|
var _se3 = "server";
|
|
28059
28079
|
var _si = "signature";
|
|
28060
28080
|
var _sm4 = "smithy.ts.sdk.synthetic.com.amazonaws.bedrockruntime";
|
|
@@ -28063,6 +28083,8 @@ var require_dist_cjs70 = __commonJS({
|
|
|
28063
28083
|
var _stat = "statements";
|
|
28064
28084
|
var _str = "stream";
|
|
28065
28085
|
var _stre = "streaming";
|
|
28086
|
+
var _stri = "strict";
|
|
28087
|
+
var _stru = "structure";
|
|
28066
28088
|
var _sy = "system";
|
|
28067
28089
|
var _t = "ttl";
|
|
28068
28090
|
var _tA = "translationAmbiguous";
|
|
@@ -28071,6 +28093,7 @@ var require_dist_cjs70 = __commonJS({
|
|
|
28071
28093
|
var _tCo = "toolChoice";
|
|
28072
28094
|
var _tCoo = "tooComplex";
|
|
28073
28095
|
var _tE = "throttlingException";
|
|
28096
|
+
var _tF = "textFormat";
|
|
28074
28097
|
var _tP = "topicPolicy";
|
|
28075
28098
|
var _tPU = "topicPolicyUnits";
|
|
28076
28099
|
var _tPo = "topP";
|
|
@@ -28314,8 +28337,8 @@ var require_dist_cjs70 = __commonJS({
|
|
|
28314
28337
|
n05,
|
|
28315
28338
|
_CR,
|
|
28316
28339
|
0,
|
|
28317
|
-
[_mI, _me, _sy, _iC, _tC, _gCu, _aMRF, _pV, _aMRFP, _rM, _pC, _sTe],
|
|
28318
|
-
[[0, 1], [() => Messages, 0], [() => SystemContentBlocks, 0], () => InferenceConfiguration$, () => ToolConfiguration$, () => GuardrailConfiguration$, 15, [() => PromptVariableMap, 0], 64 | 0, [() => RequestMetadata, 0], () => PerformanceConfiguration$, () => ServiceTier
|
|
28340
|
+
[_mI, _me, _sy, _iC, _tC, _gCu, _aMRF, _pV, _aMRFP, _rM, _pC, _sTe, _oC],
|
|
28341
|
+
[[0, 1], [() => Messages, 0], [() => SystemContentBlocks, 0], () => InferenceConfiguration$, () => ToolConfiguration$, () => GuardrailConfiguration$, 15, [() => PromptVariableMap, 0], 64 | 0, [() => RequestMetadata, 0], () => PerformanceConfiguration$, () => ServiceTier$, [() => OutputConfig$, 0]],
|
|
28319
28342
|
1
|
|
28320
28343
|
];
|
|
28321
28344
|
var ConverseResponse$ = [
|
|
@@ -28350,8 +28373,8 @@ var require_dist_cjs70 = __commonJS({
|
|
|
28350
28373
|
n05,
|
|
28351
28374
|
_CSR,
|
|
28352
28375
|
0,
|
|
28353
|
-
[_mI, _me, _sy, _iC, _tC, _gCu, _aMRF, _pV, _aMRFP, _rM, _pC, _sTe],
|
|
28354
|
-
[[0, 1], [() => Messages, 0], [() => SystemContentBlocks, 0], () => InferenceConfiguration$, () => ToolConfiguration$, () => GuardrailStreamConfiguration$, 15, [() => PromptVariableMap, 0], 64 | 0, [() => RequestMetadata, 0], () => PerformanceConfiguration$, () => ServiceTier
|
|
28376
|
+
[_mI, _me, _sy, _iC, _tC, _gCu, _aMRF, _pV, _aMRFP, _rM, _pC, _sTe, _oC],
|
|
28377
|
+
[[0, 1], [() => Messages, 0], [() => SystemContentBlocks, 0], () => InferenceConfiguration$, () => ToolConfiguration$, () => GuardrailStreamConfiguration$, 15, [() => PromptVariableMap, 0], 64 | 0, [() => RequestMetadata, 0], () => PerformanceConfiguration$, () => ServiceTier$, [() => OutputConfig$, 0]],
|
|
28355
28378
|
1
|
|
28356
28379
|
];
|
|
28357
28380
|
var ConverseStreamResponse$ = [
|
|
@@ -28913,6 +28936,15 @@ var require_dist_cjs70 = __commonJS({
|
|
|
28913
28936
|
[[() => ResponseStream$, 16], [0, { [_hH]: _XABCT }], [0, { [_hH]: _XABPL }], [0, { [_hH]: _XABST }]],
|
|
28914
28937
|
2
|
|
28915
28938
|
];
|
|
28939
|
+
var JsonSchemaDefinition$ = [
|
|
28940
|
+
3,
|
|
28941
|
+
n05,
|
|
28942
|
+
_JSD,
|
|
28943
|
+
0,
|
|
28944
|
+
[_sch, _n, _des],
|
|
28945
|
+
[0, 0, 0],
|
|
28946
|
+
1
|
|
28947
|
+
];
|
|
28916
28948
|
var ListAsyncInvokesRequest$ = [
|
|
28917
28949
|
3,
|
|
28918
28950
|
n05,
|
|
@@ -28992,6 +29024,23 @@ var require_dist_cjs70 = __commonJS({
|
|
|
28992
29024
|
[0]
|
|
28993
29025
|
];
|
|
28994
29026
|
schema.TypeRegistry.for(n05).registerError(ModelTimeoutException$, ModelTimeoutException);
|
|
29027
|
+
var OutputConfig$ = [
|
|
29028
|
+
3,
|
|
29029
|
+
n05,
|
|
29030
|
+
_OC,
|
|
29031
|
+
0,
|
|
29032
|
+
[_tF],
|
|
29033
|
+
[[() => OutputFormat$, 0]]
|
|
29034
|
+
];
|
|
29035
|
+
var OutputFormat$ = [
|
|
29036
|
+
3,
|
|
29037
|
+
n05,
|
|
29038
|
+
_OF,
|
|
29039
|
+
0,
|
|
29040
|
+
[_ty, _stru],
|
|
29041
|
+
[0, [() => OutputFormatStructure$, 0]],
|
|
29042
|
+
2
|
|
29043
|
+
];
|
|
28995
29044
|
var PayloadPart$ = [
|
|
28996
29045
|
3,
|
|
28997
29046
|
n05,
|
|
@@ -29191,8 +29240,8 @@ var require_dist_cjs70 = __commonJS({
|
|
|
29191
29240
|
n05,
|
|
29192
29241
|
_TS,
|
|
29193
29242
|
0,
|
|
29194
|
-
[_n, _iS, _des],
|
|
29195
|
-
[0, () => ToolInputSchema$, 0],
|
|
29243
|
+
[_n, _iS, _des, _stri],
|
|
29244
|
+
[0, () => ToolInputSchema$, 0, 2],
|
|
29196
29245
|
2
|
|
29197
29246
|
];
|
|
29198
29247
|
var ToolUseBlock$ = [
|
|
@@ -29725,6 +29774,14 @@ var require_dist_cjs70 = __commonJS({
|
|
|
29725
29774
|
[_ch, _iSE, _mSEE, _vE, _tE, _mTE, _sUE],
|
|
29726
29775
|
[[() => BidirectionalOutputPayloadPart$, 0], [() => InternalServerException$4, 0], [() => ModelStreamErrorException$, 0], [() => ValidationException$2, 0], [() => ThrottlingException$, 0], [() => ModelTimeoutException$, 0], [() => ServiceUnavailableException$, 0]]
|
|
29727
29776
|
];
|
|
29777
|
+
var OutputFormatStructure$ = [
|
|
29778
|
+
4,
|
|
29779
|
+
n05,
|
|
29780
|
+
_OFS,
|
|
29781
|
+
8,
|
|
29782
|
+
[_jS],
|
|
29783
|
+
[() => JsonSchemaDefinition$]
|
|
29784
|
+
];
|
|
29728
29785
|
var PromptVariableValues$ = [
|
|
29729
29786
|
4,
|
|
29730
29787
|
n05,
|
|
@@ -30178,6 +30235,9 @@ var require_dist_cjs70 = __commonJS({
|
|
|
30178
30235
|
ASSISTANT: "assistant",
|
|
30179
30236
|
USER: "user"
|
|
30180
30237
|
};
|
|
30238
|
+
var OutputFormatType = {
|
|
30239
|
+
JSON_SCHEMA: "json_schema"
|
|
30240
|
+
};
|
|
30181
30241
|
var PerformanceConfigLatency = {
|
|
30182
30242
|
OPTIMIZED: "optimized",
|
|
30183
30243
|
STANDARD: "standard"
|
|
@@ -30389,6 +30449,7 @@ var require_dist_cjs70 = __commonJS({
|
|
|
30389
30449
|
exports2.InvokeModelWithResponseStreamCommand = InvokeModelWithResponseStreamCommand;
|
|
30390
30450
|
exports2.InvokeModelWithResponseStreamRequest$ = InvokeModelWithResponseStreamRequest$;
|
|
30391
30451
|
exports2.InvokeModelWithResponseStreamResponse$ = InvokeModelWithResponseStreamResponse$;
|
|
30452
|
+
exports2.JsonSchemaDefinition$ = JsonSchemaDefinition$;
|
|
30392
30453
|
exports2.ListAsyncInvokes$ = ListAsyncInvokes$;
|
|
30393
30454
|
exports2.ListAsyncInvokesCommand = ListAsyncInvokesCommand;
|
|
30394
30455
|
exports2.ListAsyncInvokesRequest$ = ListAsyncInvokesRequest$;
|
|
@@ -30404,6 +30465,10 @@ var require_dist_cjs70 = __commonJS({
|
|
|
30404
30465
|
exports2.ModelStreamErrorException$ = ModelStreamErrorException$;
|
|
30405
30466
|
exports2.ModelTimeoutException = ModelTimeoutException;
|
|
30406
30467
|
exports2.ModelTimeoutException$ = ModelTimeoutException$;
|
|
30468
|
+
exports2.OutputConfig$ = OutputConfig$;
|
|
30469
|
+
exports2.OutputFormat$ = OutputFormat$;
|
|
30470
|
+
exports2.OutputFormatStructure$ = OutputFormatStructure$;
|
|
30471
|
+
exports2.OutputFormatType = OutputFormatType;
|
|
30407
30472
|
exports2.PayloadPart$ = PayloadPart$;
|
|
30408
30473
|
exports2.PerformanceConfigLatency = PerformanceConfigLatency;
|
|
30409
30474
|
exports2.PerformanceConfiguration$ = PerformanceConfiguration$;
|
|
@@ -38238,7 +38303,10 @@ var init_common2 = __esm({
|
|
|
38238
38303
|
init_taskTool();
|
|
38239
38304
|
searchSchema = external_exports.object({
|
|
38240
38305
|
query: external_exports.string().describe("Search query with Elasticsearch syntax. Use quotes for exact matches, AND/OR for boolean logic, - for negation."),
|
|
38241
|
-
path: external_exports.string().optional().default(".").describe('Path to search in. For dependencies use "go:github.com/owner/repo", "js:package_name", or "rust:cargo_name" etc.')
|
|
38306
|
+
path: external_exports.string().optional().default(".").describe('Path to search in. For dependencies use "go:github.com/owner/repo", "js:package_name", or "rust:cargo_name" etc.'),
|
|
38307
|
+
exact: external_exports.boolean().optional().default(false).describe('Default (false) enables stemming and keyword splitting for exploratory search - "getUserData" matches "get", "user", "data", etc. Set true for precise symbol lookup where "getUserData" matches only "getUserData". Use true when you know the exact symbol name.'),
|
|
38308
|
+
session: external_exports.string().optional().describe("Session ID for result caching and pagination. Pass the session ID from a previous search to get additional results (next page). Results already shown in a session are automatically excluded. Omit for a fresh search."),
|
|
38309
|
+
nextPage: external_exports.boolean().optional().default(false).describe("Set to true when requesting the next page of results. Requires passing the same session ID from the previous search output.")
|
|
38242
38310
|
});
|
|
38243
38311
|
querySchema = external_exports.object({
|
|
38244
38312
|
pattern: external_exports.string().describe("AST pattern to search for. Use $NAME for variable names, $$$PARAMS for parameter lists, etc."),
|
|
@@ -38337,6 +38405,9 @@ You need to focus on main keywords when constructing the query, and always use e
|
|
|
38337
38405
|
Parameters:
|
|
38338
38406
|
- query: (required) Search query. Free-form questions are accepted, but for best results prefer Elasticsearch-style syntax with quotes for exact matches ("functionName"), AND/OR for boolean logic, - for negation, + for important terms.
|
|
38339
38407
|
- path: (optional, default: '.') Path to search in. All dependencies located in /dep folder, under language sub folders, like this: "/dep/go/github.com/owner/repo", "/dep/js/package_name", or "/dep/rust/cargo_name" etc.
|
|
38408
|
+
- exact: (optional, default: false) Set to true for precise symbol lookup without stemming/tokenization. Use when you know the exact symbol name (e.g., "getUserData" matches only "getUserData", not "get", "user", "data").
|
|
38409
|
+
- session: (optional) Session ID for pagination. Pass the session ID returned from a previous search to get the next page of results. Results already shown are automatically excluded.
|
|
38410
|
+
- nextPage: (optional, default: false) Set to true when requesting the next page of results. Requires passing the same session ID from the previous search.
|
|
38340
38411
|
|
|
38341
38412
|
**Workflow:** Always start with search, then use extract for detailed context when needed.
|
|
38342
38413
|
|
|
@@ -99161,7 +99232,7 @@ Convert your previous response content into actual JSON data that follows this s
|
|
|
99161
99232
|
// src/delegate.js
|
|
99162
99233
|
async function delegate({
|
|
99163
99234
|
task,
|
|
99164
|
-
timeout =
|
|
99235
|
+
timeout = DEFAULT_DELEGATE_TIMEOUT,
|
|
99165
99236
|
debug = false,
|
|
99166
99237
|
currentIteration = 0,
|
|
99167
99238
|
maxIterations = 30,
|
|
@@ -99339,7 +99410,7 @@ async function delegate({
|
|
|
99339
99410
|
throw new Error(`Delegation failed: ${error2.message}`);
|
|
99340
99411
|
}
|
|
99341
99412
|
}
|
|
99342
|
-
var import_crypto9, DelegationManager, defaultDelegationManager;
|
|
99413
|
+
var import_crypto9, DelegationManager, defaultDelegationManager, DEFAULT_DELEGATE_TIMEOUT;
|
|
99343
99414
|
var init_delegate = __esm({
|
|
99344
99415
|
"src/delegate.js"() {
|
|
99345
99416
|
"use strict";
|
|
@@ -99477,9 +99548,12 @@ var init_delegate = __esm({
|
|
|
99477
99548
|
}
|
|
99478
99549
|
/**
|
|
99479
99550
|
* Process the wait queue - grant slot to next waiting delegation
|
|
99551
|
+
* Uses setImmediate to avoid blocking the event loop when resolving promises.
|
|
99480
99552
|
* @private
|
|
99481
99553
|
*/
|
|
99482
99554
|
_processQueue(debug = false) {
|
|
99555
|
+
const toResolve = [];
|
|
99556
|
+
const toReject = [];
|
|
99483
99557
|
while (this.waitQueue.length > 0 && this.globalActive < this.maxConcurrent) {
|
|
99484
99558
|
const next = this.waitQueue.shift();
|
|
99485
99559
|
if (!next) break;
|
|
@@ -99491,7 +99565,7 @@ var init_delegate = __esm({
|
|
|
99491
99565
|
if (debug) {
|
|
99492
99566
|
console.error(`[DelegationManager] Session limit (${this.maxPerSession}) reached for queued item, rejecting`);
|
|
99493
99567
|
}
|
|
99494
|
-
reject2
|
|
99568
|
+
toReject.push({ reject: reject2, error: new Error(`Maximum delegations per session (${this.maxPerSession}) reached for session ${parentSessionId}`) });
|
|
99495
99569
|
continue;
|
|
99496
99570
|
}
|
|
99497
99571
|
}
|
|
@@ -99500,7 +99574,17 @@ var init_delegate = __esm({
|
|
|
99500
99574
|
const waitTime = Date.now() - queuedAt;
|
|
99501
99575
|
console.error(`[DelegationManager] Granted slot from queue (waited ${waitTime}ms). Active: ${this.globalActive}/${this.maxConcurrent}`);
|
|
99502
99576
|
}
|
|
99503
|
-
resolve7
|
|
99577
|
+
toResolve.push(resolve7);
|
|
99578
|
+
}
|
|
99579
|
+
if (toResolve.length > 0 || toReject.length > 0) {
|
|
99580
|
+
setImmediate(() => {
|
|
99581
|
+
for (const resolve7 of toResolve) {
|
|
99582
|
+
resolve7(true);
|
|
99583
|
+
}
|
|
99584
|
+
for (const { reject: reject2, error: error2 } of toReject) {
|
|
99585
|
+
reject2(error2);
|
|
99586
|
+
}
|
|
99587
|
+
});
|
|
99504
99588
|
}
|
|
99505
99589
|
}
|
|
99506
99590
|
/**
|
|
@@ -99549,6 +99633,7 @@ var init_delegate = __esm({
|
|
|
99549
99633
|
}
|
|
99550
99634
|
};
|
|
99551
99635
|
defaultDelegationManager = new DelegationManager();
|
|
99636
|
+
DEFAULT_DELEGATE_TIMEOUT = parseInt(process.env.DELEGATE_TIMEOUT, 10) || 300;
|
|
99552
99637
|
}
|
|
99553
99638
|
});
|
|
99554
99639
|
|
|
@@ -100161,7 +100246,7 @@ var init_vercel = __esm({
|
|
|
100161
100246
|
name: "search",
|
|
100162
100247
|
description: searchDelegate ? `${searchDescription} (delegates code search to a subagent and returns extracted code blocks)` : searchDescription,
|
|
100163
100248
|
inputSchema: searchSchema,
|
|
100164
|
-
execute: async ({ query: searchQuery, path: path9, allow_tests, exact, maxTokens: paramMaxTokens, language }) => {
|
|
100249
|
+
execute: async ({ query: searchQuery, path: path9, allow_tests, exact, maxTokens: paramMaxTokens, language, session, nextPage }) => {
|
|
100165
100250
|
const effectiveMaxTokens = paramMaxTokens || maxTokens;
|
|
100166
100251
|
let searchPaths;
|
|
100167
100252
|
if (path9) {
|
|
@@ -100180,8 +100265,10 @@ var init_vercel = __esm({
|
|
|
100180
100265
|
exact,
|
|
100181
100266
|
json: false,
|
|
100182
100267
|
maxTokens: effectiveMaxTokens,
|
|
100183
|
-
session: sessionId,
|
|
100184
|
-
//
|
|
100268
|
+
session: session || sessionId,
|
|
100269
|
+
// Use explicit session param, or fall back to options sessionId
|
|
100270
|
+
nextPage,
|
|
100271
|
+
// Pass nextPage parameter for pagination
|
|
100185
100272
|
language
|
|
100186
100273
|
// Pass language parameter if provided
|
|
100187
100274
|
};
|
|
@@ -102121,7 +102208,7 @@ function createSearchTool(options = {}) {
|
|
|
102121
102208
|
name: "search",
|
|
102122
102209
|
description: searchDescription,
|
|
102123
102210
|
schema: searchSchema,
|
|
102124
|
-
func: async ({ query: searchQuery, path: path9, allow_tests, exact, maxResults, maxTokens = 2e4, language }) => {
|
|
102211
|
+
func: async ({ query: searchQuery, path: path9, allow_tests, exact, maxResults, maxTokens = 2e4, language, session, nextPage }) => {
|
|
102125
102212
|
try {
|
|
102126
102213
|
const results = await search({
|
|
102127
102214
|
query: searchQuery,
|
|
@@ -102133,7 +102220,9 @@ function createSearchTool(options = {}) {
|
|
|
102133
102220
|
json: false,
|
|
102134
102221
|
maxResults,
|
|
102135
102222
|
maxTokens,
|
|
102136
|
-
language
|
|
102223
|
+
language,
|
|
102224
|
+
session,
|
|
102225
|
+
nextPage
|
|
102137
102226
|
});
|
|
102138
102227
|
return results;
|
|
102139
102228
|
} catch (error2) {
|
package/package.json
CHANGED
package/src/agent/acp/tools.js
CHANGED
|
@@ -287,6 +287,18 @@ export class ACPToolManager {
|
|
|
287
287
|
allow_tests: {
|
|
288
288
|
type: 'boolean',
|
|
289
289
|
description: 'Include test files in results (default: true)'
|
|
290
|
+
},
|
|
291
|
+
exact: {
|
|
292
|
+
type: 'boolean',
|
|
293
|
+
description: 'Default (false) enables stemming and keyword splitting for exploratory search. Set true for precise symbol lookup where the query matches only the exact term. Use true when you know the exact symbol name.'
|
|
294
|
+
},
|
|
295
|
+
session: {
|
|
296
|
+
type: 'string',
|
|
297
|
+
description: 'Session ID for result caching and pagination. Pass the session ID from a previous search to get additional results (next page). Results already shown in a session are automatically excluded.'
|
|
298
|
+
},
|
|
299
|
+
nextPage: {
|
|
300
|
+
type: 'boolean',
|
|
301
|
+
description: 'Set to true when requesting the next page of results. Requires passing the same session ID from the previous search output.'
|
|
290
302
|
}
|
|
291
303
|
},
|
|
292
304
|
required: ['query']
|
package/src/delegate.js
CHANGED
|
@@ -194,9 +194,14 @@ class DelegationManager {
|
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
196
|
* Process the wait queue - grant slot to next waiting delegation
|
|
197
|
+
* Uses setImmediate to avoid blocking the event loop when resolving promises.
|
|
197
198
|
* @private
|
|
198
199
|
*/
|
|
199
200
|
_processQueue(debug = false) {
|
|
201
|
+
// Collect callbacks to invoke after the loop to avoid blocking the event loop
|
|
202
|
+
const toResolve = [];
|
|
203
|
+
const toReject = [];
|
|
204
|
+
|
|
200
205
|
// Process queue items one at a time when slots are available
|
|
201
206
|
// Items are only removed when they can be granted or must be rejected
|
|
202
207
|
while (this.waitQueue.length > 0 && this.globalActive < this.maxConcurrent) {
|
|
@@ -216,7 +221,7 @@ class DelegationManager {
|
|
|
216
221
|
if (debug) {
|
|
217
222
|
console.error(`[DelegationManager] Session limit (${this.maxPerSession}) reached for queued item, rejecting`);
|
|
218
223
|
}
|
|
219
|
-
reject
|
|
224
|
+
toReject.push({ reject, error: new Error(`Maximum delegations per session (${this.maxPerSession}) reached for session ${parentSessionId}`) });
|
|
220
225
|
// Continue to process next item in queue
|
|
221
226
|
continue;
|
|
222
227
|
}
|
|
@@ -230,7 +235,21 @@ class DelegationManager {
|
|
|
230
235
|
console.error(`[DelegationManager] Granted slot from queue (waited ${waitTime}ms). Active: ${this.globalActive}/${this.maxConcurrent}`);
|
|
231
236
|
}
|
|
232
237
|
|
|
233
|
-
resolve
|
|
238
|
+
toResolve.push(resolve);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Defer promise resolutions/rejections to next tick to avoid blocking the event loop.
|
|
242
|
+
// This is critical: synchronous resolve()/reject() calls in a tight loop can saturate
|
|
243
|
+
// the microtask queue and prevent other async operations from proceeding.
|
|
244
|
+
if (toResolve.length > 0 || toReject.length > 0) {
|
|
245
|
+
setImmediate(() => {
|
|
246
|
+
for (const resolve of toResolve) {
|
|
247
|
+
resolve(true);
|
|
248
|
+
}
|
|
249
|
+
for (const { reject, error } of toReject) {
|
|
250
|
+
reject(error);
|
|
251
|
+
}
|
|
252
|
+
});
|
|
234
253
|
}
|
|
235
254
|
}
|
|
236
255
|
|
|
@@ -293,6 +312,9 @@ const defaultDelegationManager = new DelegationManager();
|
|
|
293
312
|
// Export the class for per-instance usage
|
|
294
313
|
export { DelegationManager };
|
|
295
314
|
|
|
315
|
+
// Default delegation timeout from environment variable or 300 seconds (5 minutes)
|
|
316
|
+
const DEFAULT_DELEGATE_TIMEOUT = parseInt(process.env.DELEGATE_TIMEOUT, 10) || 300;
|
|
317
|
+
|
|
296
318
|
/**
|
|
297
319
|
* Delegate a big distinct task to a probe subagent (used automatically by AI agents)
|
|
298
320
|
*
|
|
@@ -309,7 +331,7 @@ export { DelegationManager };
|
|
|
309
331
|
*
|
|
310
332
|
* @param {Object} options - Delegate options
|
|
311
333
|
* @param {string} options.task - A complete, self-contained task for the subagent. Should be specific and focused on one area of expertise.
|
|
312
|
-
* @param {number} [options.timeout
|
|
334
|
+
* @param {number} [options.timeout] - Timeout in seconds (default: DELEGATE_TIMEOUT env var or 300)
|
|
313
335
|
* @param {boolean} [options.debug=false] - Enable debug logging
|
|
314
336
|
* @param {number} [options.currentIteration=0] - Current tool iteration count from parent agent
|
|
315
337
|
* @param {number} [options.maxIterations=30] - Maximum tool iterations allowed
|
|
@@ -335,7 +357,7 @@ export { DelegationManager };
|
|
|
335
357
|
*/
|
|
336
358
|
export async function delegate({
|
|
337
359
|
task,
|
|
338
|
-
timeout =
|
|
360
|
+
timeout = DEFAULT_DELEGATE_TIMEOUT,
|
|
339
361
|
debug = false,
|
|
340
362
|
currentIteration = 0,
|
|
341
363
|
maxIterations = 30,
|
package/src/tools/common.js
CHANGED
|
@@ -11,7 +11,10 @@ import { taskSchema } from '../agent/tasks/taskTool.js';
|
|
|
11
11
|
// Common schemas for tool parameters (used for internal execution after XML parsing)
|
|
12
12
|
export const searchSchema = z.object({
|
|
13
13
|
query: z.string().describe('Search query with Elasticsearch syntax. Use quotes for exact matches, AND/OR for boolean logic, - for negation.'),
|
|
14
|
-
path: z.string().optional().default('.').describe('Path to search in. For dependencies use "go:github.com/owner/repo", "js:package_name", or "rust:cargo_name" etc.')
|
|
14
|
+
path: z.string().optional().default('.').describe('Path to search in. For dependencies use "go:github.com/owner/repo", "js:package_name", or "rust:cargo_name" etc.'),
|
|
15
|
+
exact: z.boolean().optional().default(false).describe('Default (false) enables stemming and keyword splitting for exploratory search - "getUserData" matches "get", "user", "data", etc. Set true for precise symbol lookup where "getUserData" matches only "getUserData". Use true when you know the exact symbol name.'),
|
|
16
|
+
session: z.string().optional().describe('Session ID for result caching and pagination. Pass the session ID from a previous search to get additional results (next page). Results already shown in a session are automatically excluded. Omit for a fresh search.'),
|
|
17
|
+
nextPage: z.boolean().optional().default(false).describe('Set to true when requesting the next page of results. Requires passing the same session ID from the previous search output.')
|
|
15
18
|
});
|
|
16
19
|
|
|
17
20
|
export const querySchema = z.object({
|
|
@@ -130,6 +133,9 @@ You need to focus on main keywords when constructing the query, and always use e
|
|
|
130
133
|
Parameters:
|
|
131
134
|
- query: (required) Search query. Free-form questions are accepted, but for best results prefer Elasticsearch-style syntax with quotes for exact matches ("functionName"), AND/OR for boolean logic, - for negation, + for important terms.
|
|
132
135
|
- path: (optional, default: '.') Path to search in. All dependencies located in /dep folder, under language sub folders, like this: "/dep/go/github.com/owner/repo", "/dep/js/package_name", or "/dep/rust/cargo_name" etc.
|
|
136
|
+
- exact: (optional, default: false) Set to true for precise symbol lookup without stemming/tokenization. Use when you know the exact symbol name (e.g., "getUserData" matches only "getUserData", not "get", "user", "data").
|
|
137
|
+
- session: (optional) Session ID for pagination. Pass the session ID returned from a previous search to get the next page of results. Results already shown are automatically excluded.
|
|
138
|
+
- nextPage: (optional, default: false) Set to true when requesting the next page of results. Requires passing the same session ID from the previous search.
|
|
133
139
|
|
|
134
140
|
**Workflow:** Always start with search, then use extract for detailed context when needed.
|
|
135
141
|
|
package/src/tools/langchain.js
CHANGED
|
@@ -16,7 +16,7 @@ export function createSearchTool(options = {}) {
|
|
|
16
16
|
name: 'search',
|
|
17
17
|
description: searchDescription,
|
|
18
18
|
schema: searchSchema,
|
|
19
|
-
func: async ({ query: searchQuery, path, allow_tests, exact, maxResults, maxTokens = 20000, language }) => {
|
|
19
|
+
func: async ({ query: searchQuery, path, allow_tests, exact, maxResults, maxTokens = 20000, language, session, nextPage }) => {
|
|
20
20
|
try {
|
|
21
21
|
const results = await search({
|
|
22
22
|
query: searchQuery,
|
|
@@ -27,7 +27,9 @@ export function createSearchTool(options = {}) {
|
|
|
27
27
|
json: false,
|
|
28
28
|
maxResults,
|
|
29
29
|
maxTokens,
|
|
30
|
-
language
|
|
30
|
+
language,
|
|
31
|
+
session,
|
|
32
|
+
nextPage
|
|
31
33
|
});
|
|
32
34
|
|
|
33
35
|
return results;
|