mslxdff 0.1.115 → 0.1.116

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mslxdff",
3
- "version": "0.1.115",
3
+ "version": "0.1.116",
4
4
  "description": "测试项目,请勿使用。",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,7 +43,8 @@ export function responsesToChatBody(req = {}) {
43
43
  }
44
44
  continue;
45
45
  }
46
- if (it.type === "message") {
46
+ // responses 规范:message item 的 type 可省(AI SDK/opencode 就不发)→ 有 role 即按 message 处理
47
+ if (it.type === "message" || (!it.type && it.role)) {
47
48
  const msg = { role: it.role || "user", content: inputTextOf(it.content) };
48
49
  if (pendingReasoning.length && msg.role === "assistant") { msg.reasoning_items = pendingReasoning; pendingReasoning = []; }
49
50
  messages.push(msg);
@@ -112,6 +112,15 @@ export async function responsesHandler(ctx) {
112
112
  inputKinds: Array.isArray(body?.input) ? [...new Set(body.input.map((i) => i?.type))] : null,
113
113
  tools: Array.isArray(body?.tools) ? body.tools.length : 0,
114
114
  instructionsLen: String(body?.instructions || "").length,
115
+ // 文本丢失定位:各 message item 的 content 形状(part 类型 + 文本长度 + 头部)
116
+ contentShapes: Array.isArray(body?.input)
117
+ ? body.input.filter((i) => i && (i.type === "message" || i.role)).map((m) => ({
118
+ type: m.type ?? "(无type)", role: m.role,
119
+ cType: Array.isArray(m.content) ? "array" : typeof m.content,
120
+ parts: Array.isArray(m.content) ? m.content.map((p) => `${p?.type ?? "?"}:${typeof p?.text === "string" ? p.text.length : "-"}`).slice(0, 6) : null,
121
+ textHead: typeof m.content === "string" ? m.content.slice(0, 50) : null,
122
+ })).slice(0, 10)
123
+ : null,
115
124
  }));
116
125
  let chatBody;
117
126
  try {