@ljoukov/llm 7.0.7 → 7.0.8

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.js CHANGED
@@ -10399,9 +10399,11 @@ var subagentInputItemSchema = z4.object({
10399
10399
  }).passthrough();
10400
10400
  var spawnAgentInputSchema = z4.object({
10401
10401
  prompt: z4.string().nullish().describe("Alias for message. Initial plain-text task for the new agent."),
10402
- message: z4.string().nullish().describe("Initial plain-text task for the new agent. Use either message or items."),
10402
+ message: z4.string().nullish().describe(
10403
+ "Initial plain-text task for the new agent. Combined with items when both are provided."
10404
+ ),
10403
10405
  items: z4.array(subagentInputItemSchema).nullish().describe(
10404
- "Structured input items. Use this to pass explicit mentions (for example app:// connector paths)."
10406
+ "Structured input items. Use this to pass explicit mentions (for example app:// connector paths). Combined with message/input when both are provided."
10405
10407
  ),
10406
10408
  agent_type: z4.string().nullish().describe(SPAWN_AGENT_TYPE_DESCRIPTION),
10407
10409
  fork_context: z4.boolean().nullish().describe(
@@ -10560,7 +10562,6 @@ function createSubagentToolController(options) {
10560
10562
  const initialPrompt = resolveCollabInputText({
10561
10563
  textCandidates: [{ value: input.prompt }, { value: input.message }],
10562
10564
  items: input.items,
10563
- bothError: "Provide either prompt/message or items, but not both.",
10564
10565
  missingError: "Provide one of: prompt/message or items.",
10565
10566
  emptyTextError: "Empty message can't be sent to an agent.",
10566
10567
  emptyItemsError: "Items can't be empty."
@@ -10613,7 +10614,6 @@ function createSubagentToolController(options) {
10613
10614
  const nextInput = resolveCollabInputText({
10614
10615
  textCandidates: [{ value: input.input }, { value: input.message }],
10615
10616
  items: input.items,
10616
- bothError: "Provide either input/message or items, but not both.",
10617
10617
  missingError: "Provide one of: input/message or items.",
10618
10618
  emptyTextError: "Empty message can't be sent to an agent.",
10619
10619
  emptyItemsError: "Items can't be empty."
@@ -10767,18 +10767,19 @@ function resolveCollabInputText(params) {
10767
10767
  );
10768
10768
  const hasText = Boolean(textCandidate);
10769
10769
  const hasItems = params.items !== void 0 && params.items !== null;
10770
- if (hasText && hasItems) {
10771
- throw new Error(params.bothError);
10772
- }
10773
10770
  if (!hasText && !hasItems) {
10774
10771
  throw new Error(params.missingError);
10775
10772
  }
10773
+ const blocks = [];
10776
10774
  if (hasText) {
10777
10775
  const value = textCandidate?.value?.trim();
10778
10776
  if (!value) {
10779
10777
  throw new Error(params.emptyTextError);
10780
10778
  }
10781
- return value;
10779
+ blocks.push(value);
10780
+ }
10781
+ if (!hasItems) {
10782
+ return blocks.join("\n\n");
10782
10783
  }
10783
10784
  if (!params.items || params.items.length === 0) {
10784
10785
  throw new Error(params.emptyItemsError);
@@ -10787,7 +10788,8 @@ function resolveCollabInputText(params) {
10787
10788
  if (!itemText) {
10788
10789
  throw new Error(params.emptyItemsError);
10789
10790
  }
10790
- return itemText;
10791
+ blocks.push(itemText);
10792
+ return blocks.join("\n\n");
10791
10793
  }
10792
10794
  function resolveInputItemsText(items) {
10793
10795
  if (!items || items.length === 0) {