open-agents-ai 0.185.92 → 0.185.93
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 +12 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -68201,22 +68201,19 @@ Respond conversationally. Call task_complete with your final response.`;
|
|
|
68201
68201
|
try {
|
|
68202
68202
|
const result = JSON.parse(output.trim());
|
|
68203
68203
|
const summary = result.summary || "";
|
|
68204
|
-
const
|
|
68205
|
-
|
|
68206
|
-
|
|
68207
|
-
for (const line of output.split("\n")) {
|
|
68208
|
-
if (!line.trim())
|
|
68209
|
-
continue;
|
|
68210
|
-
try {
|
|
68211
|
-
const evt = JSON.parse(line);
|
|
68212
|
-
if (evt.status === "completed") {
|
|
68213
|
-
const summary = evt.summary || "";
|
|
68214
|
-
const match = summary.match(/Tokens:\s*[\d,]+\s+([\s\S]*)/);
|
|
68215
|
-
content = match ? match[1].trim() : summary;
|
|
68216
|
-
}
|
|
68217
|
-
} catch {
|
|
68218
|
-
}
|
|
68204
|
+
const summaryMatch = summary.match(/Tokens:\s*[\d,]+\s+([\s\S]*)/);
|
|
68205
|
+
if (summaryMatch && summaryMatch[1]?.trim()) {
|
|
68206
|
+
content = summaryMatch[1].trim();
|
|
68219
68207
|
}
|
|
68208
|
+
if (content.length < 20 && result.text) {
|
|
68209
|
+
const textMatch = result.text.match(/Tokens:[\s\S]*?\n\s*([\s\S]+?)$/);
|
|
68210
|
+
if (textMatch && textMatch[1]?.trim())
|
|
68211
|
+
content = textMatch[1].trim();
|
|
68212
|
+
}
|
|
68213
|
+
if (!content)
|
|
68214
|
+
content = summary;
|
|
68215
|
+
} catch {
|
|
68216
|
+
content = output.trim().slice(0, 500);
|
|
68220
68217
|
}
|
|
68221
68218
|
addAssistantMessage(session, content.trim());
|
|
68222
68219
|
jsonResponse(res, 200, {
|
package/package.json
CHANGED