@agentv/core 4.12.7 → 4.12.8-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -471,8 +471,12 @@ declare const TEST_MESSAGE_ROLES: readonly ["system", "user", "assistant", "tool
471
471
  type TestMessageRole = (typeof TEST_MESSAGE_ROLE_VALUES)[number];
472
472
  /**
473
473
  * Text or structured payload attached to a message.
474
+ *
475
+ * Content arrays may mix plain string items with structured content blocks
476
+ * (e.g. `{ type: 'text' | 'file' | 'image', value: ... }`). Plain string items
477
+ * are treated as text segments by the loader and prompt builder.
474
478
  */
475
- type TestMessageContent = string | JsonObject | readonly JsonObject[];
479
+ type TestMessageContent = string | JsonObject | readonly (string | JsonObject)[];
476
480
  /**
477
481
  * System-authored instruction message.
478
482
  */
package/dist/index.d.ts CHANGED
@@ -471,8 +471,12 @@ declare const TEST_MESSAGE_ROLES: readonly ["system", "user", "assistant", "tool
471
471
  type TestMessageRole = (typeof TEST_MESSAGE_ROLE_VALUES)[number];
472
472
  /**
473
473
  * Text or structured payload attached to a message.
474
+ *
475
+ * Content arrays may mix plain string items with structured content blocks
476
+ * (e.g. `{ type: 'text' | 'file' | 'image', value: ... }`). Plain string items
477
+ * are treated as text segments by the loader and prompt builder.
474
478
  */
475
- type TestMessageContent = string | JsonObject | readonly JsonObject[];
479
+ type TestMessageContent = string | JsonObject | readonly (string | JsonObject)[];
476
480
  /**
477
481
  * System-authored instruction message.
478
482
  */
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  resolveDelegatedTargetDefinition,
26
26
  resolveFileReference,
27
27
  resolveTargetDefinition
28
- } from "./chunk-5POFMJJ7.js";
28
+ } from "./chunk-SWLNU3I6.js";
29
29
  import {
30
30
  execFileWithStdin,
31
31
  execShellWithStdin
@@ -195,6 +195,12 @@ function extractContentSegments(content) {
195
195
  }
196
196
  const segments = [];
197
197
  for (const segment of content) {
198
+ if (typeof segment === "string") {
199
+ if (segment.trim().length > 0) {
200
+ segments.push({ type: "text", value: segment });
201
+ }
202
+ continue;
203
+ }
198
204
  if (!isJsonObject(segment)) {
199
205
  continue;
200
206
  }
@@ -2789,6 +2795,15 @@ async function processMessages(options) {
2789
2795
  }
2790
2796
  const processedContent = [];
2791
2797
  for (const rawSegment of content) {
2798
+ if (typeof rawSegment === "string") {
2799
+ if (rawSegment.length > 0) {
2800
+ processedContent.push({ type: "text", value: rawSegment });
2801
+ if (textParts) {
2802
+ textParts.push(rawSegment);
2803
+ }
2804
+ }
2805
+ continue;
2806
+ }
2792
2807
  if (!isJsonObject(rawSegment)) {
2793
2808
  continue;
2794
2809
  }
@@ -2908,6 +2923,12 @@ async function processExpectedMessages(options) {
2908
2923
  } else if (Array.isArray(content)) {
2909
2924
  const processedContent = [];
2910
2925
  for (const rawSegment of content) {
2926
+ if (typeof rawSegment === "string") {
2927
+ if (rawSegment.length > 0) {
2928
+ processedContent.push({ type: "text", value: rawSegment });
2929
+ }
2930
+ continue;
2931
+ }
2911
2932
  if (!isJsonObject(rawSegment)) {
2912
2933
  continue;
2913
2934
  }