@probelabs/probe 0.6.0-rc306 → 0.6.0-rc307

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
@@ -19578,10 +19578,10 @@ var init_dist2 = __esm({
19578
19578
  "ETIMEDOUT",
19579
19579
  "EPIPE"
19580
19580
  ];
19581
- VERSION = true ? "4.0.19" : "0.0.0-test";
19581
+ VERSION = true ? "4.0.21" : "0.0.0-test";
19582
19582
  suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
19583
19583
  suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
19584
- ignoreOverride = Symbol(
19584
+ ignoreOverride = /* @__PURE__ */ Symbol(
19585
19585
  "Let zodToJsonSchema decide on which parser to use"
19586
19586
  );
19587
19587
  defaultOptions = {
@@ -19917,7 +19917,7 @@ var init_dist2 = __esm({
19917
19917
  combined.$schema = "http://json-schema.org/draft-07/schema#";
19918
19918
  return combined;
19919
19919
  };
19920
- schemaSymbol = Symbol.for("vercel.ai.schema");
19920
+ schemaSymbol = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
19921
19921
  getOriginalFetch2 = () => globalThis.fetch;
19922
19922
  postJsonToApi = async ({
19923
19923
  url: url2,
@@ -22009,7 +22009,8 @@ async function prepareTools({
22009
22009
  } = await (0, import_internal2.prepareTools)({
22010
22010
  tools: ProviderTools,
22011
22011
  toolChoice,
22012
- supportsStructuredOutput: false
22012
+ supportsStructuredOutput: false,
22013
+ supportsStrictTools: false
22013
22014
  });
22014
22015
  toolWarnings.push(...anthropicToolWarnings);
22015
22016
  anthropicBetas.forEach((beta) => betas.add(beta));
@@ -24029,7 +24030,7 @@ var init_dist3 = __esm({
24029
24030
  details: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
24030
24031
  preview: external_exports.unknown().optional()
24031
24032
  });
24032
- VERSION2 = true ? "4.0.77" : "0.0.0-test";
24033
+ VERSION2 = true ? "4.0.82" : "0.0.0-test";
24033
24034
  bedrockRerankingResponseSchema = lazySchema(
24034
24035
  () => zodSchema(
24035
24036
  external_exports.object({
@@ -26761,7 +26762,10 @@ var init_HookManager = __esm({
26761
26762
  }
26762
26763
  });
26763
26764
 
26764
- // src/agent/imageConfig.js
26765
+ // src/agent/mediaConfig.js
26766
+ function isDocumentExtension(extension) {
26767
+ return SUPPORTED_DOCUMENT_EXTENSIONS.includes(extension?.toLowerCase());
26768
+ }
26765
26769
  function isFormatSupportedByProvider(extension, provider) {
26766
26770
  if (!extension || typeof extension !== "string") {
26767
26771
  return false;
@@ -26770,7 +26774,7 @@ function isFormatSupportedByProvider(extension, provider) {
26770
26774
  return false;
26771
26775
  }
26772
26776
  const ext2 = extension.toLowerCase();
26773
- if (!SUPPORTED_IMAGE_EXTENSIONS.includes(ext2)) {
26777
+ if (!SUPPORTED_MEDIA_EXTENSIONS.includes(ext2)) {
26774
26778
  return false;
26775
26779
  }
26776
26780
  if (!provider || typeof provider !== "string") {
@@ -26782,18 +26786,21 @@ function isFormatSupportedByProvider(extension, provider) {
26782
26786
  }
26783
26787
  return true;
26784
26788
  }
26785
- var SUPPORTED_IMAGE_EXTENSIONS, IMAGE_MIME_TYPES, PROVIDER_UNSUPPORTED_FORMATS;
26786
- var init_imageConfig = __esm({
26787
- "src/agent/imageConfig.js"() {
26789
+ var SUPPORTED_IMAGE_EXTENSIONS, SUPPORTED_DOCUMENT_EXTENSIONS, SUPPORTED_MEDIA_EXTENSIONS, MEDIA_MIME_TYPES, PROVIDER_UNSUPPORTED_FORMATS;
26790
+ var init_mediaConfig = __esm({
26791
+ "src/agent/mediaConfig.js"() {
26788
26792
  "use strict";
26789
26793
  SUPPORTED_IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "webp", "bmp", "svg"];
26790
- IMAGE_MIME_TYPES = {
26794
+ SUPPORTED_DOCUMENT_EXTENSIONS = ["pdf"];
26795
+ SUPPORTED_MEDIA_EXTENSIONS = [...SUPPORTED_IMAGE_EXTENSIONS, ...SUPPORTED_DOCUMENT_EXTENSIONS];
26796
+ MEDIA_MIME_TYPES = {
26791
26797
  "png": "image/png",
26792
26798
  "jpg": "image/jpeg",
26793
26799
  "jpeg": "image/jpeg",
26794
26800
  "webp": "image/webp",
26795
26801
  "bmp": "image/bmp",
26796
- "svg": "image/svg+xml"
26802
+ "svg": "image/svg+xml",
26803
+ "pdf": "application/pdf"
26797
26804
  };
26798
26805
  PROVIDER_UNSUPPORTED_FORMATS = {
26799
26806
  "google": ["svg"]
@@ -27806,7 +27813,7 @@ function resolveTargetPath(target, cwd) {
27806
27813
  }
27807
27814
  return filePart + suffix;
27808
27815
  }
27809
- var import_path6, searchDelegateSchema, searchSchema, searchAllSchema, querySchema, extractSchema, delegateSchema, listSkillsSchema, useSkillSchema, listFilesSchema, searchFilesSchema, readImageSchema, bashSchema, analyzeAllSchema, executePlanSchema, cleanupExecutePlanSchema, searchDescription, searchDelegateDescription, queryDescription, extractDescription, delegateDescription, bashDescription, analyzeAllDescription;
27816
+ var import_path6, searchDelegateSchema, searchSchema, searchAllSchema, querySchema, extractSchema, delegateSchema, listSkillsSchema, useSkillSchema, listFilesSchema, searchFilesSchema, readImageSchema, readMediaSchema, bashSchema, analyzeAllSchema, executePlanSchema, cleanupExecutePlanSchema, searchDescription, searchDelegateDescription, queryDescription, extractDescription, delegateDescription, bashDescription, analyzeAllDescription;
27810
27817
  var init_common = __esm({
27811
27818
  "src/tools/common.js"() {
27812
27819
  "use strict";
@@ -27862,6 +27869,9 @@ var init_common = __esm({
27862
27869
  readImageSchema = external_exports2.object({
27863
27870
  path: external_exports2.string().describe("Path to the image file to read. Supports png, jpg, jpeg, webp, bmp, and svg formats.")
27864
27871
  });
27872
+ readMediaSchema = external_exports2.object({
27873
+ path: external_exports2.string().describe("Path to the media file to read. Supports images (png, jpg, jpeg, webp, bmp, svg) and documents (pdf).")
27874
+ });
27865
27875
  bashSchema = external_exports2.object({
27866
27876
  command: external_exports2.string().describe("The bash command to execute"),
27867
27877
  workingDirectory: external_exports2.string().optional().describe("Directory to execute the command in (optional)"),
@@ -97485,7 +97495,7 @@ function debugLogToolResults(toolResults) {
97485
97495
  console.log(`[DEBUG] tool: ${tr.toolName} | args: ${debugTruncate(argsStr)} | result: ${debugTruncate(resultStr)}`);
97486
97496
  }
97487
97497
  }
97488
- var import_dotenv, import_ai4, import_crypto8, import_events4, import_fs11, import_promises6, import_path16, ENGINE_ACTIVITY_TIMEOUT_DEFAULT, ENGINE_ACTIVITY_TIMEOUT_MIN, ENGINE_ACTIVITY_TIMEOUT_MAX, MAX_TOOL_ITERATIONS, MAX_HISTORY_MESSAGES, MAX_IMAGE_FILE_SIZE, ProbeAgent;
97498
+ var import_dotenv, import_ai4, import_crypto8, import_events4, import_fs11, import_promises6, import_path16, ENGINE_ACTIVITY_TIMEOUT_DEFAULT, ENGINE_ACTIVITY_TIMEOUT_MIN, ENGINE_ACTIVITY_TIMEOUT_MAX, MAX_TOOL_ITERATIONS, MAX_HISTORY_MESSAGES, MAX_IMAGE_FILE_SIZE, MAX_DOCUMENT_FILE_SIZE, ProbeAgent;
97489
97499
  var init_ProbeAgent = __esm({
97490
97500
  "src/agent/ProbeAgent.js"() {
97491
97501
  "use strict";
@@ -97501,7 +97511,7 @@ var init_ProbeAgent = __esm({
97501
97511
  init_simpleTelemetry();
97502
97512
  init_InMemoryStorageAdapter();
97503
97513
  init_HookManager();
97504
- init_imageConfig();
97514
+ init_mediaConfig();
97505
97515
  init_tools();
97506
97516
  init_common();
97507
97517
  init_taskTool();
@@ -97539,6 +97549,7 @@ var init_ProbeAgent = __esm({
97539
97549
  })();
97540
97550
  MAX_HISTORY_MESSAGES = 100;
97541
97551
  MAX_IMAGE_FILE_SIZE = 20 * 1024 * 1024;
97552
+ MAX_DOCUMENT_FILE_SIZE = 32 * 1024 * 1024;
97542
97553
  ProbeAgent = class _ProbeAgent {
97543
97554
  /**
97544
97555
  * Create a new ProbeAgent instance
@@ -98167,28 +98178,29 @@ var init_ProbeAgent = __esm({
98167
98178
  this.toolImplementations.useSkill = useSkillToolInstance;
98168
98179
  }
98169
98180
  }
98170
- if (isToolAllowed("readImage")) {
98171
- this.toolImplementations.readImage = {
98172
- execute: async (params) => {
98173
- const imagePath = params.path;
98174
- if (!imagePath) {
98175
- throw new Error("Image path is required");
98176
- }
98177
- const filename = (0, import_path16.basename)(imagePath);
98178
- const extension = filename.toLowerCase().split(".").pop();
98179
- if (!extension || !SUPPORTED_IMAGE_EXTENSIONS.includes(extension)) {
98180
- throw new Error(`Invalid or unsupported image extension: ${extension}. Supported formats: ${SUPPORTED_IMAGE_EXTENSIONS.join(", ")}`);
98181
- }
98182
- if (this.apiType && !isFormatSupportedByProvider(extension, this.apiType)) {
98183
- throw new Error(`Image format '${extension}' is not supported by the current AI provider (${this.apiType}). Try using a different image format like PNG or JPEG.`);
98184
- }
98185
- const loaded = await this.loadImageIfValid(imagePath);
98186
- if (!loaded) {
98187
- throw new Error(`Failed to load image: ${imagePath}. The file may not exist, be too large, have an unsupported format, or be outside allowed directories.`);
98188
- }
98189
- return `Image loaded successfully: ${imagePath}. The image is now available for analysis in the conversation.`;
98190
- }
98191
- };
98181
+ const readMediaExecute = async (params) => {
98182
+ const mediaPath = params.path;
98183
+ if (!mediaPath) {
98184
+ throw new Error("File path is required");
98185
+ }
98186
+ const filename = (0, import_path16.basename)(mediaPath);
98187
+ const extension = filename.toLowerCase().split(".").pop();
98188
+ if (!extension || !SUPPORTED_MEDIA_EXTENSIONS.includes(extension)) {
98189
+ throw new Error(`Unsupported file format: ${extension}. Supported formats: ${SUPPORTED_MEDIA_EXTENSIONS.join(", ")}`);
98190
+ }
98191
+ if (this.apiType && !isFormatSupportedByProvider(extension, this.apiType)) {
98192
+ throw new Error(`File format '${extension}' is not supported by the current AI provider (${this.apiType}). Try converting to a different format.`);
98193
+ }
98194
+ const loaded = await this.loadMediaIfValid(mediaPath);
98195
+ if (!loaded) {
98196
+ throw new Error(`Failed to load file: ${mediaPath}. The file may not exist, be too large, have an unsupported format, or be outside allowed directories.`);
98197
+ }
98198
+ const mediaType = isDocumentExtension(extension) ? "Document" : "Image";
98199
+ return `${mediaType} loaded successfully: ${mediaPath}. The file is now available for analysis in the conversation.`;
98200
+ };
98201
+ if (isToolAllowed("readMedia") || isToolAllowed("readImage")) {
98202
+ this.toolImplementations.readMedia = { execute: readMediaExecute };
98203
+ this.toolImplementations.readImage = { execute: readMediaExecute };
98192
98204
  }
98193
98205
  if (this.enableBash && wrappedTools.bashToolInstance && isToolAllowed("bash")) {
98194
98206
  this.toolImplementations.bash = wrappedTools.bashToolInstance;
@@ -99184,9 +99196,9 @@ var init_ProbeAgent = __esm({
99184
99196
  schema: searchFilesSchema,
99185
99197
  description: "Find files matching a glob pattern with recursive search capability."
99186
99198
  },
99187
- readImage: {
99188
- schema: readImageSchema,
99189
- description: "Read and load an image file for AI analysis."
99199
+ readMedia: {
99200
+ schema: readMediaSchema,
99201
+ description: "Read and load a media file (image or PDF document) for AI analysis. Supports: png, jpg, jpeg, webp, bmp, svg, pdf."
99190
99202
  },
99191
99203
  listSkills: {
99192
99204
  schema: listSkillsSchema,
@@ -99331,7 +99343,7 @@ var init_ProbeAgent = __esm({
99331
99343
  async processImageReferences(content) {
99332
99344
  if (!content) return;
99333
99345
  const listFilesDirectories = this.extractListFilesDirectories(content);
99334
- const extensionsPattern = `(?:${SUPPORTED_IMAGE_EXTENSIONS.join("|")})`;
99346
+ const extensionsPattern = `(?:${SUPPORTED_MEDIA_EXTENSIONS.join("|")})`;
99335
99347
  const imagePatterns = [
99336
99348
  // Direct file path mentions: "./screenshot.png", "/path/to/image.jpg", etc.
99337
99349
  new RegExp(`(?:\\.?\\.\\/)?[^\\s"'<>\\[\\]]+\\.${extensionsPattern}(?!\\w)`, "gi"),
@@ -99413,23 +99425,23 @@ var init_ProbeAgent = __esm({
99413
99425
  return directories;
99414
99426
  }
99415
99427
  /**
99416
- * Load and cache an image if it's valid and accessible
99417
- * @param {string} imagePath - Path to the image file
99418
- * @returns {Promise<boolean>} - True if image was loaded successfully
99428
+ * Load and cache a media file (image or PDF) if it's valid and accessible
99429
+ * @param {string} mediaPath - Path to the media file
99430
+ * @returns {Promise<boolean>} - True if file was loaded successfully
99419
99431
  */
99420
- async loadImageIfValid(imagePath) {
99432
+ async loadMediaIfValid(mediaPath) {
99421
99433
  try {
99422
- if (this.pendingImages.has(imagePath)) {
99434
+ if (this.pendingImages.has(mediaPath)) {
99423
99435
  if (this.debug) {
99424
- console.log(`[DEBUG] Image already loaded: ${imagePath}`);
99436
+ console.log(`[DEBUG] Media already loaded: ${mediaPath}`);
99425
99437
  }
99426
99438
  return true;
99427
99439
  }
99428
99440
  const allowedDirs = this.allowedFolders && this.allowedFolders.length > 0 ? this.allowedFolders : [process.cwd()];
99429
99441
  let absolutePath;
99430
99442
  let isPathAllowed2 = false;
99431
- if ((0, import_path16.isAbsolute)(imagePath)) {
99432
- absolutePath = safeRealpath((0, import_path16.resolve)(imagePath));
99443
+ if ((0, import_path16.isAbsolute)(mediaPath)) {
99444
+ absolutePath = safeRealpath((0, import_path16.resolve)(mediaPath));
99433
99445
  isPathAllowed2 = allowedDirs.some((dir) => {
99434
99446
  const resolvedDir = safeRealpath(dir);
99435
99447
  return absolutePath === resolvedDir || absolutePath.startsWith(resolvedDir + import_path16.sep);
@@ -99437,7 +99449,7 @@ var init_ProbeAgent = __esm({
99437
99449
  } else {
99438
99450
  for (const dir of allowedDirs) {
99439
99451
  const resolvedDir = safeRealpath(dir);
99440
- const resolvedPath = safeRealpath((0, import_path16.resolve)(dir, imagePath));
99452
+ const resolvedPath = safeRealpath((0, import_path16.resolve)(dir, mediaPath));
99441
99453
  if (resolvedPath === resolvedDir || resolvedPath.startsWith(resolvedDir + import_path16.sep)) {
99442
99454
  absolutePath = resolvedPath;
99443
99455
  isPathAllowed2 = true;
@@ -99447,7 +99459,7 @@ var init_ProbeAgent = __esm({
99447
99459
  }
99448
99460
  if (!isPathAllowed2) {
99449
99461
  if (this.debug) {
99450
- console.log(`[DEBUG] Image path outside allowed directories: ${imagePath}`);
99462
+ console.log(`[DEBUG] Media path outside allowed directories: ${mediaPath}`);
99451
99463
  }
99452
99464
  return false;
99453
99465
  }
@@ -99456,91 +99468,126 @@ var init_ProbeAgent = __esm({
99456
99468
  fileStats = await (0, import_promises6.stat)(absolutePath);
99457
99469
  } catch (error40) {
99458
99470
  if (this.debug) {
99459
- console.log(`[DEBUG] Image file not found: ${absolutePath}`);
99471
+ console.log(`[DEBUG] Media file not found: ${absolutePath}`);
99460
99472
  }
99461
99473
  return false;
99462
99474
  }
99463
- if (fileStats.size > MAX_IMAGE_FILE_SIZE) {
99475
+ const extension = absolutePath.toLowerCase().split(".").pop();
99476
+ if (!SUPPORTED_MEDIA_EXTENSIONS.includes(extension)) {
99464
99477
  if (this.debug) {
99465
- console.log(`[DEBUG] Image file too large: ${absolutePath} (${fileStats.size} bytes, max: ${MAX_IMAGE_FILE_SIZE})`);
99478
+ console.log(`[DEBUG] Unsupported media format: ${extension}`);
99466
99479
  }
99467
99480
  return false;
99468
99481
  }
99469
- const extension = absolutePath.toLowerCase().split(".").pop();
99470
- if (!SUPPORTED_IMAGE_EXTENSIONS.includes(extension)) {
99482
+ const maxSize = isDocumentExtension(extension) ? MAX_DOCUMENT_FILE_SIZE : MAX_IMAGE_FILE_SIZE;
99483
+ if (fileStats.size > maxSize) {
99471
99484
  if (this.debug) {
99472
- console.log(`[DEBUG] Unsupported image format: ${extension}`);
99485
+ console.log(`[DEBUG] Media file too large: ${absolutePath} (${fileStats.size} bytes, max: ${maxSize})`);
99473
99486
  }
99474
99487
  return false;
99475
99488
  }
99476
- const mimeType = IMAGE_MIME_TYPES[extension];
99489
+ const mimeType = MEDIA_MIME_TYPES[extension];
99477
99490
  const fileBuffer = await (0, import_promises6.readFile)(absolutePath);
99478
99491
  const base64Data = fileBuffer.toString("base64");
99479
- const dataUrl = `data:${mimeType};base64,${base64Data}`;
99480
- this.pendingImages.set(imagePath, dataUrl);
99492
+ if (isDocumentExtension(extension)) {
99493
+ this.pendingImages.set(mediaPath, {
99494
+ type: "document",
99495
+ mimeType,
99496
+ data: base64Data,
99497
+ filename: (0, import_path16.basename)(mediaPath)
99498
+ });
99499
+ } else {
99500
+ const dataUrl = `data:${mimeType};base64,${base64Data}`;
99501
+ this.pendingImages.set(mediaPath, dataUrl);
99502
+ }
99481
99503
  if (this.debug) {
99482
- console.log(`[DEBUG] Successfully loaded image: ${imagePath} (${fileBuffer.length} bytes)`);
99504
+ console.log(`[DEBUG] Successfully loaded media: ${mediaPath} (${fileBuffer.length} bytes, ${mimeType})`);
99483
99505
  }
99484
99506
  return true;
99485
99507
  } catch (error40) {
99486
99508
  if (this.debug) {
99487
- console.log(`[DEBUG] Failed to load image ${imagePath}: ${error40.message}`);
99509
+ console.log(`[DEBUG] Failed to load media ${mediaPath}: ${error40.message}`);
99488
99510
  }
99489
99511
  return false;
99490
99512
  }
99491
99513
  }
99514
+ /**
99515
+ * Backward-compatible alias for loadMediaIfValid
99516
+ * @param {string} imagePath - Path to the image file
99517
+ * @returns {Promise<boolean>}
99518
+ */
99519
+ async loadImageIfValid(imagePath) {
99520
+ return this.loadMediaIfValid(imagePath);
99521
+ }
99492
99522
  /**
99493
99523
  * Get all currently loaded images as an array for AI model consumption
99494
- * @returns {Array<string>} - Array of base64 data URLs
99524
+ * @returns {Array<string>} - Array of base64 data URLs (images only, for backward compat)
99495
99525
  */
99496
99526
  getCurrentImages() {
99497
- return Array.from(this.pendingImages.values());
99527
+ return Array.from(this.pendingImages.values()).filter((v) => typeof v === "string");
99498
99528
  }
99499
99529
  /**
99500
- * Clear loaded images (useful for new conversations)
99530
+ * Get all currently loaded media as an array of content parts
99531
+ * @returns {Array<Object>} - Array of Vercel AI SDK content parts
99532
+ */
99533
+ getCurrentMedia() {
99534
+ const parts = [];
99535
+ for (const entry of this.pendingImages.values()) {
99536
+ if (typeof entry === "string") {
99537
+ parts.push({ type: "image", image: entry });
99538
+ } else if (entry && entry.type === "document") {
99539
+ parts.push({
99540
+ type: "file",
99541
+ mediaType: entry.mimeType,
99542
+ data: entry.data,
99543
+ filename: entry.filename
99544
+ });
99545
+ }
99546
+ }
99547
+ return parts;
99548
+ }
99549
+ /**
99550
+ * Clear loaded media (useful for new conversations)
99501
99551
  */
99502
99552
  clearLoadedImages() {
99503
99553
  this.pendingImages.clear();
99504
99554
  this.currentImages = [];
99505
99555
  if (this.debug) {
99506
- console.log("[DEBUG] Cleared all loaded images");
99556
+ console.log("[DEBUG] Cleared all loaded media");
99507
99557
  }
99508
99558
  }
99509
99559
  /**
99510
- * Prepare messages for AI consumption, adding images to the latest user message if available
99560
+ * Prepare messages for AI consumption, adding media to the latest user message if available
99511
99561
  * @param {Array} messages - Current conversation messages
99512
- * @returns {Array} - Messages formatted for AI SDK with potential image content
99562
+ * @returns {Array} - Messages formatted for AI SDK with potential media content
99513
99563
  */
99514
99564
  prepareMessagesWithImages(messages) {
99515
- const loadedImages = this.getCurrentImages();
99516
- if (loadedImages.length === 0) {
99565
+ const mediaParts = this.getCurrentMedia();
99566
+ if (mediaParts.length === 0) {
99517
99567
  return messages;
99518
99568
  }
99519
- const messagesWithImages = [...messages];
99520
- const lastUserMessageIndex = messagesWithImages.map((m) => m.role).lastIndexOf("user");
99569
+ const messagesWithMedia = [...messages];
99570
+ const lastUserMessageIndex = messagesWithMedia.map((m) => m.role).lastIndexOf("user");
99521
99571
  if (lastUserMessageIndex === -1) {
99522
99572
  if (this.debug) {
99523
- console.log("[DEBUG] No user messages found to attach images to");
99573
+ console.log("[DEBUG] No user messages found to attach media to");
99524
99574
  }
99525
99575
  return messages;
99526
99576
  }
99527
- const lastUserMessage = messagesWithImages[lastUserMessageIndex];
99577
+ const lastUserMessage = messagesWithMedia[lastUserMessageIndex];
99528
99578
  if (typeof lastUserMessage.content === "string") {
99529
- messagesWithImages[lastUserMessageIndex] = {
99579
+ messagesWithMedia[lastUserMessageIndex] = {
99530
99580
  ...lastUserMessage,
99531
99581
  content: [
99532
99582
  { type: "text", text: lastUserMessage.content },
99533
- ...loadedImages.map((imageData) => ({
99534
- type: "image",
99535
- image: imageData
99536
- }))
99583
+ ...mediaParts
99537
99584
  ]
99538
99585
  };
99539
99586
  if (this.debug) {
99540
- console.log(`[DEBUG] Added ${loadedImages.length} images to the latest user message`);
99587
+ console.log(`[DEBUG] Added ${mediaParts.length} media items to the latest user message`);
99541
99588
  }
99542
99589
  }
99543
- return messagesWithImages;
99590
+ return messagesWithMedia;
99544
99591
  }
99545
99592
  /**
99546
99593
  * Initialize mock model for testing
@@ -105321,6 +105368,7 @@ __export(tools_exports, {
105321
105368
  querySchema: () => querySchema,
105322
105369
  queryTool: () => queryTool,
105323
105370
  readImageSchema: () => readImageSchema,
105371
+ readMediaSchema: () => readMediaSchema,
105324
105372
  resolveTargetPath: () => resolveTargetPath,
105325
105373
  searchFilesSchema: () => searchFilesSchema,
105326
105374
  searchSchema: () => searchSchema,
@@ -105526,6 +105574,7 @@ __export(index_exports, {
105526
105574
  querySchema: () => querySchema,
105527
105575
  queryTool: () => queryTool,
105528
105576
  readImageSchema: () => readImageSchema,
105577
+ readMediaSchema: () => readMediaSchema,
105529
105578
  search: () => search,
105530
105579
  searchFilesSchema: () => searchFilesSchema,
105531
105580
  searchFilesToolInstance: () => searchFilesToolInstance,
@@ -105615,6 +105664,7 @@ init_index();
105615
105664
  querySchema,
105616
105665
  queryTool,
105617
105666
  readImageSchema,
105667
+ readMediaSchema,
105618
105668
  search,
105619
105669
  searchFilesSchema,
105620
105670
  searchFilesToolInstance,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe",
3
- "version": "0.6.0-rc306",
3
+ "version": "0.6.0-rc307",
4
4
  "description": "Node.js wrapper for the probe code search tool",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",