@probelabs/probe 0.6.0-rc196 → 0.6.0-rc198

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/cjs/index.cjs CHANGED
@@ -720,7 +720,7 @@ async function waitForFileLock(lockPath, binaryPath) {
720
720
  }
721
721
  } catch {
722
722
  }
723
- await new Promise((resolve5) => setTimeout(resolve5, LOCK_POLL_INTERVAL_MS));
723
+ await new Promise((resolve6) => setTimeout(resolve6, LOCK_POLL_INTERVAL_MS));
724
724
  }
725
725
  if (process.env.DEBUG === "1" || process.env.VERBOSE === "1") {
726
726
  console.log(`Timeout waiting for file lock`);
@@ -1745,7 +1745,7 @@ Cwd: ${cwd}`;
1745
1745
  }
1746
1746
  }
1747
1747
  function extractWithStdin(binaryPath, cliArgs, content, options, cwd) {
1748
- return new Promise((resolve5, reject2) => {
1748
+ return new Promise((resolve6, reject2) => {
1749
1749
  const childProcess = (0, import_child_process4.spawn)(binaryPath, ["extract", ...cliArgs], {
1750
1750
  stdio: ["pipe", "pipe", "pipe"],
1751
1751
  cwd
@@ -1768,7 +1768,7 @@ function extractWithStdin(binaryPath, cliArgs, content, options, cwd) {
1768
1768
  }
1769
1769
  try {
1770
1770
  const result = processExtractOutput(stdout, options);
1771
- resolve5(result);
1771
+ resolve6(result);
1772
1772
  } catch (error2) {
1773
1773
  reject2(error2);
1774
1774
  }
@@ -3856,7 +3856,7 @@ var require_headStream = __commonJS({
3856
3856
  if ((0, stream_type_check_1.isReadableStream)(stream2)) {
3857
3857
  return (0, headStream_browser_1.headStream)(stream2, bytes);
3858
3858
  }
3859
- return new Promise((resolve5, reject2) => {
3859
+ return new Promise((resolve6, reject2) => {
3860
3860
  const collector = new Collector();
3861
3861
  collector.limit = bytes;
3862
3862
  stream2.pipe(collector);
@@ -3867,7 +3867,7 @@ var require_headStream = __commonJS({
3867
3867
  collector.on("error", reject2);
3868
3868
  collector.on("finish", function() {
3869
3869
  const bytes2 = new Uint8Array(Buffer.concat(this.buffers));
3870
- resolve5(bytes2);
3870
+ resolve6(bytes2);
3871
3871
  });
3872
3872
  });
3873
3873
  };
@@ -4055,21 +4055,21 @@ var require_dist_cjs15 = __commonJS({
4055
4055
  let sendBody = true;
4056
4056
  if (!externalAgent && expect === "100-continue") {
4057
4057
  sendBody = await Promise.race([
4058
- new Promise((resolve5) => {
4059
- timeoutId = Number(timing.setTimeout(() => resolve5(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
4058
+ new Promise((resolve6) => {
4059
+ timeoutId = Number(timing.setTimeout(() => resolve6(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
4060
4060
  }),
4061
- new Promise((resolve5) => {
4061
+ new Promise((resolve6) => {
4062
4062
  httpRequest.on("continue", () => {
4063
4063
  timing.clearTimeout(timeoutId);
4064
- resolve5(true);
4064
+ resolve6(true);
4065
4065
  });
4066
4066
  httpRequest.on("response", () => {
4067
4067
  timing.clearTimeout(timeoutId);
4068
- resolve5(false);
4068
+ resolve6(false);
4069
4069
  });
4070
4070
  httpRequest.on("error", () => {
4071
4071
  timing.clearTimeout(timeoutId);
4072
- resolve5(false);
4072
+ resolve6(false);
4073
4073
  });
4074
4074
  })
4075
4075
  ]);
@@ -4135,13 +4135,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
4135
4135
  return socketWarningTimestamp;
4136
4136
  }
4137
4137
  constructor(options) {
4138
- this.configProvider = new Promise((resolve5, reject2) => {
4138
+ this.configProvider = new Promise((resolve6, reject2) => {
4139
4139
  if (typeof options === "function") {
4140
4140
  options().then((_options) => {
4141
- resolve5(this.resolveDefaultConfig(_options));
4141
+ resolve6(this.resolveDefaultConfig(_options));
4142
4142
  }).catch(reject2);
4143
4143
  } else {
4144
- resolve5(this.resolveDefaultConfig(options));
4144
+ resolve6(this.resolveDefaultConfig(options));
4145
4145
  }
4146
4146
  });
4147
4147
  }
@@ -4184,7 +4184,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
4184
4184
  const config = this.config;
4185
4185
  let writeRequestBodyPromise = void 0;
4186
4186
  const timeouts = [];
4187
- const resolve5 = async (arg) => {
4187
+ const resolve6 = async (arg) => {
4188
4188
  await writeRequestBodyPromise;
4189
4189
  timeouts.forEach(timing.clearTimeout);
4190
4190
  _resolve(arg);
@@ -4250,7 +4250,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
4250
4250
  headers: getTransformedHeaders(res.headers),
4251
4251
  body: res
4252
4252
  });
4253
- resolve5({ response: httpResponse });
4253
+ resolve6({ response: httpResponse });
4254
4254
  });
4255
4255
  req.on("error", (err) => {
4256
4256
  if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) {
@@ -4430,13 +4430,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
4430
4430
  return new _NodeHttp2Handler(instanceOrOptions);
4431
4431
  }
4432
4432
  constructor(options) {
4433
- this.configProvider = new Promise((resolve5, reject2) => {
4433
+ this.configProvider = new Promise((resolve6, reject2) => {
4434
4434
  if (typeof options === "function") {
4435
4435
  options().then((opts) => {
4436
- resolve5(opts || {});
4436
+ resolve6(opts || {});
4437
4437
  }).catch(reject2);
4438
4438
  } else {
4439
- resolve5(options || {});
4439
+ resolve6(options || {});
4440
4440
  }
4441
4441
  });
4442
4442
  }
@@ -4456,7 +4456,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
4456
4456
  return new Promise((_resolve, _reject) => {
4457
4457
  let fulfilled = false;
4458
4458
  let writeRequestBodyPromise = void 0;
4459
- const resolve5 = async (arg) => {
4459
+ const resolve6 = async (arg) => {
4460
4460
  await writeRequestBodyPromise;
4461
4461
  _resolve(arg);
4462
4462
  };
@@ -4512,7 +4512,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
4512
4512
  body: req
4513
4513
  });
4514
4514
  fulfilled = true;
4515
- resolve5({ response: httpResponse });
4515
+ resolve6({ response: httpResponse });
4516
4516
  if (disableConcurrentStreams) {
4517
4517
  session.close();
4518
4518
  this.connectionManager.deleteSession(authority, session);
@@ -4589,7 +4589,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
4589
4589
  if (isReadableStreamInstance(stream3)) {
4590
4590
  return collectReadableStream(stream3);
4591
4591
  }
4592
- return new Promise((resolve5, reject2) => {
4592
+ return new Promise((resolve6, reject2) => {
4593
4593
  const collector = new Collector();
4594
4594
  stream3.pipe(collector);
4595
4595
  stream3.on("error", (err) => {
@@ -4599,7 +4599,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
4599
4599
  collector.on("error", reject2);
4600
4600
  collector.on("finish", function() {
4601
4601
  const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
4602
- resolve5(bytes);
4602
+ resolve6(bytes);
4603
4603
  });
4604
4604
  });
4605
4605
  };
@@ -4643,7 +4643,7 @@ var require_dist_cjs16 = __commonJS({
4643
4643
  return new Request(url, requestOptions);
4644
4644
  }
4645
4645
  function requestTimeout(timeoutInMs = 0) {
4646
- return new Promise((resolve5, reject2) => {
4646
+ return new Promise((resolve6, reject2) => {
4647
4647
  if (timeoutInMs) {
4648
4648
  setTimeout(() => {
4649
4649
  const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);
@@ -4761,7 +4761,7 @@ var require_dist_cjs16 = __commonJS({
4761
4761
  requestTimeout(requestTimeoutInMs)
4762
4762
  ];
4763
4763
  if (abortSignal) {
4764
- raceOfPromises.push(new Promise((resolve5, reject2) => {
4764
+ raceOfPromises.push(new Promise((resolve6, reject2) => {
4765
4765
  const onAbort = () => {
4766
4766
  const abortError = new Error("Request aborted");
4767
4767
  abortError.name = "AbortError";
@@ -4825,7 +4825,7 @@ var require_dist_cjs16 = __commonJS({
4825
4825
  return collected;
4826
4826
  }
4827
4827
  function readToBase64(blob) {
4828
- return new Promise((resolve5, reject2) => {
4828
+ return new Promise((resolve6, reject2) => {
4829
4829
  const reader = new FileReader();
4830
4830
  reader.onloadend = () => {
4831
4831
  if (reader.readyState !== 2) {
@@ -4834,7 +4834,7 @@ var require_dist_cjs16 = __commonJS({
4834
4834
  const result = reader.result ?? "";
4835
4835
  const commaIndex = result.indexOf(",");
4836
4836
  const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
4837
- resolve5(result.substring(dataOffset));
4837
+ resolve6(result.substring(dataOffset));
4838
4838
  };
4839
4839
  reader.onabort = () => reject2(new Error("Read aborted"));
4840
4840
  reader.onerror = () => reject2(reader.error);
@@ -5513,11 +5513,14 @@ function member(memberSchema, memberName) {
5513
5513
  const internalCtorAccess = NormalizedSchema;
5514
5514
  return new internalCtorAccess(memberSchema, memberName);
5515
5515
  }
5516
- var NormalizedSchema, isMemberSchema, isStaticSchema;
5516
+ var anno, NormalizedSchema, isMemberSchema, isStaticSchema;
5517
5517
  var init_NormalizedSchema = __esm({
5518
5518
  "node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js"() {
5519
5519
  init_deref();
5520
5520
  init_translateTraits();
5521
+ anno = {
5522
+ it: Symbol.for("@smithy/nor-struct-it")
5523
+ };
5521
5524
  NormalizedSchema = class _NormalizedSchema {
5522
5525
  ref;
5523
5526
  memberName;
@@ -5663,9 +5666,7 @@ var init_NormalizedSchema = __esm({
5663
5666
  return !!streaming || this.getSchema() === 42;
5664
5667
  }
5665
5668
  isIdempotencyToken() {
5666
- const match2 = (traits2) => (traits2 & 4) === 4 || !!traits2?.idempotencyToken;
5667
- const { normalizedTraits, traits, memberTraits } = this;
5668
- return match2(normalizedTraits) || match2(traits) || match2(memberTraits);
5669
+ return !!this.getMergedTraits().idempotencyToken;
5669
5670
  }
5670
5671
  getMergedTraits() {
5671
5672
  return this.normalizedTraits ?? (this.normalizedTraits = {
@@ -5737,9 +5738,19 @@ var init_NormalizedSchema = __esm({
5737
5738
  throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
5738
5739
  }
5739
5740
  const struct2 = this.getSchema();
5740
- for (let i4 = 0; i4 < struct2[4].length; ++i4) {
5741
- yield [struct2[4][i4], member([struct2[5][i4], 0], struct2[4][i4])];
5741
+ const z2 = struct2[4].length;
5742
+ let it = struct2[anno.it];
5743
+ if (it && z2 === it.length) {
5744
+ yield* it;
5745
+ return;
5746
+ }
5747
+ it = Array(z2);
5748
+ for (let i4 = 0; i4 < z2; ++i4) {
5749
+ const k4 = struct2[4][i4];
5750
+ const v4 = member([struct2[5][i4], 0], k4);
5751
+ yield it[i4] = [k4, v4];
5742
5752
  }
5753
+ struct2[anno.it] = it;
5743
5754
  }
5744
5755
  };
5745
5756
  isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2;
@@ -6466,11 +6477,11 @@ function __metadata(metadataKey, metadataValue) {
6466
6477
  }
6467
6478
  function __awaiter(thisArg, _arguments, P, generator) {
6468
6479
  function adopt(value) {
6469
- return value instanceof P ? value : new P(function(resolve5) {
6470
- resolve5(value);
6480
+ return value instanceof P ? value : new P(function(resolve6) {
6481
+ resolve6(value);
6471
6482
  });
6472
6483
  }
6473
- return new (P || (P = Promise))(function(resolve5, reject2) {
6484
+ return new (P || (P = Promise))(function(resolve6, reject2) {
6474
6485
  function fulfilled(value) {
6475
6486
  try {
6476
6487
  step(generator.next(value));
@@ -6486,7 +6497,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
6486
6497
  }
6487
6498
  }
6488
6499
  function step(result) {
6489
- result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected);
6500
+ result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected);
6490
6501
  }
6491
6502
  step((generator = generator.apply(thisArg, _arguments || [])).next());
6492
6503
  });
@@ -6677,14 +6688,14 @@ function __asyncValues(o4) {
6677
6688
  }, i4);
6678
6689
  function verb(n4) {
6679
6690
  i4[n4] = o4[n4] && function(v4) {
6680
- return new Promise(function(resolve5, reject2) {
6681
- v4 = o4[n4](v4), settle(resolve5, reject2, v4.done, v4.value);
6691
+ return new Promise(function(resolve6, reject2) {
6692
+ v4 = o4[n4](v4), settle(resolve6, reject2, v4.done, v4.value);
6682
6693
  });
6683
6694
  };
6684
6695
  }
6685
- function settle(resolve5, reject2, d4, v4) {
6696
+ function settle(resolve6, reject2, d4, v4) {
6686
6697
  Promise.resolve(v4).then(function(v5) {
6687
- resolve5({ value: v5, done: d4 });
6698
+ resolve6({ value: v5, done: d4 });
6688
6699
  }, reject2);
6689
6700
  }
6690
6701
  }
@@ -7672,7 +7683,9 @@ var init_HttpBindingProtocol = __esm({
7672
7683
  const inputMemberValue = input[memberName];
7673
7684
  if (inputMemberValue == null && !memberNs.isIdempotencyToken()) {
7674
7685
  if (memberTraits.httpLabel) {
7675
- throw new Error(`No value provided for input HTTP label: ${memberName}.`);
7686
+ if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) {
7687
+ throw new Error(`No value provided for input HTTP label: ${memberName}.`);
7688
+ }
7676
7689
  }
7677
7690
  continue;
7678
7691
  }
@@ -17154,7 +17167,7 @@ var require_dist_cjs37 = __commonJS({
17154
17167
  this.sockets[url] = (this.sockets[url] ?? []).filter((socket) => ![WebSocket.CLOSING, WebSocket.CLOSED].includes(socket.readyState));
17155
17168
  }
17156
17169
  waitForReady(socket, connectionTimeout) {
17157
- return new Promise((resolve5, reject2) => {
17170
+ return new Promise((resolve6, reject2) => {
17158
17171
  const timeout = setTimeout(() => {
17159
17172
  this.removeNotUsableSockets(socket.url);
17160
17173
  reject2({
@@ -17165,7 +17178,7 @@ var require_dist_cjs37 = __commonJS({
17165
17178
  }, connectionTimeout);
17166
17179
  socket.onopen = () => {
17167
17180
  clearTimeout(timeout);
17168
- resolve5();
17181
+ resolve6();
17169
17182
  };
17170
17183
  });
17171
17184
  }
@@ -17174,10 +17187,10 @@ var require_dist_cjs37 = __commonJS({
17174
17187
  let socketErrorOccurred = false;
17175
17188
  let reject2 = () => {
17176
17189
  };
17177
- let resolve5 = () => {
17190
+ let resolve6 = () => {
17178
17191
  };
17179
17192
  socket.onmessage = (event) => {
17180
- resolve5({
17193
+ resolve6({
17181
17194
  done: false,
17182
17195
  value: new Uint8Array(event.data)
17183
17196
  });
@@ -17194,7 +17207,7 @@ var require_dist_cjs37 = __commonJS({
17194
17207
  if (streamError) {
17195
17208
  reject2(streamError);
17196
17209
  } else {
17197
- resolve5({
17210
+ resolve6({
17198
17211
  done: true,
17199
17212
  value: void 0
17200
17213
  });
@@ -17204,7 +17217,7 @@ var require_dist_cjs37 = __commonJS({
17204
17217
  [Symbol.asyncIterator]: () => ({
17205
17218
  next: () => {
17206
17219
  return new Promise((_resolve, _reject) => {
17207
- resolve5 = _resolve;
17220
+ resolve6 = _resolve;
17208
17221
  reject2 = _reject;
17209
17222
  });
17210
17223
  }
@@ -18242,7 +18255,7 @@ var require_dist_cjs46 = __commonJS({
18242
18255
  this.refillTokenBucket();
18243
18256
  if (amount > this.currentCapacity) {
18244
18257
  const delay = (amount - this.currentCapacity) / this.fillRate * 1e3;
18245
- await new Promise((resolve5) => _DefaultRateLimiter.setTimeoutFn(resolve5, delay));
18258
+ await new Promise((resolve6) => _DefaultRateLimiter.setTimeoutFn(resolve6, delay));
18246
18259
  }
18247
18260
  this.currentCapacity = this.currentCapacity - amount;
18248
18261
  }
@@ -18577,7 +18590,7 @@ var require_dist_cjs47 = __commonJS({
18577
18590
  const delayFromResponse = getDelayFromRetryAfterHeader(err.$response);
18578
18591
  const delay = Math.max(delayFromResponse || 0, delayFromDecider);
18579
18592
  totalDelay += delay;
18580
- await new Promise((resolve5) => setTimeout(resolve5, delay));
18593
+ await new Promise((resolve6) => setTimeout(resolve6, delay));
18581
18594
  continue;
18582
18595
  }
18583
18596
  if (!err.$metadata) {
@@ -18735,7 +18748,7 @@ var require_dist_cjs47 = __commonJS({
18735
18748
  attempts = retryToken.getRetryCount();
18736
18749
  const delay = retryToken.getRetryDelay();
18737
18750
  totalRetryDelay += delay;
18738
- await new Promise((resolve5) => setTimeout(resolve5, delay));
18751
+ await new Promise((resolve6) => setTimeout(resolve6, delay));
18739
18752
  }
18740
18753
  }
18741
18754
  } else {
@@ -18887,7 +18900,7 @@ var require_package2 = __commonJS({
18887
18900
  module2.exports = {
18888
18901
  name: "@aws-sdk/client-bedrock-runtime",
18889
18902
  description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
18890
- version: "3.971.0",
18903
+ version: "3.972.0",
18891
18904
  scripts: {
18892
18905
  build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
18893
18906
  "build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
@@ -18895,7 +18908,7 @@ var require_package2 = __commonJS({
18895
18908
  "build:include:deps": 'yarn g:turbo run build -F="$npm_package_name"',
18896
18909
  "build:types": "tsc -p tsconfig.types.json",
18897
18910
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
18898
- clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
18911
+ clean: "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
18899
18912
  "extract:docs": "api-extractor run --local",
18900
18913
  "generate:client": "node ../../scripts/generate-clients/single-service --solo bedrock-runtime",
18901
18914
  "test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs"
@@ -18907,21 +18920,21 @@ var require_package2 = __commonJS({
18907
18920
  dependencies: {
18908
18921
  "@aws-crypto/sha256-browser": "5.2.0",
18909
18922
  "@aws-crypto/sha256-js": "5.2.0",
18910
- "@aws-sdk/core": "3.970.0",
18911
- "@aws-sdk/credential-provider-node": "3.971.0",
18912
- "@aws-sdk/eventstream-handler-node": "3.971.0",
18913
- "@aws-sdk/middleware-eventstream": "3.969.0",
18914
- "@aws-sdk/middleware-host-header": "3.969.0",
18915
- "@aws-sdk/middleware-logger": "3.969.0",
18916
- "@aws-sdk/middleware-recursion-detection": "3.969.0",
18917
- "@aws-sdk/middleware-user-agent": "3.970.0",
18918
- "@aws-sdk/middleware-websocket": "3.971.0",
18919
- "@aws-sdk/region-config-resolver": "3.969.0",
18920
- "@aws-sdk/token-providers": "3.971.0",
18921
- "@aws-sdk/types": "3.969.0",
18922
- "@aws-sdk/util-endpoints": "3.970.0",
18923
- "@aws-sdk/util-user-agent-browser": "3.969.0",
18924
- "@aws-sdk/util-user-agent-node": "3.971.0",
18923
+ "@aws-sdk/core": "3.972.0",
18924
+ "@aws-sdk/credential-provider-node": "3.972.0",
18925
+ "@aws-sdk/eventstream-handler-node": "3.972.0",
18926
+ "@aws-sdk/middleware-eventstream": "3.972.0",
18927
+ "@aws-sdk/middleware-host-header": "3.972.0",
18928
+ "@aws-sdk/middleware-logger": "3.972.0",
18929
+ "@aws-sdk/middleware-recursion-detection": "3.972.0",
18930
+ "@aws-sdk/middleware-user-agent": "3.972.0",
18931
+ "@aws-sdk/middleware-websocket": "3.972.0",
18932
+ "@aws-sdk/region-config-resolver": "3.972.0",
18933
+ "@aws-sdk/token-providers": "3.972.0",
18934
+ "@aws-sdk/types": "3.972.0",
18935
+ "@aws-sdk/util-endpoints": "3.972.0",
18936
+ "@aws-sdk/util-user-agent-browser": "3.972.0",
18937
+ "@aws-sdk/util-user-agent-node": "3.972.0",
18925
18938
  "@smithy/config-resolver": "^4.4.6",
18926
18939
  "@smithy/core": "^3.20.6",
18927
18940
  "@smithy/eventstream-serde-browser": "^4.2.8",
@@ -18958,7 +18971,7 @@ var require_package2 = __commonJS({
18958
18971
  "@types/node": "^20.14.8",
18959
18972
  concurrently: "7.0.0",
18960
18973
  "downlevel-dts": "0.10.1",
18961
- rimraf: "5.0.10",
18974
+ premove: "4.0.0",
18962
18975
  typescript: "~5.8.3"
18963
18976
  },
18964
18977
  engines: {
@@ -19050,7 +19063,7 @@ var require_dist_cjs49 = __commonJS({
19050
19063
  var nodeConfigProvider = require_dist_cjs43();
19051
19064
  var urlParser = require_dist_cjs22();
19052
19065
  function httpRequest(options) {
19053
- return new Promise((resolve5, reject2) => {
19066
+ return new Promise((resolve6, reject2) => {
19054
19067
  const req = http.request({
19055
19068
  method: "GET",
19056
19069
  ...options,
@@ -19075,7 +19088,7 @@ var require_dist_cjs49 = __commonJS({
19075
19088
  chunks.push(chunk);
19076
19089
  });
19077
19090
  res.on("end", () => {
19078
- resolve5(buffer.Buffer.concat(chunks));
19091
+ resolve6(buffer.Buffer.concat(chunks));
19079
19092
  req.destroy();
19080
19093
  });
19081
19094
  });
@@ -19495,7 +19508,7 @@ var require_retry_wrapper = __commonJS({
19495
19508
  try {
19496
19509
  return await toRetry();
19497
19510
  } catch (e4) {
19498
- await new Promise((resolve5) => setTimeout(resolve5, delayMs));
19511
+ await new Promise((resolve6) => setTimeout(resolve6, delayMs));
19499
19512
  }
19500
19513
  }
19501
19514
  return await toRetry();
@@ -19668,7 +19681,7 @@ var init_package = __esm({
19668
19681
  "node_modules/@aws-sdk/nested-clients/package.json"() {
19669
19682
  package_default = {
19670
19683
  name: "@aws-sdk/nested-clients",
19671
- version: "3.971.0",
19684
+ version: "3.972.0",
19672
19685
  description: "Nested clients for AWS SDK packages.",
19673
19686
  main: "./dist-cjs/index.js",
19674
19687
  module: "./dist-es/index.js",
@@ -19680,7 +19693,7 @@ var init_package = __esm({
19680
19693
  "build:include:deps": 'yarn g:turbo run build -F="$npm_package_name"',
19681
19694
  "build:types": "tsc -p tsconfig.types.json",
19682
19695
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
19683
- clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
19696
+ clean: "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
19684
19697
  lint: "node ../../scripts/validation/submodules-linter.js --pkg nested-clients",
19685
19698
  test: "yarn g:vitest run",
19686
19699
  "test:watch": "yarn g:vitest watch"
@@ -19697,16 +19710,16 @@ var init_package = __esm({
19697
19710
  dependencies: {
19698
19711
  "@aws-crypto/sha256-browser": "5.2.0",
19699
19712
  "@aws-crypto/sha256-js": "5.2.0",
19700
- "@aws-sdk/core": "3.970.0",
19701
- "@aws-sdk/middleware-host-header": "3.969.0",
19702
- "@aws-sdk/middleware-logger": "3.969.0",
19703
- "@aws-sdk/middleware-recursion-detection": "3.969.0",
19704
- "@aws-sdk/middleware-user-agent": "3.970.0",
19705
- "@aws-sdk/region-config-resolver": "3.969.0",
19706
- "@aws-sdk/types": "3.969.0",
19707
- "@aws-sdk/util-endpoints": "3.970.0",
19708
- "@aws-sdk/util-user-agent-browser": "3.969.0",
19709
- "@aws-sdk/util-user-agent-node": "3.971.0",
19713
+ "@aws-sdk/core": "3.972.0",
19714
+ "@aws-sdk/middleware-host-header": "3.972.0",
19715
+ "@aws-sdk/middleware-logger": "3.972.0",
19716
+ "@aws-sdk/middleware-recursion-detection": "3.972.0",
19717
+ "@aws-sdk/middleware-user-agent": "3.972.0",
19718
+ "@aws-sdk/region-config-resolver": "3.972.0",
19719
+ "@aws-sdk/types": "3.972.0",
19720
+ "@aws-sdk/util-endpoints": "3.972.0",
19721
+ "@aws-sdk/util-user-agent-browser": "3.972.0",
19722
+ "@aws-sdk/util-user-agent-node": "3.972.0",
19710
19723
  "@smithy/config-resolver": "^4.4.6",
19711
19724
  "@smithy/core": "^3.20.6",
19712
19725
  "@smithy/fetch-http-handler": "^5.3.9",
@@ -19737,7 +19750,7 @@ var init_package = __esm({
19737
19750
  devDependencies: {
19738
19751
  concurrently: "7.0.0",
19739
19752
  "downlevel-dts": "0.10.1",
19740
- rimraf: "5.0.10",
19753
+ premove: "4.0.0",
19741
19754
  typescript: "~5.8.3"
19742
19755
  },
19743
19756
  typesVersions: {
@@ -21050,7 +21063,7 @@ var require_package3 = __commonJS({
21050
21063
  module2.exports = {
21051
21064
  name: "@aws-sdk/client-sso",
21052
21065
  description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",
21053
- version: "3.971.0",
21066
+ version: "3.972.0",
21054
21067
  scripts: {
21055
21068
  build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
21056
21069
  "build:cjs": "node ../../scripts/compilation/inline client-sso",
@@ -21058,7 +21071,7 @@ var require_package3 = __commonJS({
21058
21071
  "build:include:deps": 'yarn g:turbo run build -F="$npm_package_name"',
21059
21072
  "build:types": "tsc -p tsconfig.types.json",
21060
21073
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
21061
- clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
21074
+ clean: "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
21062
21075
  "extract:docs": "api-extractor run --local",
21063
21076
  "generate:client": "node ../../scripts/generate-clients/single-service --solo sso",
21064
21077
  "test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs"
@@ -21070,16 +21083,16 @@ var require_package3 = __commonJS({
21070
21083
  dependencies: {
21071
21084
  "@aws-crypto/sha256-browser": "5.2.0",
21072
21085
  "@aws-crypto/sha256-js": "5.2.0",
21073
- "@aws-sdk/core": "3.970.0",
21074
- "@aws-sdk/middleware-host-header": "3.969.0",
21075
- "@aws-sdk/middleware-logger": "3.969.0",
21076
- "@aws-sdk/middleware-recursion-detection": "3.969.0",
21077
- "@aws-sdk/middleware-user-agent": "3.970.0",
21078
- "@aws-sdk/region-config-resolver": "3.969.0",
21079
- "@aws-sdk/types": "3.969.0",
21080
- "@aws-sdk/util-endpoints": "3.970.0",
21081
- "@aws-sdk/util-user-agent-browser": "3.969.0",
21082
- "@aws-sdk/util-user-agent-node": "3.971.0",
21086
+ "@aws-sdk/core": "3.972.0",
21087
+ "@aws-sdk/middleware-host-header": "3.972.0",
21088
+ "@aws-sdk/middleware-logger": "3.972.0",
21089
+ "@aws-sdk/middleware-recursion-detection": "3.972.0",
21090
+ "@aws-sdk/middleware-user-agent": "3.972.0",
21091
+ "@aws-sdk/region-config-resolver": "3.972.0",
21092
+ "@aws-sdk/types": "3.972.0",
21093
+ "@aws-sdk/util-endpoints": "3.972.0",
21094
+ "@aws-sdk/util-user-agent-browser": "3.972.0",
21095
+ "@aws-sdk/util-user-agent-node": "3.972.0",
21083
21096
  "@smithy/config-resolver": "^4.4.6",
21084
21097
  "@smithy/core": "^3.20.6",
21085
21098
  "@smithy/fetch-http-handler": "^5.3.9",
@@ -21112,7 +21125,7 @@ var require_package3 = __commonJS({
21112
21125
  "@types/node": "^20.14.8",
21113
21126
  concurrently: "7.0.0",
21114
21127
  "downlevel-dts": "0.10.1",
21115
- rimraf: "5.0.10",
21128
+ premove: "4.0.0",
21116
21129
  typescript: "~5.8.3"
21117
21130
  },
21118
21131
  engines: {
@@ -24521,7 +24534,7 @@ var require_dist_cjs65 = __commonJS({
24521
24534
  streamEnded = true;
24522
24535
  });
24523
24536
  while (!generationEnded) {
24524
- const value = await new Promise((resolve5) => setTimeout(() => resolve5(records.shift()), 0));
24537
+ const value = await new Promise((resolve6) => setTimeout(() => resolve6(records.shift()), 0));
24525
24538
  if (value) {
24526
24539
  yield value;
24527
24540
  }
@@ -25056,7 +25069,9 @@ var require_dist_cjs66 = __commonJS({
25056
25069
  var _CBo = "ContentBlock";
25057
25070
  var _CC = "CitationsConfig";
25058
25071
  var _CCB = "CitationsContentBlock";
25059
- var _CD = "CitationsDelta";
25072
+ var _CD = "CacheDetail";
25073
+ var _CDL = "CacheDetailsList";
25074
+ var _CDi = "CitationsDelta";
25060
25075
  var _CE = "ConflictException";
25061
25076
  var _CGC = "CitationGeneratedContent";
25062
25077
  var _CGCL = "CitationGeneratedContentList";
@@ -25275,6 +25290,7 @@ var require_dist_cjs66 = __commonJS({
25275
25290
  var _cBS = "contentBlockStart";
25276
25291
  var _cBSo = "contentBlockStop";
25277
25292
  var _cC = "citationsContent";
25293
+ var _cD = "cacheDetails";
25278
25294
  var _cFS = "claimsFalseScenario";
25279
25295
  var _cGP = "contextualGroundingPolicy";
25280
25296
  var _cGPU = "contextualGroundingPolicyUnits";
@@ -25436,7 +25452,7 @@ var require_dist_cjs66 = __commonJS({
25436
25452
  var _str = "stream";
25437
25453
  var _stre = "streaming";
25438
25454
  var _sy = "system";
25439
- var _t = "type";
25455
+ var _t = "ttl";
25440
25456
  var _tA = "translationAmbiguous";
25441
25457
  var _tC = "toolConfig";
25442
25458
  var _tCe = "textCharacters";
@@ -25463,6 +25479,7 @@ var require_dist_cjs66 = __commonJS({
25463
25479
  var _tr = "trace";
25464
25480
  var _tra = "translation";
25465
25481
  var _tran = "translations";
25482
+ var _ty = "type";
25466
25483
  var _u = "usage";
25467
25484
  var _uC = "untranslatedClaims";
25468
25485
  var _uP = "untranslatedPremises";
@@ -25576,13 +25593,22 @@ var require_dist_cjs66 = __commonJS({
25576
25593
  [_b],
25577
25594
  [[() => PartBody, 0]]
25578
25595
  ];
25596
+ var CacheDetail$ = [
25597
+ 3,
25598
+ n04,
25599
+ _CD,
25600
+ 0,
25601
+ [_t, _iT3],
25602
+ [0, 1],
25603
+ 2
25604
+ ];
25579
25605
  var CachePointBlock$ = [
25580
25606
  3,
25581
25607
  n04,
25582
25608
  _CPB,
25583
25609
  0,
25584
- [_t],
25585
- [0],
25610
+ [_ty, _t],
25611
+ [0, 0],
25586
25612
  1
25587
25613
  ];
25588
25614
  var Citation$ = [
@@ -25613,7 +25639,7 @@ var require_dist_cjs66 = __commonJS({
25613
25639
  var CitationsDelta$ = [
25614
25640
  3,
25615
25641
  n04,
25616
- _CD,
25642
+ _CDi,
25617
25643
  0,
25618
25644
  [_ti, _s4, _sC, _l],
25619
25645
  [0, 0, () => CitationSourceContentListDelta, () => CitationLocation$]
@@ -25862,7 +25888,7 @@ var require_dist_cjs66 = __commonJS({
25862
25888
  n04,
25863
25889
  _GARLW,
25864
25890
  0,
25865
- [_t, _p, _cl],
25891
+ [_ty, _p, _cl],
25866
25892
  [0, [() => GuardrailAutomatedReasoningStatementList, 0], [() => GuardrailAutomatedReasoningStatementList, 0]]
25867
25893
  ];
25868
25894
  var GuardrailAutomatedReasoningNoTranslationsFinding$ = [
@@ -25966,7 +25992,7 @@ var require_dist_cjs66 = __commonJS({
25966
25992
  n04,
25967
25993
  _GCF,
25968
25994
  0,
25969
- [_t, _conf, _a16, _fS, _de],
25995
+ [_ty, _conf, _a16, _fS, _de],
25970
25996
  [0, 0, 0, 0, 2],
25971
25997
  3
25972
25998
  ];
@@ -25984,7 +26010,7 @@ var require_dist_cjs66 = __commonJS({
25984
26010
  n04,
25985
26011
  _GCGF,
25986
26012
  0,
25987
- [_t, _th, _sc, _a16, _de],
26013
+ [_ty, _th, _sc, _a16, _de],
25988
26014
  [0, 1, 1, 0, 2],
25989
26015
  4
25990
26016
  ];
@@ -26061,7 +26087,7 @@ var require_dist_cjs66 = __commonJS({
26061
26087
  n04,
26062
26088
  _GMW,
26063
26089
  0,
26064
- [_ma, _t, _a16, _de],
26090
+ [_ma, _ty, _a16, _de],
26065
26091
  [0, 0, 0, 2],
26066
26092
  3
26067
26093
  ];
@@ -26078,7 +26104,7 @@ var require_dist_cjs66 = __commonJS({
26078
26104
  n04,
26079
26105
  _GPEF,
26080
26106
  0,
26081
- [_ma, _t, _a16, _de],
26107
+ [_ma, _ty, _a16, _de],
26082
26108
  [0, 0, 0, 2],
26083
26109
  3
26084
26110
  ];
@@ -26130,7 +26156,7 @@ var require_dist_cjs66 = __commonJS({
26130
26156
  n04,
26131
26157
  _GT,
26132
26158
  0,
26133
- [_n, _t, _a16, _de],
26159
+ [_n, _ty, _a16, _de],
26134
26160
  [0, 0, 0, 2],
26135
26161
  3
26136
26162
  ];
@@ -26445,7 +26471,7 @@ var require_dist_cjs66 = __commonJS({
26445
26471
  n04,
26446
26472
  _ST2,
26447
26473
  0,
26448
- [_t],
26474
+ [_ty],
26449
26475
  [0],
26450
26476
  1
26451
26477
  ];
@@ -26517,8 +26543,8 @@ var require_dist_cjs66 = __commonJS({
26517
26543
  n04,
26518
26544
  _TU,
26519
26545
  0,
26520
- [_iT3, _oT, _tT3, _cRIT, _cWIT],
26521
- [1, 1, 1, 1, 1],
26546
+ [_iT3, _oT, _tT3, _cRIT, _cWIT, _cD],
26547
+ [1, 1, 1, 1, 1, () => CacheDetailsList],
26522
26548
  3
26523
26549
  ];
26524
26550
  var ToolConfiguration$ = [
@@ -26535,7 +26561,7 @@ var require_dist_cjs66 = __commonJS({
26535
26561
  n04,
26536
26562
  _TRB,
26537
26563
  0,
26538
- [_tUI, _co3, _st, _t],
26564
+ [_tUI, _co3, _st, _ty],
26539
26565
  [0, [() => ToolResultContentBlocks, 0], 0, 0],
26540
26566
  2
26541
26567
  ];
@@ -26544,7 +26570,7 @@ var require_dist_cjs66 = __commonJS({
26544
26570
  n04,
26545
26571
  _TRBS,
26546
26572
  0,
26547
- [_tUI, _t, _st],
26573
+ [_tUI, _ty, _st],
26548
26574
  [0, 0, 0],
26549
26575
  1
26550
26576
  ];
@@ -26562,7 +26588,7 @@ var require_dist_cjs66 = __commonJS({
26562
26588
  n04,
26563
26589
  _TUB,
26564
26590
  0,
26565
- [_tUI, _n, _i, _t],
26591
+ [_tUI, _n, _i, _ty],
26566
26592
  [0, 0, 15, 0],
26567
26593
  3
26568
26594
  ];
@@ -26580,7 +26606,7 @@ var require_dist_cjs66 = __commonJS({
26580
26606
  n04,
26581
26607
  _TUBS,
26582
26608
  0,
26583
- [_tUI, _n, _t],
26609
+ [_tUI, _n, _ty],
26584
26610
  [0, 0, 0],
26585
26611
  2
26586
26612
  ];
@@ -26622,6 +26648,13 @@ var require_dist_cjs66 = __commonJS({
26622
26648
  0
26623
26649
  ]
26624
26650
  ];
26651
+ var CacheDetailsList = [
26652
+ 1,
26653
+ n04,
26654
+ _CDL,
26655
+ 0,
26656
+ () => CacheDetail$
26657
+ ];
26625
26658
  var CitationGeneratedContentList = [
26626
26659
  1,
26627
26660
  n04,
@@ -27475,6 +27508,10 @@ var require_dist_cjs66 = __commonJS({
27475
27508
  WEBM: "webm",
27476
27509
  X_AAC: "x-aac"
27477
27510
  };
27511
+ var CacheTTL = {
27512
+ FIVE_MINUTES: "5m",
27513
+ ONE_HOUR: "1h"
27514
+ };
27478
27515
  var CachePointType = {
27479
27516
  DEFAULT: "default"
27480
27517
  };
@@ -27590,8 +27627,10 @@ var require_dist_cjs66 = __commonJS({
27590
27627
  exports2.BedrockRuntimeServiceException$ = BedrockRuntimeServiceException$;
27591
27628
  exports2.BidirectionalInputPayloadPart$ = BidirectionalInputPayloadPart$;
27592
27629
  exports2.BidirectionalOutputPayloadPart$ = BidirectionalOutputPayloadPart$;
27630
+ exports2.CacheDetail$ = CacheDetail$;
27593
27631
  exports2.CachePointBlock$ = CachePointBlock$;
27594
27632
  exports2.CachePointType = CachePointType;
27633
+ exports2.CacheTTL = CacheTTL;
27595
27634
  exports2.Citation$ = Citation$;
27596
27635
  exports2.CitationGeneratedContent$ = CitationGeneratedContent$;
27597
27636
  exports2.CitationLocation$ = CitationLocation$;
@@ -34950,13 +34989,44 @@ function parseTargets(targets) {
34950
34989
  if (!targets || typeof targets !== "string") {
34951
34990
  return [];
34952
34991
  }
34953
- return targets.split(/\s+/).filter((f4) => f4.length > 0);
34992
+ return targets.split(/[\s,]+/).filter((f4) => f4.length > 0);
34954
34993
  }
34955
- var searchSchema, querySchema, extractSchema, delegateSchema, bashSchema, attemptCompletionSchema, searchToolDefinition, queryToolDefinition, extractToolDefinition, delegateToolDefinition, attemptCompletionToolDefinition, bashToolDefinition, searchDescription, queryDescription, extractDescription, delegateDescription, bashDescription, DEFAULT_VALID_TOOLS;
34994
+ function parseAndResolvePaths(pathStr, cwd) {
34995
+ if (!pathStr) return [];
34996
+ const paths = pathStr.split(",").map((p4) => p4.trim()).filter((p4) => p4.length > 0);
34997
+ return paths.map((p4) => {
34998
+ if ((0, import_path5.isAbsolute)(p4)) {
34999
+ return p4;
35000
+ }
35001
+ return cwd ? (0, import_path5.resolve)(cwd, p4) : p4;
35002
+ });
35003
+ }
35004
+ function resolveTargetPath(target, cwd) {
35005
+ const searchStart = target.length > 2 && target[1] === ":" && /[a-zA-Z]/.test(target[0]) ? 2 : 0;
35006
+ const colonIdx = target.indexOf(":", searchStart);
35007
+ const hashIdx = target.indexOf("#");
35008
+ let filePart, suffix;
35009
+ if (colonIdx !== -1 && (hashIdx === -1 || colonIdx < hashIdx)) {
35010
+ filePart = target.substring(0, colonIdx);
35011
+ suffix = target.substring(colonIdx);
35012
+ } else if (hashIdx !== -1) {
35013
+ filePart = target.substring(0, hashIdx);
35014
+ suffix = target.substring(hashIdx);
35015
+ } else {
35016
+ filePart = target;
35017
+ suffix = "";
35018
+ }
35019
+ if (!(0, import_path5.isAbsolute)(filePart) && cwd) {
35020
+ filePart = (0, import_path5.resolve)(cwd, filePart);
35021
+ }
35022
+ return filePart + suffix;
35023
+ }
35024
+ var import_path5, searchSchema, querySchema, extractSchema, delegateSchema, bashSchema, attemptCompletionSchema, searchToolDefinition, queryToolDefinition, extractToolDefinition, delegateToolDefinition, attemptCompletionToolDefinition, bashToolDefinition, searchDescription, queryDescription, extractDescription, delegateDescription, bashDescription, DEFAULT_VALID_TOOLS;
34956
35025
  var init_common2 = __esm({
34957
35026
  "src/tools/common.js"() {
34958
35027
  "use strict";
34959
35028
  init_zod();
35029
+ import_path5 = require("path");
34960
35030
  searchSchema = external_exports.object({
34961
35031
  query: external_exports.string().describe("Search query with Elasticsearch syntax. Use quotes for exact matches, AND/OR for boolean logic, - for negation."),
34962
35032
  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.')
@@ -38944,10 +39014,10 @@ var init_esm3 = __esm({
38944
39014
  * Return a void Promise that resolves once the stream ends.
38945
39015
  */
38946
39016
  async promise() {
38947
- return new Promise((resolve5, reject2) => {
39017
+ return new Promise((resolve6, reject2) => {
38948
39018
  this.on(DESTROYED, () => reject2(new Error("stream destroyed")));
38949
39019
  this.on("error", (er) => reject2(er));
38950
- this.on("end", () => resolve5());
39020
+ this.on("end", () => resolve6());
38951
39021
  });
38952
39022
  }
38953
39023
  /**
@@ -38971,7 +39041,7 @@ var init_esm3 = __esm({
38971
39041
  return Promise.resolve({ done: false, value: res });
38972
39042
  if (this[EOF])
38973
39043
  return stop();
38974
- let resolve5;
39044
+ let resolve6;
38975
39045
  let reject2;
38976
39046
  const onerr = (er) => {
38977
39047
  this.off("data", ondata);
@@ -38985,19 +39055,19 @@ var init_esm3 = __esm({
38985
39055
  this.off("end", onend);
38986
39056
  this.off(DESTROYED, ondestroy);
38987
39057
  this.pause();
38988
- resolve5({ value, done: !!this[EOF] });
39058
+ resolve6({ value, done: !!this[EOF] });
38989
39059
  };
38990
39060
  const onend = () => {
38991
39061
  this.off("error", onerr);
38992
39062
  this.off("data", ondata);
38993
39063
  this.off(DESTROYED, ondestroy);
38994
39064
  stop();
38995
- resolve5({ done: true, value: void 0 });
39065
+ resolve6({ done: true, value: void 0 });
38996
39066
  };
38997
39067
  const ondestroy = () => onerr(new Error("stream destroyed"));
38998
39068
  return new Promise((res2, rej) => {
38999
39069
  reject2 = rej;
39000
- resolve5 = res2;
39070
+ resolve6 = res2;
39001
39071
  this.once(DESTROYED, ondestroy);
39002
39072
  this.once("error", onerr);
39003
39073
  this.once("end", onend);
@@ -39977,9 +40047,9 @@ var init_esm4 = __esm({
39977
40047
  if (this.#asyncReaddirInFlight) {
39978
40048
  await this.#asyncReaddirInFlight;
39979
40049
  } else {
39980
- let resolve5 = () => {
40050
+ let resolve6 = () => {
39981
40051
  };
39982
- this.#asyncReaddirInFlight = new Promise((res) => resolve5 = res);
40052
+ this.#asyncReaddirInFlight = new Promise((res) => resolve6 = res);
39983
40053
  try {
39984
40054
  for (const e4 of await this.#fs.promises.readdir(fullpath, {
39985
40055
  withFileTypes: true
@@ -39992,7 +40062,7 @@ var init_esm4 = __esm({
39992
40062
  children.provisional = 0;
39993
40063
  }
39994
40064
  this.#asyncReaddirInFlight = void 0;
39995
- resolve5();
40065
+ resolve6();
39996
40066
  }
39997
40067
  return children.slice(0, children.provisional);
39998
40068
  }
@@ -40222,7 +40292,7 @@ var init_esm4 = __esm({
40222
40292
  *
40223
40293
  * @internal
40224
40294
  */
40225
- constructor(cwd = process.cwd(), pathImpl, sep4, { nocase, childrenCacheSize = 16 * 1024, fs: fs10 = defaultFS } = {}) {
40295
+ constructor(cwd = process.cwd(), pathImpl, sep5, { nocase, childrenCacheSize = 16 * 1024, fs: fs10 = defaultFS } = {}) {
40226
40296
  this.#fs = fsFromOption(fs10);
40227
40297
  if (cwd instanceof URL || cwd.startsWith("file://")) {
40228
40298
  cwd = (0, import_node_url.fileURLToPath)(cwd);
@@ -40233,7 +40303,7 @@ var init_esm4 = __esm({
40233
40303
  this.#resolveCache = new ResolveCache();
40234
40304
  this.#resolvePosixCache = new ResolveCache();
40235
40305
  this.#children = new ChildrenCache(childrenCacheSize);
40236
- const split = cwdPath.substring(this.rootPath.length).split(sep4);
40306
+ const split = cwdPath.substring(this.rootPath.length).split(sep5);
40237
40307
  if (split.length === 1 && !split[0]) {
40238
40308
  split.pop();
40239
40309
  }
@@ -42020,7 +42090,7 @@ function createWrappedTools(baseTools) {
42020
42090
  }
42021
42091
  return wrappedTools;
42022
42092
  }
42023
- var import_child_process6, import_util11, import_crypto3, import_events, import_fs5, import_fs6, import_path5, toolCallEmitter, activeToolExecutions, wrapToolWithEmitter, listFilesTool, searchFilesTool, listFilesToolInstance, searchFilesToolInstance;
42093
+ var import_child_process6, import_util11, import_crypto3, import_events, import_fs5, import_fs6, import_path6, toolCallEmitter, activeToolExecutions, wrapToolWithEmitter, listFilesTool, searchFilesTool, listFilesToolInstance, searchFilesToolInstance;
42024
42094
  var init_probeTool = __esm({
42025
42095
  "src/agent/probeTool.js"() {
42026
42096
  "use strict";
@@ -42031,7 +42101,7 @@ var init_probeTool = __esm({
42031
42101
  import_events = require("events");
42032
42102
  import_fs5 = __toESM(require("fs"), 1);
42033
42103
  import_fs6 = require("fs");
42034
- import_path5 = __toESM(require("path"), 1);
42104
+ import_path6 = __toESM(require("path"), 1);
42035
42105
  init_esm5();
42036
42106
  init_symlink_utils();
42037
42107
  toolCallEmitter = new import_events.EventEmitter();
@@ -42120,17 +42190,17 @@ var init_probeTool = __esm({
42120
42190
  execute: async (params) => {
42121
42191
  const { directory = ".", workingDirectory } = params;
42122
42192
  const baseCwd = workingDirectory || process.cwd();
42123
- const secureBaseDir = import_path5.default.resolve(baseCwd);
42193
+ const secureBaseDir = import_path6.default.resolve(baseCwd);
42124
42194
  const isDependencyPath = directory.startsWith("/dep/") || directory.startsWith("go:") || directory.startsWith("js:") || directory.startsWith("rust:");
42125
42195
  let targetDir;
42126
- if (import_path5.default.isAbsolute(directory)) {
42127
- targetDir = import_path5.default.resolve(directory);
42128
- if (!isDependencyPath && !targetDir.startsWith(secureBaseDir + import_path5.default.sep) && targetDir !== secureBaseDir) {
42196
+ if (import_path6.default.isAbsolute(directory)) {
42197
+ targetDir = import_path6.default.resolve(directory);
42198
+ if (!isDependencyPath && !targetDir.startsWith(secureBaseDir + import_path6.default.sep) && targetDir !== secureBaseDir) {
42129
42199
  throw new Error(`Path traversal attempt detected. Cannot access directory outside workspace: ${directory}`);
42130
42200
  }
42131
42201
  } else {
42132
- targetDir = import_path5.default.resolve(secureBaseDir, directory);
42133
- if (!isDependencyPath && !targetDir.startsWith(secureBaseDir + import_path5.default.sep) && targetDir !== secureBaseDir) {
42202
+ targetDir = import_path6.default.resolve(secureBaseDir, directory);
42203
+ if (!isDependencyPath && !targetDir.startsWith(secureBaseDir + import_path6.default.sep) && targetDir !== secureBaseDir) {
42134
42204
  throw new Error(`Path traversal attempt detected. Access denied: ${directory}`);
42135
42205
  }
42136
42206
  }
@@ -42147,7 +42217,7 @@ var init_probeTool = __esm({
42147
42217
  return `${(size / (1024 * 1024 * 1024)).toFixed(1)}G`;
42148
42218
  };
42149
42219
  const entries = await Promise.all(files.map(async (file) => {
42150
- const fullPath = import_path5.default.join(targetDir, file.name);
42220
+ const fullPath = import_path6.default.join(targetDir, file.name);
42151
42221
  const entryType = await getEntryType(file, fullPath);
42152
42222
  return {
42153
42223
  name: file.name,
@@ -42184,17 +42254,17 @@ var init_probeTool = __esm({
42184
42254
  throw new Error("Pattern is required for file search");
42185
42255
  }
42186
42256
  const baseCwd = workingDirectory || process.cwd();
42187
- const secureBaseDir = import_path5.default.resolve(baseCwd);
42257
+ const secureBaseDir = import_path6.default.resolve(baseCwd);
42188
42258
  const isDependencyPath = directory.startsWith("/dep/") || directory.startsWith("go:") || directory.startsWith("js:") || directory.startsWith("rust:");
42189
42259
  let targetDir;
42190
- if (import_path5.default.isAbsolute(directory)) {
42191
- targetDir = import_path5.default.resolve(directory);
42192
- if (!isDependencyPath && !targetDir.startsWith(secureBaseDir + import_path5.default.sep) && targetDir !== secureBaseDir) {
42260
+ if (import_path6.default.isAbsolute(directory)) {
42261
+ targetDir = import_path6.default.resolve(directory);
42262
+ if (!isDependencyPath && !targetDir.startsWith(secureBaseDir + import_path6.default.sep) && targetDir !== secureBaseDir) {
42193
42263
  throw new Error(`Path traversal attempt detected. Cannot access directory outside workspace: ${directory}`);
42194
42264
  }
42195
42265
  } else {
42196
- targetDir = import_path5.default.resolve(secureBaseDir, directory);
42197
- if (!isDependencyPath && !targetDir.startsWith(secureBaseDir + import_path5.default.sep) && targetDir !== secureBaseDir) {
42266
+ targetDir = import_path6.default.resolve(secureBaseDir, directory);
42267
+ if (!isDependencyPath && !targetDir.startsWith(secureBaseDir + import_path6.default.sep) && targetDir !== secureBaseDir) {
42198
42268
  throw new Error(`Path traversal attempt detected. Access denied: ${directory}`);
42199
42269
  }
42200
42270
  }
@@ -42240,7 +42310,7 @@ function createMockProvider() {
42240
42310
  provider: "mock",
42241
42311
  // Mock the doGenerate method used by Vercel AI SDK
42242
42312
  doGenerate: async ({ messages, tools: tools2 }) => {
42243
- await new Promise((resolve5) => setTimeout(resolve5, 10));
42313
+ await new Promise((resolve6) => setTimeout(resolve6, 10));
42244
42314
  return {
42245
42315
  text: "This is a mock response for testing",
42246
42316
  toolCalls: [],
@@ -67995,7 +68065,7 @@ var require_bk = __commonJS({
67995
68065
  return xs;
67996
68066
  }
67997
68067
  function buildBlockGraph(g4, layering, root2, reverseSep) {
67998
- var blockGraph = new Graph(), graphLabel = g4.graph(), sepFn = sep4(graphLabel.nodesep, graphLabel.edgesep, reverseSep);
68068
+ var blockGraph = new Graph(), graphLabel = g4.graph(), sepFn = sep5(graphLabel.nodesep, graphLabel.edgesep, reverseSep);
67999
68069
  _.forEach(layering, function(layer) {
68000
68070
  var u4;
68001
68071
  _.forEach(layer, function(v4) {
@@ -68085,7 +68155,7 @@ var require_bk = __commonJS({
68085
68155
  alignCoordinates(xss, smallestWidth);
68086
68156
  return balance(xss, g4.graph().align);
68087
68157
  }
68088
- function sep4(nodeSep, edgeSep, reverseSep) {
68158
+ function sep5(nodeSep, edgeSep, reverseSep) {
68089
68159
  return function(g4, v4, w4) {
68090
68160
  var vLabel = g4.node(v4);
68091
68161
  var wLabel = g4.node(w4);
@@ -75379,7 +75449,7 @@ var require_compile = __commonJS({
75379
75449
  const schOrFunc = root2.refs[ref];
75380
75450
  if (schOrFunc)
75381
75451
  return schOrFunc;
75382
- let _sch = resolve5.call(this, root2, ref);
75452
+ let _sch = resolve6.call(this, root2, ref);
75383
75453
  if (_sch === void 0) {
75384
75454
  const schema = (_a16 = root2.localRefs) === null || _a16 === void 0 ? void 0 : _a16[ref];
75385
75455
  const { schemaId } = this.opts;
@@ -75406,7 +75476,7 @@ var require_compile = __commonJS({
75406
75476
  function sameSchemaEnv(s1, s22) {
75407
75477
  return s1.schema === s22.schema && s1.root === s22.root && s1.baseId === s22.baseId;
75408
75478
  }
75409
- function resolve5(root2, ref) {
75479
+ function resolve6(root2, ref) {
75410
75480
  let sch;
75411
75481
  while (typeof (sch = this.refs[ref]) == "string")
75412
75482
  ref = sch;
@@ -75981,7 +76051,7 @@ var require_fast_uri = __commonJS({
75981
76051
  }
75982
76052
  return uri;
75983
76053
  }
75984
- function resolve5(baseURI, relativeURI, options) {
76054
+ function resolve6(baseURI, relativeURI, options) {
75985
76055
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
75986
76056
  const resolved = resolveComponent(parse6(baseURI, schemelessOptions), parse6(relativeURI, schemelessOptions), schemelessOptions, true);
75987
76057
  schemelessOptions.skipEscape = true;
@@ -76208,7 +76278,7 @@ var require_fast_uri = __commonJS({
76208
76278
  var fastUri = {
76209
76279
  SCHEMES,
76210
76280
  normalize: normalize3,
76211
- resolve: resolve5,
76281
+ resolve: resolve6,
76212
76282
  resolveComponent,
76213
76283
  equal,
76214
76284
  serialize,
@@ -80538,13 +80608,13 @@ function loadMCPConfiguration() {
80538
80608
  // Environment variable path
80539
80609
  process.env.MCP_CONFIG_PATH,
80540
80610
  // Local project paths
80541
- (0, import_path6.join)(process.cwd(), ".mcp", "config.json"),
80542
- (0, import_path6.join)(process.cwd(), "mcp.config.json"),
80611
+ (0, import_path7.join)(process.cwd(), ".mcp", "config.json"),
80612
+ (0, import_path7.join)(process.cwd(), "mcp.config.json"),
80543
80613
  // Home directory paths
80544
- (0, import_path6.join)((0, import_os3.homedir)(), ".config", "probe", "mcp.json"),
80545
- (0, import_path6.join)((0, import_os3.homedir)(), ".mcp", "config.json"),
80614
+ (0, import_path7.join)((0, import_os3.homedir)(), ".config", "probe", "mcp.json"),
80615
+ (0, import_path7.join)((0, import_os3.homedir)(), ".mcp", "config.json"),
80546
80616
  // Claude-style config location
80547
- (0, import_path6.join)((0, import_os3.homedir)(), "Library", "Application Support", "Claude", "mcp_config.json")
80617
+ (0, import_path7.join)((0, import_os3.homedir)(), "Library", "Application Support", "Claude", "mcp_config.json")
80548
80618
  ].filter(Boolean);
80549
80619
  let config = null;
80550
80620
  for (const configPath of configPaths) {
@@ -80662,16 +80732,16 @@ function parseEnabledServers(config) {
80662
80732
  }
80663
80733
  return servers;
80664
80734
  }
80665
- var import_fs7, import_path6, import_os3, import_url4, __filename4, __dirname4, DEFAULT_TIMEOUT, MAX_TIMEOUT, DEFAULT_CONFIG;
80735
+ var import_fs7, import_path7, import_os3, import_url4, __filename4, __dirname4, DEFAULT_TIMEOUT, MAX_TIMEOUT, DEFAULT_CONFIG;
80666
80736
  var init_config = __esm({
80667
80737
  "src/agent/mcp/config.js"() {
80668
80738
  "use strict";
80669
80739
  import_fs7 = require("fs");
80670
- import_path6 = require("path");
80740
+ import_path7 = require("path");
80671
80741
  import_os3 = require("os");
80672
80742
  import_url4 = require("url");
80673
80743
  __filename4 = (0, import_url4.fileURLToPath)("file:///");
80674
- __dirname4 = (0, import_path6.dirname)(__filename4);
80744
+ __dirname4 = (0, import_path7.dirname)(__filename4);
80675
80745
  DEFAULT_TIMEOUT = 3e4;
80676
80746
  MAX_TIMEOUT = 6e5;
80677
80747
  DEFAULT_CONFIG = {
@@ -80679,7 +80749,7 @@ var init_config = __esm({
80679
80749
  // Example probe server configuration
80680
80750
  "probe-local": {
80681
80751
  command: "node",
80682
- args: [(0, import_path6.join)(__dirname4, "../../../examples/chat/mcpServer.js")],
80752
+ args: [(0, import_path7.join)(__dirname4, "../../../examples/chat/mcpServer.js")],
80683
80753
  transport: "stdio",
80684
80754
  enabled: false
80685
80755
  },
@@ -81319,7 +81389,7 @@ function extractErrorInfo(error2) {
81319
81389
  };
81320
81390
  }
81321
81391
  function sleep(ms) {
81322
- return new Promise((resolve5) => setTimeout(resolve5, ms));
81392
+ return new Promise((resolve6) => setTimeout(resolve6, ms));
81323
81393
  }
81324
81394
  var DEFAULT_RETRYABLE_ERRORS, RetryManager;
81325
81395
  var init_RetryManager = __esm({
@@ -82153,7 +82223,7 @@ var init_built_in_server = __esm({
82153
82223
  }
82154
82224
  });
82155
82225
  this.registerHandlers();
82156
- return new Promise((resolve5, reject2) => {
82226
+ return new Promise((resolve6, reject2) => {
82157
82227
  this.httpServer.listen(this.port, this.host, async () => {
82158
82228
  const address = this.httpServer.address();
82159
82229
  this.port = address.port;
@@ -82163,7 +82233,7 @@ var init_built_in_server = __esm({
82163
82233
  console.log(`[MCP] Messages endpoint: http://${this.host}:${this.port}/messages`);
82164
82234
  }
