@agentproto/driver-agent-cli 2.5.0 → 2.5.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.
@@ -1033,14 +1033,26 @@ function setupMcpConfigFile(opts, eventSchema) {
1033
1033
  }
1034
1034
  function extractPromptText(message) {
1035
1035
  if (typeof message === "string") return message;
1036
- if (message !== null && typeof message === "object") {
1037
- const m = message;
1038
- if (typeof m.text === "string") return m.text;
1039
- if (Array.isArray(message)) {
1040
- return message.filter((b) => b.type === "text" && typeof b.text === "string").map((b) => b.text).join("\n");
1036
+ const blocks = Array.isArray(message) ? message : [message];
1037
+ const texts = [];
1038
+ for (const block of blocks) {
1039
+ if (block !== null && typeof block === "object") {
1040
+ const b = block;
1041
+ if (b.type === "text" && typeof b.text === "string") {
1042
+ texts.push(b.text);
1043
+ continue;
1044
+ }
1045
+ if (b.type === void 0 && typeof b.text === "string") {
1046
+ texts.push(b.text);
1047
+ continue;
1048
+ }
1041
1049
  }
1050
+ const kind = block !== null && typeof block === "object" && typeof block.type === "string" ? block.type : typeof block;
1051
+ throw new Error(
1052
+ `this adapter has no multimodal input (capabilities.multimodal: false) \u2014 got a "${kind}" content block it can't send. Upload the file via POST /files/upload and reference its path in the prompt text instead.`
1053
+ );
1042
1054
  }
1043
- return JSON.stringify(message);
1055
+ return texts.join("\n");
1044
1056
  }
1045
1057
  function captureSessionId(evt, schema) {
1046
1058
  switch (schema) {
@@ -2285,5 +2297,5 @@ function derivedModelRefusalError(definition, requested, reason) {
2285
2297
  }
2286
2298
 
2287
2299
  export { LEGACY_GATEWAY_MODE_IDS, LEGACY_POSTURE_MODE_IDS, RuntimeConfigError, agentCliFrontmatterSchema, applyModelCommand, autoAllowPermissionHandler, composeSpawn, createAcpProtocolArm, createAgentCliRuntime, createArmSessionControls, createJcodeMapperState, createMastraMapperState, createPrintSession, createProprietaryProtocolArm, defineAgentCli, inferLegacyModeKind, isLegacyExtractedModeId, isModelSwitchAcknowledgement, mapJcodeEvent, mapMastraEvent, parseModelSwitchCommand, planModePermissionHandler, promptTurn, resolveContinuationStrategy, runtimeConfigSchema, toFileBasedMcpServers };
2288
- //# sourceMappingURL=chunk-JPL6CMLQ.mjs.map
2289
- //# sourceMappingURL=chunk-JPL6CMLQ.mjs.map
2300
+ //# sourceMappingURL=chunk-ES4VLTGZ.mjs.map
2301
+ //# sourceMappingURL=chunk-ES4VLTGZ.mjs.map