82165
82235
  this.emit("ready", { host: this.host, port: this.port });
82166
- resolve5({ host: this.host, port: this.port });
82236
+ resolve6({ host: this.host, port: this.port });
82167
82237
  });
82168
82238
  this.httpServer.on("error", reject2);
82169
82239
  });
@@ -82382,7 +82452,7 @@ var init_built_in_server = __esm({
82382
82452
  * Parse request body as JSON
82383
82453
  */
82384
82454
  async parseRequestBody(req) {
82385
- return new Promise((resolve5, reject2) => {
82455
+ return new Promise((resolve6, reject2) => {
82386
82456
  let body = "";
82387
82457
  req.on("data", (chunk) => {
82388
82458
  body += chunk.toString();
@@ -82390,7 +82460,7 @@ var init_built_in_server = __esm({
82390
82460
  req.on("end", () => {
82391
82461
  try {
82392
82462
  const parsed = body ? JSON.parse(body) : null;
82393
- resolve5(parsed);
82463
+ resolve6(parsed);
82394
82464
  } catch (error2) {
82395
82465
  reject2(error2);
82396
82466
  }
@@ -82697,12 +82767,12 @@ data: ${JSON.stringify(data2)}
82697
82767
  }
82698
82768
  this.connections.clear();
82699
82769
  if (this.httpServer) {
82700
- return new Promise((resolve5) => {
82770
+ return new Promise((resolve6) => {
82701
82771
  this.httpServer.close(() => {
82702
82772
  if (this.debug) {
82703
82773
  console.log("[MCP] Built-in server stopped");
82704
82774
  }
82705
- resolve5();
82775
+ resolve6();
82706
82776
  });
82707
82777
  });
82708
82778
  }
@@ -82801,12 +82871,12 @@ async function createEnhancedClaudeCLIEngine(options = {}) {
82801
82871
  console.log("[DEBUG] Built-in MCP server started");
82802
82872
  console.log("[DEBUG] MCP URL:", `http://${host}:${port}/mcp`);
82803
82873
  }
82804
- mcpConfigPath = import_path7.default.join(import_os4.default.tmpdir(), `probe-mcp-${session.id}.json`);
82874
+ mcpConfigPath = import_path8.default.join(import_os4.default.tmpdir(), `probe-mcp-${session.id}.json`);
82805
82875
  const mcpConfig = {
82806
82876
  mcpServers: {
82807
82877
  probe: {
82808
82878
  command: "node",
82809
- args: [import_path7.default.join(process.cwd(), "mcp-probe-server.js")],
82879
+ args: [import_path8.default.join(process.cwd(), "mcp-probe-server.js")],
82810
82880
  env: {
82811
82881
  PROBE_WORKSPACE: process.cwd(),
82812
82882
  DEBUG: debug ? "true" : "false"
@@ -82975,8 +83045,8 @@ ${opts.schema}`;
82975
83045
  break;
82976
83046
  }
82977
83047
  } else if (!processEnded) {
82978
- await new Promise((resolve5) => {
82979
- resolver = resolve5;
83048
+ await new Promise((resolve6) => {
83049
+ resolver = resolve6;
82980
83050
  });
82981
83051
  }
82982
83052
  }
@@ -83175,14 +83245,14 @@ function combinePrompts(systemPrompt, customPrompt, agent) {
83175
83245
  }
83176
83246
  return systemPrompt || "";
83177
83247
  }
83178
- var import_child_process7, import_crypto5, import_promises2, import_path7, import_os4, import_events3;
83248
+ var import_child_process7, import_crypto5, import_promises2, import_path8, import_os4, import_events3;
83179
83249
  var init_enhanced_claude_code = __esm({
83180
83250
  "src/agent/engines/enhanced-claude-code.js"() {
83181
83251
  "use strict";
83182
83252
  import_child_process7 = require("child_process");
83183
83253
  import_crypto5 = require("crypto");
83184
83254
  import_promises2 = __toESM(require("fs/promises"), 1);
83185
- import_path7 = __toESM(require("path"), 1);
83255
+ import_path8 = __toESM(require("path"), 1);
83186
83256
  import_os4 = __toESM(require("os"), 1);
83187
83257
  import_events3 = require("events");
83188
83258
  init_built_in_server();
@@ -83240,12 +83310,12 @@ async function createCodexEngine(options = {}) {
83240
83310
  }
83241
83311
  }
83242
83312
  if (message.id !== void 0 && pendingRequests.has(message.id)) {
83243
- const { resolve: resolve5, reject: reject2 } = pendingRequests.get(message.id);
83313
+ const { resolve: resolve6, reject: reject2 } = pendingRequests.get(message.id);
83244
83314
  pendingRequests.delete(message.id);
83245
83315
  if (message.error) {
83246
83316
  reject2(new Error(message.error.message || JSON.stringify(message.error)));
83247
83317
  } else {
83248
- resolve5(message.result);
83318
+ resolve6(message.result);
83249
83319
  }
83250
83320
  }
83251
83321
  if (message.method === "codex/event" && message.params) {
@@ -83266,7 +83336,7 @@ async function createCodexEngine(options = {}) {
83266
83336
  });
83267
83337
  }
83268
83338
  function sendRequest(method, params = {}) {
83269
- return new Promise((resolve5, reject2) => {
83339
+ return new Promise((resolve6, reject2) => {
83270
83340
  const id = ++requestId;
83271
83341
  const request = {
83272
83342
  jsonrpc: "2.0",
@@ -83274,7 +83344,7 @@ async function createCodexEngine(options = {}) {
83274
83344
  method,
83275
83345
  params
83276
83346
  };
83277
- pendingRequests.set(id, { resolve: resolve5, reject: reject2 });
83347
+ pendingRequests.set(id, { resolve: resolve6, reject: reject2 });
83278
83348
  setTimeout(() => {
83279
83349
  if (pendingRequests.has(id)) {
83280
83350
  pendingRequests.delete(id);
@@ -83337,7 +83407,7 @@ ${prompt}`;
83337
83407
  const reqId = requestId + 1;
83338
83408
  let fullResponse = "";
83339
83409
  let gotSessionId = false;
83340
- const eventPromise = new Promise((resolve5) => {
83410
+ const eventPromise = new Promise((resolve6) => {
83341
83411
  eventHandlers.set(reqId, (eventParams) => {
83342
83412
  const msg = eventParams.msg;
83343
83413
  if (msg.type === "session_configured" && msg.session_id && !gotSessionId) {
@@ -83357,7 +83427,7 @@ ${prompt}`;
83357
83427
  });
83358
83428
  setTimeout(() => {
83359
83429
  eventHandlers.delete(reqId);
83360
- resolve5();
83430
+ resolve6();
83361
83431
  }, 6e5);
83362
83432
  });
83363
83433
  const resultPromise = sendRequest("tools/call", {
@@ -83539,7 +83609,7 @@ var ProbeAgent_exports = {};
83539
83609
  __export(ProbeAgent_exports, {
83540
83610
  ProbeAgent: () => ProbeAgent
83541
83611
  });
83542
- var import_dotenv, import_anthropic2, import_openai2, import_google2, import_ai2, import_crypto7, import_events4, import_fs8, import_promises3, import_path8, MAX_TOOL_ITERATIONS, MAX_HISTORY_MESSAGES, MAX_IMAGE_FILE_SIZE, ProbeAgent;
83612
+ var import_dotenv, import_anthropic2, import_openai2, import_google2, import_ai2, import_crypto7, import_events4, import_fs8, import_promises3, import_path9, MAX_TOOL_ITERATIONS, MAX_HISTORY_MESSAGES, MAX_IMAGE_FILE_SIZE, ProbeAgent;
83543
83613
  var init_ProbeAgent = __esm({
83544
83614
  "src/agent/ProbeAgent.js"() {
83545
83615
  "use strict";
@@ -83553,7 +83623,7 @@ var init_ProbeAgent = __esm({
83553
83623
  import_events4 = require("events");
83554
83624
  import_fs8 = require("fs");
83555
83625
  import_promises3 = require("fs/promises");
83556
- import_path8 = require("path");
83626
+ import_path9 = require("path");
83557
83627
  init_tokenCounter();
83558
83628
  init_InMemoryStorageAdapter();
83559
83629
  init_HookManager();
@@ -83880,7 +83950,7 @@ var init_ProbeAgent = __esm({
83880
83950
  if (!imagePath) {
83881
83951
  throw new Error("Image path is required");
83882
83952
  }
83883
- const filename = (0, import_path8.basename)(imagePath);
83953
+ const filename = (0, import_path9.basename)(imagePath);
83884
83954
  const extension = filename.toLowerCase().split(".").pop();
83885
83955
  if (!extension || !SUPPORTED_IMAGE_EXTENSIONS.includes(extension)) {
83886
83956
  throw new Error(`Invalid or unsupported image extension: ${extension}. Supported formats: ${SUPPORTED_IMAGE_EXTENSIONS.join(", ")}`);
@@ -84435,7 +84505,7 @@ var init_ProbeAgent = __esm({
84435
84505
  let resolvedPath2 = imagePath;
84436
84506
  if (!imagePath.includes("/") && !imagePath.includes("\\")) {
84437
84507
  for (const dir of listFilesDirectories) {
84438
- const potentialPath = (0, import_path8.resolve)(dir, imagePath);
84508
+ const potentialPath = (0, import_path9.resolve)(dir, imagePath);
84439
84509
  const loaded = await this.loadImageIfValid(potentialPath);
84440
84510
  if (loaded) {
84441
84511
  if (this.debug) {
@@ -84460,7 +84530,7 @@ var init_ProbeAgent = __esm({
84460
84530
  let match2;
84461
84531
  while ((match2 = fileHeaderPattern.exec(content)) !== null) {
84462
84532
  const filePath = match2[1].trim();
84463
- const dir = (0, import_path8.dirname)(filePath);
84533
+ const dir = (0, import_path9.dirname)(filePath);
84464
84534
  if (dir && dir !== ".") {
84465
84535
  directories.push(dir);
84466
84536
  if (this.debug) {
@@ -84505,17 +84575,17 @@ var init_ProbeAgent = __esm({
84505
84575
  const allowedDirs = this.allowedFolders && this.allowedFolders.length > 0 ? this.allowedFolders : [process.cwd()];
84506
84576
  let absolutePath;
84507
84577
  let isPathAllowed2 = false;
84508
- if ((0, import_path8.isAbsolute)(imagePath)) {
84509
- absolutePath = (0, import_path8.normalize)((0, import_path8.resolve)(imagePath));
84578
+ if ((0, import_path9.isAbsolute)(imagePath)) {
84579
+ absolutePath = (0, import_path9.normalize)((0, import_path9.resolve)(imagePath));
84510
84580
  isPathAllowed2 = allowedDirs.some((dir) => {
84511
- const normalizedDir = (0, import_path8.normalize)((0, import_path8.resolve)(dir));
84512
- return absolutePath === normalizedDir || absolutePath.startsWith(normalizedDir + import_path8.sep);
84581
+ const normalizedDir = (0, import_path9.normalize)((0, import_path9.resolve)(dir));
84582
+ return absolutePath === normalizedDir || absolutePath.startsWith(normalizedDir + import_path9.sep);
84513
84583
  });
84514
84584
  } else {
84515
84585
  for (const dir of allowedDirs) {
84516
- const normalizedDir = (0, import_path8.normalize)((0, import_path8.resolve)(dir));
84517
- const resolvedPath2 = (0, import_path8.normalize)((0, import_path8.resolve)(dir, imagePath));
84518
- if (resolvedPath2 === normalizedDir || resolvedPath2.startsWith(normalizedDir + import_path8.sep)) {
84586
+ const normalizedDir = (0, import_path9.normalize)((0, import_path9.resolve)(dir));
84587
+ const resolvedPath2 = (0, import_path9.normalize)((0, import_path9.resolve)(dir, imagePath));
84588
+ if (resolvedPath2 === normalizedDir || resolvedPath2.startsWith(normalizedDir + import_path9.sep)) {
84519
84589
  absolutePath = resolvedPath2;
84520
84590
  isPathAllowed2 = true;
84521
84591
  break;
@@ -85445,12 +85515,12 @@ ${toolResultContent}
85445
85515
  }
85446
85516
  } else if (this.toolImplementations[toolName]) {
85447
85517
  try {
85448
- let resolvedWorkingDirectory = this.allowedFolders && this.allowedFolders[0] || process.cwd();
85518
+ let resolvedWorkingDirectory = this.cwd || this.allowedFolders && this.allowedFolders[0] || process.cwd();
85449
85519
  if (params.workingDirectory) {
85450
- const requestedDir = (0, import_path8.resolve)(params.workingDirectory);
85520
+ const requestedDir = (0, import_path9.isAbsolute)(params.workingDirectory) ? (0, import_path9.resolve)(params.workingDirectory) : (0, import_path9.resolve)(resolvedWorkingDirectory, params.workingDirectory);
85451
85521
  const isWithinAllowed = !this.allowedFolders || this.allowedFolders.length === 0 || this.allowedFolders.some((folder) => {
85452
- const resolvedFolder = (0, import_path8.resolve)(folder);
85453
- return requestedDir === resolvedFolder || requestedDir.startsWith(resolvedFolder + import_path8.sep);
85522
+ const resolvedFolder = (0, import_path9.resolve)(folder);
85523
+ return requestedDir === resolvedFolder || requestedDir.startsWith(resolvedFolder + import_path9.sep);
85454
85524
  });
85455
85525
  if (isWithinAllowed) {
85456
85526
  resolvedWorkingDirectory = requestedDir;
@@ -86630,13 +86700,14 @@ var init_vercel = __esm({
86630
86700
  execute: async ({ query: searchQuery, path: path9, allow_tests, exact, maxTokens: paramMaxTokens, language }) => {
86631
86701
  try {
86632
86702
  const effectiveMaxTokens = paramMaxTokens || maxTokens;
86633
- let searchPath = path9 || options.cwd || ".";
86634
- if ((searchPath === "." || searchPath === "./") && options.cwd) {
86635
- if (debug) {
86636
- console.error(`Using cwd "${options.cwd}" instead of "${searchPath}"`);
86637
- }
86638
- searchPath = options.cwd;
86703
+ let searchPaths;
86704
+ if (path9) {
86705
+ searchPaths = parseAndResolvePaths(path9, options.cwd);
86639
86706
  }
86707
+ if (!searchPaths || searchPaths.length === 0) {
86708
+ searchPaths = [options.cwd || "."];
86709
+ }
86710
+ const searchPath = searchPaths.join(" ");
86640
86711
  if (debug) {
86641
86712
  console.error(`Executing search with query: "${searchQuery}", path: "${searchPath}", exact: ${exact ? "true" : "false"}, language: ${language || "all"}, session: ${sessionId || "none"}`);
86642
86713
  }
@@ -86674,13 +86745,14 @@ var init_vercel = __esm({
86674
86745
  inputSchema: querySchema,
86675
86746
  execute: async ({ pattern, path: path9, language, allow_tests }) => {
86676
86747
  try {
86677
- let queryPath = path9 || options.cwd || ".";
86678
- if ((queryPath === "." || queryPath === "./") && options.cwd) {
86679
- if (debug) {
86680
- console.error(`Using cwd "${options.cwd}" instead of "${queryPath}"`);
86681
- }
86682
- queryPath = options.cwd;
86748
+ let queryPaths;
86749
+ if (path9) {
86750
+ queryPaths = parseAndResolvePaths(path9, options.cwd);
86683
86751
  }
86752
+ if (!queryPaths || queryPaths.length === 0) {
86753
+ queryPaths = [options.cwd || "."];
86754
+ }
86755
+ const queryPath = queryPaths.join(" ");
86684
86756
  if (debug) {
86685
86757
  console.error(`Executing query with pattern: "${pattern}", path: "${queryPath}", language: ${language || "auto"}`);
86686
86758
  }
@@ -86741,7 +86813,8 @@ var init_vercel = __esm({
86741
86813
  format: effectiveFormat
86742
86814
  };
86743
86815
  } else if (targets) {
86744
- const files = parseTargets(targets);
86816
+ const parsedTargets = parseTargets(targets);
86817
+ const files = parsedTargets.map((target) => resolveTargetPath(target, effectiveCwd));
86745
86818
  let effectiveFormat = format2;
86746
86819
  if (outline && format2 === "outline-xml") {
86747
86820
  effectiveFormat = "xml";
@@ -87761,7 +87834,7 @@ async function executeBashCommand(command, options = {}) {
87761
87834
  } = options;
87762
87835
  let cwd = workingDirectory;
87763
87836
  try {
87764
- cwd = (0, import_path9.resolve)(cwd);
87837
+ cwd = (0, import_path10.resolve)(cwd);
87765
87838
  if (!(0, import_fs9.existsSync)(cwd)) {
87766
87839
  throw new Error(`Working directory does not exist: ${cwd}`);
87767
87840
  }
@@ -87783,7 +87856,7 @@ async function executeBashCommand(command, options = {}) {
87783
87856
  console.log(`[BashExecutor] Working directory: "${cwd}"`);
87784
87857
  console.log(`[BashExecutor] Timeout: ${timeout}ms`);
87785
87858
  }
87786
- return new Promise((resolve5, reject2) => {
87859
+ return new Promise((resolve6, reject2) => {
87787
87860
  const processEnv = {
87788
87861
  ...process.env,
87789
87862
  ...env
@@ -87800,7 +87873,7 @@ async function executeBashCommand(command, options = {}) {
87800
87873
  } else {
87801
87874
  const args = parseCommandForExecution(command);
87802
87875
  if (!args || args.length === 0) {
87803
- resolve5({
87876
+ resolve6({
87804
87877
  success: false,
87805
87878
  error: "Failed to parse command",
87806
87879
  stdout: "",
@@ -87885,7 +87958,7 @@ async function executeBashCommand(command, options = {}) {
87885
87958
  success = false;
87886
87959
  error2 = `Command exited with code ${code}`;
87887
87960
  }
87888
- resolve5({
87961
+ resolve6({
87889
87962
  success,
87890
87963
  error: error2,
87891
87964
  stdout: stdout.trim(),
@@ -87905,7 +87978,7 @@ async function executeBashCommand(command, options = {}) {
87905
87978
  if (debug) {
87906
87979
  console.log(`[BashExecutor] Spawn error:`, error2);
87907
87980
  }
87908
- resolve5({
87981
+ resolve6({
87909
87982
  success: false,
87910
87983
  error: `Failed to execute command: ${error2.message}`,
87911
87984
  stdout: "",
@@ -87999,24 +88072,24 @@ function validateExecutionOptions(options = {}) {
87999
88072
  warnings
88000
88073
  };
88001
88074
  }
88002
- var import_child_process9, import_path9, import_fs9;
88075
+ var import_child_process9, import_path10, import_fs9;
88003
88076
  var init_bashExecutor = __esm({
88004
88077
  "src/agent/bashExecutor.js"() {
88005
88078
  "use strict";
88006
88079
  import_child_process9 = require("child_process");
88007
- import_path9 = require("path");
88080
+ import_path10 = require("path");
88008
88081
  import_fs9 = require("fs");
88009
88082
  init_bashCommandUtils();
88010
88083
  }
88011
88084
  });
88012
88085
 
88013
88086
  // src/tools/bash.js
88014
- var import_ai4, import_path10, bashTool;
88087
+ var import_ai4, import_path11, bashTool;
88015
88088
  var init_bash = __esm({
88016
88089
  "src/tools/bash.js"() {
88017
88090
  "use strict";
88018
88091
  import_ai4 = require("ai");
88019
- import_path10 = require("path");
88092
+ import_path11 = require("path");
88020
88093
  init_bashPermissions();
88021
88094
  init_bashExecutor();
88022
88095
  bashTool = (options = {}) => {
@@ -88124,12 +88197,13 @@ For code exploration, try these safe alternatives:
88124
88197
  - git status, git log, git show for git operations
88125
88198
  - npm list, pip list for package information`;
88126
88199
  }
88127
- const workingDir = workingDirectory || getDefaultWorkingDirectory();
88200
+ const defaultDir = getDefaultWorkingDirectory();
88201
+ const workingDir = workingDirectory ? (0, import_path11.isAbsolute)(workingDirectory) ? (0, import_path11.resolve)(workingDirectory) : (0, import_path11.resolve)(defaultDir, workingDirectory) : defaultDir;
88128
88202
  if (allowedFolders && allowedFolders.length > 0) {
88129
- const resolvedWorkingDir = (0, import_path10.resolve)(workingDir);
88203
+ const resolvedWorkingDir = (0, import_path11.resolve)(workingDir);
88130
88204
  const isAllowed = allowedFolders.some((folder) => {
88131
- const resolvedFolder = (0, import_path10.resolve)(folder);
88132
- return resolvedWorkingDir.startsWith(resolvedFolder);
88205
+ const resolvedFolder = (0, import_path11.resolve)(folder);
88206
+ return resolvedWorkingDir === resolvedFolder || resolvedWorkingDir.startsWith(resolvedFolder + import_path11.sep);
88133
88207
  });
88134
88208
  if (!isAllowed) {
88135
88209
  return `Error: Working directory "${workingDir}" is not within allowed folders: ${allowedFolders.join(", ")}`;
@@ -88184,14 +88258,14 @@ Command failed with exit code ${result.exitCode}`;
88184
88258
  // src/tools/edit.js
88185
88259
  function isPathAllowed(filePath, allowedFolders) {
88186
88260
  if (!allowedFolders || allowedFolders.length === 0) {
88187
- const resolvedPath3 = (0, import_path11.resolve)(filePath);
88188
- const cwd = (0, import_path11.resolve)(process.cwd());
88189
- return resolvedPath3 === cwd || resolvedPath3.startsWith(cwd + import_path11.sep);
88261
+ const resolvedPath3 = (0, import_path12.resolve)(filePath);
88262
+ const cwd = (0, import_path12.resolve)(process.cwd());
88263
+ return resolvedPath3 === cwd || resolvedPath3.startsWith(cwd + import_path12.sep);
88190
88264
  }
88191
- const resolvedPath2 = (0, import_path11.resolve)(filePath);
88265
+ const resolvedPath2 = (0, import_path12.resolve)(filePath);
88192
88266
  return allowedFolders.some((folder) => {
88193
- const allowedPath = (0, import_path11.resolve)(folder);
88194
- return resolvedPath2 === allowedPath || resolvedPath2.startsWith(allowedPath + import_path11.sep);
88267
+ const allowedPath = (0, import_path12.resolve)(folder);
88268
+ return resolvedPath2 === allowedPath || resolvedPath2.startsWith(allowedPath + import_path12.sep);
88195
88269
  });
88196
88270
  }
88197
88271
  function parseFileToolOptions(options = {}) {
@@ -88201,13 +88275,13 @@ function parseFileToolOptions(options = {}) {
88201
88275
  cwd: options.cwd
88202
88276
  };
88203
88277
  }
88204
- var import_ai5, import_fs10, import_path11, import_fs11, editTool, createTool, editSchema, createSchema, editDescription, createDescription, editToolDefinition, createToolDefinition;
88278
+ var import_ai5, import_fs10, import_path12, import_fs11, editTool, createTool, editSchema, createSchema, editDescription, createDescription, editToolDefinition, createToolDefinition;
88205
88279
  var init_edit = __esm({
88206
88280
  "src/tools/edit.js"() {
88207
88281
  "use strict";
88208
88282
  import_ai5 = require("ai");
88209
88283
  import_fs10 = require("fs");
88210
- import_path11 = require("path");
88284
+ import_path12 = require("path");
88211
88285
  import_fs11 = require("fs");
88212
88286
  editTool = (options = {}) => {
88213
88287
  const { debug, allowedFolders, cwd } = parseFileToolOptions(options);
@@ -88261,7 +88335,7 @@ Important:
88261
88335
  if (new_string === void 0 || new_string === null || typeof new_string !== "string") {
88262
88336
  return `Error editing file: Invalid new_string - must be a string`;
88263
88337
  }
88264
- const resolvedPath2 = (0, import_path11.isAbsolute)(file_path) ? file_path : (0, import_path11.resolve)(cwd || process.cwd(), file_path);
88338
+ const resolvedPath2 = (0, import_path12.isAbsolute)(file_path) ? file_path : (0, import_path12.resolve)(cwd || process.cwd(), file_path);
88265
88339
  if (debug) {
88266
88340
  console.error(`[Edit] Attempting to edit file: ${resolvedPath2}`);
88267
88341
  }
@@ -88345,7 +88419,7 @@ Important:
88345
88419
  if (content === void 0 || content === null || typeof content !== "string") {
88346
88420
  return `Error creating file: Invalid content - must be a string`;
88347
88421
  }
88348
- const resolvedPath2 = (0, import_path11.isAbsolute)(file_path) ? file_path : (0, import_path11.resolve)(cwd || process.cwd(), file_path);
88422
+ const resolvedPath2 = (0, import_path12.isAbsolute)(file_path) ? file_path : (0, import_path12.resolve)(cwd || process.cwd(), file_path);
88349
88423
  if (debug) {
88350
88424
  console.error(`[Create] Attempting to create file: ${resolvedPath2}`);
88351
88425
  }
@@ -88355,7 +88429,7 @@ Important:
88355
88429
  if ((0, import_fs11.existsSync)(resolvedPath2) && !overwrite) {
88356
88430
  return `Error creating file: File already exists - ${file_path}. Use overwrite: true to replace it.`;
88357
88431
  }
88358
- const dir = (0, import_path11.dirname)(resolvedPath2);
88432
+ const dir = (0, import_path12.dirname)(resolvedPath2);
88359
88433
  await import_fs10.promises.mkdir(dir, { recursive: true });
88360
88434
  await import_fs10.promises.writeFile(resolvedPath2, content, "utf-8");
88361
88435
  const action = (0, import_fs11.existsSync)(resolvedPath2) && overwrite ? "overwrote" : "created";
@@ -88745,8 +88819,10 @@ __export(tools_exports, {
88745
88819
  editToolDefinition: () => editToolDefinition,
88746
88820
  extractSchema: () => extractSchema,
88747
88821
  extractTool: () => extractTool,
88822
+ parseAndResolvePaths: () => parseAndResolvePaths,
88748
88823
  querySchema: () => querySchema,
88749
88824
  queryTool: () => queryTool,
88825
+ resolveTargetPath: () => resolveTargetPath,
88750
88826
  searchSchema: () => searchSchema,
88751
88827
  searchTool: () => searchTool,
88752
88828
  tools: () => tools
@@ -88786,7 +88862,7 @@ async function listFilesByLevel(options) {
88786
88862
  if (!import_fs12.default.existsSync(directory)) {
88787
88863
  throw new Error(`Directory does not exist: ${directory}`);
88788
88864
  }
88789
- const gitDirExists = import_fs12.default.existsSync(import_path12.default.join(directory, ".git"));
88865
+ const gitDirExists = import_fs12.default.existsSync(import_path13.default.join(directory, ".git"));
88790
88866
  if (gitDirExists && respectGitignore) {
88791
88867
  try {
88792
88868
  return await listFilesUsingGit(directory, maxFiles);
@@ -88801,8 +88877,8 @@ async function listFilesUsingGit(directory, maxFiles) {
88801
88877
  const { stdout } = await execAsync3("git ls-files", { cwd: directory });
88802
88878
  const files = stdout.split("\n").filter(Boolean);
88803
88879
  const sortedFiles = files.sort((a4, b4) => {
88804
- const depthA = a4.split(import_path12.default.sep).length;
88805
- const depthB = b4.split(import_path12.default.sep).length;
88880
+ const depthA = a4.split(import_path13.default.sep).length;
88881
+ const depthB = b4.split(import_path13.default.sep).length;
88806
88882
  return depthA - depthB;
88807
88883
  });
88808
88884
  return sortedFiles.slice(0, maxFiles);
@@ -88819,23 +88895,23 @@ async function listFilesByLevelManually(directory, maxFiles, respectGitignore) {
88819
88895
  try {
88820
88896
  const entries = import_fs12.default.readdirSync(dir, { withFileTypes: true });
88821
88897
  const files = entries.filter((entry) => {
88822
- const fullPath = import_path12.default.join(dir, entry.name);
88898
+ const fullPath = import_path13.default.join(dir, entry.name);
88823
88899
  return getEntryTypeSync(entry, fullPath).isFile;
88824
88900
  });
88825
88901
  for (const file of files) {
88826
88902
  if (result.length >= maxFiles) break;
88827
- const filePath = import_path12.default.join(dir, file.name);
88828
- const relativePath = import_path12.default.relative(directory, filePath);
88903
+ const filePath = import_path13.default.join(dir, file.name);
88904
+ const relativePath = import_path13.default.relative(directory, filePath);
88829
88905
  if (shouldIgnore(relativePath, ignorePatterns)) continue;
88830
88906
  result.push(relativePath);
88831
88907
  }
88832
88908
  const dirs = entries.filter((entry) => {
88833
- const fullPath = import_path12.default.join(dir, entry.name);
88909
+ const fullPath = import_path13.default.join(dir, entry.name);
88834
88910
  return getEntryTypeSync(entry, fullPath).isDirectory;
88835
88911
  });
88836
88912
  for (const subdir of dirs) {
88837
- const subdirPath = import_path12.default.join(dir, subdir.name);
88838
- const relativeSubdirPath = import_path12.default.relative(directory, subdirPath);
88913
+ const subdirPath = import_path13.default.join(dir, subdir.name);
88914
+ const relativeSubdirPath = import_path13.default.relative(directory, subdirPath);
88839
88915
  if (shouldIgnore(relativeSubdirPath, ignorePatterns)) continue;
88840
88916
  if (subdir.name === "node_modules" || subdir.name === ".git") continue;
88841
88917
  queue.push({ dir: subdirPath, level: level + 1 });
@@ -88847,7 +88923,7 @@ async function listFilesByLevelManually(directory, maxFiles, respectGitignore) {
88847
88923
  return result;
88848
88924
  }
88849
88925
  function loadGitignorePatterns(directory) {
88850
- const gitignorePath = import_path12.default.join(directory, ".gitignore");
88926
+ const gitignorePath = import_path13.default.join(directory, ".gitignore");
88851
88927
  if (!import_fs12.default.existsSync(gitignorePath)) {
88852
88928
  return [];
88853
88929
  }
@@ -88870,12 +88946,12 @@ function shouldIgnore(filePath, ignorePatterns) {
88870
88946
  }
88871
88947
  return false;
88872
88948
  }
88873
- var import_fs12, import_path12, import_util12, import_child_process10, execAsync3;
88949
+ var import_fs12, import_path13, import_util12, import_child_process10, execAsync3;
88874
88950
  var init_file_lister = __esm({
88875
88951
  "src/utils/file-lister.js"() {
88876
88952
  "use strict";
88877
88953
  import_fs12 = __toESM(require("fs"), 1);
88878
- import_path12 = __toESM(require("path"), 1);
88954
+ import_path13 = __toESM(require("path"), 1);
88879
88955
  import_util12 = require("util");
88880
88956
  import_child_process10 = require("child_process");
88881
88957
  init_symlink_utils();
@@ -88893,12 +88969,12 @@ function initializeSimpleTelemetryFromOptions(options) {
88893
88969
  });
88894
88970
  return telemetry;
88895
88971
  }
88896
- var import_fs13, import_path13, SimpleTelemetry, SimpleAppTracer;
88972
+ var import_fs13, import_path14, SimpleTelemetry, SimpleAppTracer;
88897
88973
  var init_simpleTelemetry = __esm({
88898
88974
  "src/agent/simpleTelemetry.js"() {
88899
88975
  "use strict";
88900
88976
  import_fs13 = require("fs");
88901
- import_path13 = require("path");
88977
+ import_path14 = require("path");
88902
88978
  SimpleTelemetry = class {
88903
88979
  constructor(options = {}) {
88904
88980
  this.serviceName = options.serviceName || "probe-agent";
@@ -88912,7 +88988,7 @@ var init_simpleTelemetry = __esm({
88912
88988
  }
88913
88989
  initializeFileExporter() {
88914
88990
  try {
88915
- const dir = (0, import_path13.dirname)(this.filePath);
88991
+ const dir = (0, import_path14.dirname)(this.filePath);
88916
88992
  if (!(0, import_fs13.existsSync)(dir)) {
88917
88993
  (0, import_fs13.mkdirSync)(dir, { recursive: true });
88918
88994
  }
@@ -88977,20 +89053,20 @@ var init_simpleTelemetry = __esm({
88977
89053
  }
88978
89054
  async flush() {
88979
89055
  if (this.stream) {
88980
- return new Promise((resolve5) => {
88981
- this.stream.once("drain", resolve5);
89056
+ return new Promise((resolve6) => {
89057
+ this.stream.once("drain", resolve6);
88982
89058
  if (!this.stream.writableNeedDrain) {
88983
- resolve5();
89059
+ resolve6();
88984
89060
  }
88985
89061
  });
88986
89062
  }
88987
89063
  }
88988
89064
  async shutdown() {
88989
89065
  if (this.stream) {
88990
- return new Promise((resolve5) => {
89066
+ return new Promise((resolve6) => {
88991
89067
  this.stream.end(() => {
88992
89068
  console.log(`[SimpleTelemetry] File stream closed: ${this.filePath}`);
88993
- resolve5();
89069
+ resolve6();
88994
89070
  });
88995
89071
  });
88996
89072
  }